Subject: RE: which tty device files for talking to serial devices?
To: Bill Stouder-Studenmund <wrstuden@NetBSD.org>
From: De Zeurkous <zeurkous@nichten.info>
List: tech-kern
Date: 07/05/2007 21:18:25
Haai,

On Thu, July 5, 2007 21:03, Bill Stouder-Studenmund wrote:
> On Sat, Jun 23, 2007 at 08:40:26PM -0400, der Mouse wrote:
>>[snip]
> I believe your understanding is correct.
>
> [for the original poster] /dev/tty* files came first, and they were part
> of original Unix. You could hook lots of things up to serial ports,
> including modems, tty's (as in the glass things people typed at)

Originally, real teletypes, such as the ASR-33. </The Pedant's Guide to
Computing Knowledge>.

> and other
> devices.
>
> Since with modems and tty's, there may or may not be something there when
> you go to open the device, open() calls on ttys will block waiting for
> something to be there (usually for CD to be asserted). You also can open
> tty's such that they ignore modem control, so you can just talk to the
> device.
>
> That was great. Decades passed. Then people wanted to do things like make
> their modems dial out in addition to receiving calls. Think about a Fax
> line. You want something there to receive faxes, but if nothing's there,
> you want to be able to dial out & send a fax.
>
> So Sun came up with /dev/dty* devices. You leave your fax-receiving
> program using the normal tty (in blocking mode), and you use these new
> devices, dty*, to send faxes.
>

Why not employ a faxd(8)? Especially now puffs is coming it should be
trivial to have it listen behind a pseudo-device or even a named pipe...

>
> If you aren't both dialing in and out, der Mouse is right that you can
> ignore one or the other set of devices.
>
> As for devices, MAKEDEV(8) is a little confusing. ttyC?? are the "com"
> serial ports on certain architectures. Not i386 or amd64.  On i386 and
> amd64, you just want "tty00" or "tty01". In other words, on i386 & amd64,
> the "native" serial ports are "com", and they are tty??.

Why was this design decision made, and where is 'tty' used for on those
archs?

Baai,

De Zeurkous
-----------

Friggin' Machines!

>
> Take care,
>
> Bill
>