Discussion:
serial ports galore
(too old to reply)
muta...@gmail.com
2021-06-16 07:15:29 UTC
Permalink
INT 14H allows you to specify the port in DX.

http://www.ctyme.com/intr/rb-0811.htm

It starts at 0 = COM1, meaning 65535 = COM65536.

That's a shitload of theoretical COM ports the
manufacturer can provide.

Any reason why PDOS shouldn't just accept an
fopen("COM54321", "w+b");
and see what the port has to offer?

Does it make sense to match it to internet port
numbers, so I do an fopen("COM80") or COM81
to see if any HTML terminal is trying to connect
to me?

Or should I channel such things down COM1 and
send an ATinport=80 and ATA?

I guess the objective is to have a multi-line BBS
that still enables dial-out.

BFN. Paul.
Joe Monk
2021-06-16 10:19:18 UTC
Permalink
Remember, COM ports are tied to IRQs. IRQ3/4.

There are only 4 because thats all the 8250 UART could provide, and the 8259 PIC could only give up two IRQs.

If you use a driver, such as a digiboard, then it could handle more via software interrupt...

Joe
muta...@gmail.com
2021-06-16 10:31:03 UTC
Permalink
Post by Joe Monk
Remember, COM ports are tied to IRQs. IRQ3/4.
There are only 4 because thats all the 8250 UART could provide, and the 8259 PIC could only give up two IRQs.
If you use a driver, such as a digiboard, then it could handle more via software interrupt...
The BIOS manufacturer can provide as many devices
behind that interrupt as they want.

The normal INT 14H is polled anyway, for read.
Not sure if something depends on an interrupt
for the write. But the manufacturer can share an
interrupt or anything else they want to do.

BFN. Paul.
wolfgang kern
2021-06-16 10:59:08 UTC
Permalink
Post by ***@gmail.com
Post by Joe Monk
Remember, COM ports are tied to IRQs. IRQ3/4.
There are only 4 because thats all the 8250 UART could provide, and the 8259 PIC could only give up two IRQs.
If you use a driver, such as a digiboard, then it could handle more via software interrupt...
The BIOS manufacturer can provide as many devices
behind that interrupt as they want.
NO, because I/O-ports are real hardware and there are only four
port-addresses defined and reserved for COM1..4, windoze just fakes shared.
Post by ***@gmail.com
The normal INT 14H is polled anyway, for read.
Not sure if something depends on an interrupt
for the write. But the manufacturer can share an
interrupt or anything else they want to do.
NO, it seems you have not read anything about hardware so far.

INT 14h is/was an old BIOS function which almost nobody used.
the underlying IRQs (3/4/5/7/10/11 or APIC) mean real existing
ports were connected to PIC or APIC.
__
wolfgang
muta...@gmail.com
2021-06-16 11:13:19 UTC
Permalink
Post by wolfgang kern
Post by ***@gmail.com
The BIOS manufacturer can provide as many devices
behind that interrupt as they want.
NO, because I/O-ports are real hardware and there are only four
port-addresses defined and reserved for COM1..4, windoze just fakes shared.
Who says there are only four port address defined
for COM ports? How many I/O ports can an 80386
address anyway?
Post by wolfgang kern
Post by ***@gmail.com
The normal INT 14H is polled anyway, for read.
Not sure if something depends on an interrupt
for the write. But the manufacturer can share an
interrupt or anything else they want to do.
INT 14h is/was an old BIOS function which almost nobody used.
I'm reviving it and making it a centerpiece of my OS.

This creates the abstraction I desire. 65536 COM ports.
And if an 80386 can't address that many COM ports,
an 80386+ from Korea can.

BFN. Paul.
Rod Pemberton
2021-06-16 18:48:40 UTC
Permalink
On Wed, 16 Jun 2021 00:15:29 -0700 (PDT)
Post by ***@gmail.com
Any reason why PDOS shouldn't just accept an
fopen("COM54321", "w+b");
and see what the port has to offer?
Unix and C embraces the "everything is a file"
concept. It works fairly well. One exception
is where I noted previously in regards to the
format for specifying a particular device:

You: fopen("news.eternal-september.org:119", "w+");

Me: "I see nothing specifying the device you're connecting to."

Me: e.g., "A:" (or "C:\" etc for MS-DOS)

You: "The ":" in the name is an indication that it is a URL ..."

(It's also an indication of a DOS file path.)
--
What is hidden in the ground, when found, is hidden there again?
Scott Lurndal
2021-06-16 18:30:01 UTC
Permalink
Post by Rod Pemberton
On Wed, 16 Jun 2021 00:15:29 -0700 (PDT)
Post by ***@gmail.com
Any reason why PDOS shouldn't just accept an
fopen("COM54321", "w+b");
and see what the port has to offer?
Unix and C embraces the "everything is a file"
concept. It works fairly well. One exception
is where I noted previously in regards to the
You: fopen("news.eternal-september.org:119", "w+");
Me: "I see nothing specifying the device you're connecting to."
Me: e.g., "A:" (or "C:\" etc for MS-DOS)
You: "The ":" in the name is an indication that it is a URL ..."
Actually, it's not, really.

A Universal Resource Identifier (URI, of which URL is a subset):

URI = scheme:[//authority]path[?query][#fragment]

That allows:

fopen("nntp://user:***@news.eternal-september.org/");

(scheme nntp implies port 119).

Now, even if such syntax were supported by fopen in your
faux C90-land, consider how you would use that file descriptor;
does the application need to handle the NNTP protocol, or does
your DOS operating system handle the NNTP protocol (and any
other URI scheme that you support such as HTTP, SMTP, POP,
IMAP etc et alia) on behalf of the application.

Then, consider if you are using HTML, will the application
be responsible for formatting and displaying the HTML, or
will you delegate that to your DOS. Do you want to support
full HTML5 (including entities, UTF-8, graphics, web assembly, javascript,
image display, video playback, et alia.). Just look at firefox
or chromium for what that level of complexity invariably leads
to.
muta...@gmail.com
2021-06-16 21:24:19 UTC
Permalink
Post by Scott Lurndal
Now, even if such syntax were supported by fopen in your
faux C90-land, consider how you would use that file descriptor;
does the application need to handle the NNTP protocol, or does
your DOS operating system handle the NNTP protocol (and any
other URI scheme that you support such as HTTP, SMTP, POP,
IMAP etc et alia) on behalf of the application.
The application needs to handle it. I'm not sure how
it makes sense for a C library (with or without the aid
of the OS) to handle the internal protocol details of
random protocols. You wouldn't need fread() you would
need some sort of complicated non-C90 function that
retrieves tokenized data.

BFN. Paul.
Joe Monk
2021-06-17 08:18:14 UTC
Permalink
Post by ***@gmail.com
The application needs to handle it. I'm not sure how
it makes sense for a C library (with or without the aid
of the OS) to handle the internal protocol details of
random protocols. You wouldn't need fread() you would
need some sort of complicated non-C90 function that
retrieves tokenized data.
Which is why fopen, fread, etc are not suitable for URLs. That why we have the TCPIP library of functions and use Connect() for things like this.

Joe
muta...@gmail.com
2021-06-17 10:51:12 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
The application needs to handle it. I'm not sure how
it makes sense for a C library (with or without the aid
of the OS) to handle the internal protocol details of
random protocols. You wouldn't need fread() you would
need some sort of complicated non-C90 function that
retrieves tokenized data.
Which is why fopen, fread, etc are not suitable for URLs.
That why we have the TCPIP library of functions and use
Connect() for things like this.
No, I don't see why the connection and transmission of
data can't be done using standard fopen etc functions.

After that, parsing of data can be done with standard
C90 code/libraries too.

This is the problem. Someone has made it more
complicated than it needs to be. I wonder why.

BFN. Paul.
Joe Monk
2021-06-17 13:21:23 UTC
Permalink
mission of
Post by ***@gmail.com
data can't be done using standard fopen etc functions.
After that, parsing of data can be done with standard
C90 code/libraries too.
This is the problem. Someone has made it more
complicated than it needs to be. I wonder why.
BFN. Paul.
Yeah, no. Remember, after initial connection, the ports are shifted to temporal ports (i.e ports above 1024-65535). So, there is no guarantee you will get the same temporal port two times in a row.

Joe
muta...@gmail.com
2021-06-17 13:30:03 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
After that, parsing of data can be done with standard
C90 code/libraries too.
This is the problem. Someone has made it more
complicated than it needs to be. I wonder why.
Yeah, no. Remember, after initial connection, the ports are
shifted to temporal ports (i.e ports above 1024-65535).
So, there is no guarantee you will get the same temporal
port two times in a row.
You seem to be one of the people deliberately making it
more complicated than necessary, to keep software in
the hands of the elite.

I have no idea what you are talking about.

What I do know is that from PDOS/386 I am able to connect
to my BBS. There is nothing complicated about it. The only
unusual thing is the use of XON to know when to switch from
read to write mode.

BFN. Paul.
Joe Monk
2021-06-17 14:01:53 UTC
Permalink
Post by ***@gmail.com
You seem to be one of the people deliberately making it
more complicated than necessary, to keep software in
the hands of the elite.
I have no idea what you are talking about.
https://en.wikipedia.org/wiki/Ephemeral_port

Its the mechanism that allows a server to handle multiple clients at the same time... There is nothing complicated about it.

Joe
muta...@gmail.com
2021-06-17 19:36:24 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
You seem to be one of the people deliberately making it
more complicated than necessary, to keep software in
the hands of the elite.
I have no idea what you are talking about.
https://en.wikipedia.org/wiki/Ephemeral_port
Its the mechanism that allows a server to handle multiple clients at the same time... There is nothing complicated about it.
It is complicated.

For now I'm only interested in one connection at a time
anyway (corresponding to one physical modem) and
non-multitasking systems.

If it turns out that it is necessary for even an *application*
to be burdened by a whole lot of TCP/IP shit just to cope
with incoming or outgoing glorified modem connections,
when multi-user/multitasking is involved, so be it.

But as far as I can tell, the simple case can be handled
by a simple fopen() with everything being C90-compliant,
except for the use of ESC and XON which are
character-set-specific. And the BBS doesn't even see
the XON. Even the BBS's OS doesn't see it. Although
maybe it should. It's unclear to me what the right thing
to do is.

BFN. Paul.
Joe Monk
2021-06-17 21:43:54 UTC
Permalink
Post by ***@gmail.com
If it turns out that it is necessary for even an *application*
to be burdened by a whole lot of TCP/IP shit just to cope
with incoming or outgoing glorified modem connections,
when multi-user/multitasking is involved, so be it.
NNTP is a TCP application. So it needs TCP/IP.

Joe
muta...@gmail.com
2021-06-17 22:09:48 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
If it turns out that it is necessary for even an *application*
to be burdened by a whole lot of TCP/IP shit just to cope
with incoming or outgoing glorified modem connections,
when multi-user/multitasking is involved, so be it.
NNTP is a TCP application. So it needs TCP/IP.
As far as I can tell, that is not true.

I am aiming to have a news reader that does:

fopen("nntp://eternal-september.org", "r+");

and then answers the various prompts using pure C90
functions.

I'm even going to have the above running in EBCDIC
using S/370 instructions and let the modem translate
into ASCII as Eternal September is expecting.

It is true that my modem will internally use TCP/IP
instead of dial tones, but I have no reason to care
about that. Nor do I care if TCP/IP gets replaced
by XYZ, or even back to dial tones. Or be entirely
bluetooth-based.

They have managed to make what is a glorified BBS
ridiculously complicated.

BFN. Paul.
Joe Monk
2021-06-17 22:21:28 UTC
Permalink
Post by ***@gmail.com
Post by Joe Monk
NNTP is a TCP application. So it needs TCP/IP.
As far as I can tell, that is not true.
fopen("nntp://eternal-september.org", "r+");
NNTP = TCP port 119. HTTP = TCP port 80. HTTPS = TCP port 443. SSH = TCP port 22. Telnet = TCP Port 23.

"NNTP is a text-based protocol and allows for the alternating exchange between client and server: Therefore, for every NNTP inquiry, an NNTP reply is expected. For this communication the IANA (Internet Assigned Numbers Authority) has provided TCP-Port 119, which in this case is solely reserved for the transfer protocol – a TCP/IP network such as the Internet is as a result the underlying basis for the information platform. The NNTP itself has access to the application layer and for this relies directly on the TCP protocol, which has the advantage of ensuring both a secure and reliable transfer of data."

https://www.ionos.com/digitalguide/server/know-how/nntp-network-news-transfer-protocol/

Joe
muta...@gmail.com
2021-06-17 22:30:56 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
Post by Joe Monk
NNTP is a TCP application. So it needs TCP/IP.
As far as I can tell, that is not true.
fopen("nntp://eternal-september.org", "r+");
NNTP = TCP port 119. HTTP = TCP port 80. HTTPS = TCP port 443. SSH = TCP port 22. Telnet = TCP Port 23.
"NNTP is a text-based protocol and allows for the alternating exchange between client and server: Therefore, for every NNTP inquiry, an NNTP reply is expected. For this communication the IANA (Internet Assigned Numbers Authority) has provided TCP-Port 119, which in this case is solely reserved for the transfer protocol – a TCP/IP network such as the Internet is as a result the underlying basis for the information platform. The NNTP itself has access to the application layer and for this relies directly on the TCP protocol, which has the advantage of ensuring both a secure and reliable transfer of data."
https://www.ionos.com/digitalguide/server/know-how/nntp-network-news-transfer-protocol/
Yes, and it's all a scam.

It's just a normal BBS you can dial. I could have put the
exact same text out from my own BBS way back in the
90s when I was running a BBS.

No properly-written news reader should be able to tell
the difference whether their news server was my 1990s
BBS or Eternal September in 2021.

BFN. Paul.
Joe Monk
2021-06-18 01:51:25 UTC
Permalink
Post by ***@gmail.com
It's just a normal BBS you can dial. I could have put the
exact same text out from my own BBS way back in the
90s when I was running a BBS.
here's a place for you: https://www.reddit.com/r/bbs/

Joe
muta...@gmail.com
2021-06-18 02:47:55 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
It's just a normal BBS you can dial. I could have put the
exact same text out from my own BBS way back in the
90s when I was running a BBS.
here's a place for you: https://www.reddit.com/r/bbs/
Thanks! I have made a post.

BFN. Paul.
Rod Pemberton
2021-06-18 04:41:04 UTC
Permalink
On Thu, 17 Jun 2021 15:09:48 -0700 (PDT)
"***@gmail.com" <***@gmail.com> wrote:

<snip>
Post by ***@gmail.com
It is true that my modem will internally use TCP/IP
No.

A modem won't use TCP/IP for anything. You may
use the SLIP or PPP protocol for an IP connection.
--
What is hidden in the ground, when found, is hidden there again?
muta...@gmail.com
2021-06-18 05:49:24 UTC
Permalink
Post by ***@gmail.com
It is true that my modem will internally use TCP/IP
No.
A modem won't use TCP/IP for anything. You may
use the SLIP or PPP protocol for an IP connection.
Buy my modem then. It does TCP/IP. It's quite
bulky though, but the Japanese will make short
work of that.

BFN. Paul.
Scott Lurndal
2021-06-18 13:32:39 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
If it turns out that it is necessary for even an *application*
to be burdened by a whole lot of TCP/IP shit just to cope
with incoming or outgoing glorified modem connections,
when multi-user/multitasking is involved, so be it.
NNTP is a TCP application. So it needs TCP/IP.
Technically, NNTP can be carried by any underlying connection-oriented
lossless protocol.
Joe Monk
2021-06-18 14:01:50 UTC
Permalink
NNTP is also specified to be UTF-8, which is a superset of ASCII.

"This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8
[RFC3629]. Except in the two areas discussed below, UTF-8 (which is
a superset of US-ASCII) is mandatory, and implementations MUST NOT
use any other encoding."

https://datatracker.ietf.org/doc/html/rfc3977

Joe
muta...@gmail.com
2021-06-18 22:20:18 UTC
Permalink
Post by Joe Monk
NNTP is also specified to be UTF-8, which is a superset of ASCII.
"This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8
I use the non-extended NNTP that predates UTF-8 even existing.

BFN. Paul.
Joe Monk
2021-06-18 23:02:56 UTC
Permalink
Post by ***@gmail.com
I use the non-extended NNTP that predates UTF-8 even existing.
And I have a bridge in Brooklyn that needs a new owner.

Joe
wolfgang kern
2021-06-19 07:35:55 UTC
Permalink
Post by Joe Monk
Post by ***@gmail.com
I use the non-extended NNTP that predates UTF-8 even existing.
And I have a bridge in Brooklyn that needs a new owner.
Oh yes, I'm a passionate abandoned bridge collector, LMFAO.
__
wolfgang

Continue reading on narkive:
Loading...