Subject: Re: which tty device files for talking to serial devices?
To: De Zeurkous <zeurkous@nichten.info>
From: Bill Stouder-Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 07/05/2007 17:55:12
--VACxsDaSTfeluoxK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 05, 2007 at 09:18:25PM -0000, De Zeurkous wrote:
> Haai,
>=20
> On Thu, July 5, 2007 21:03, Bill Stouder-Studenmund wrote:
> >
> > Since with modems and tty's, there may or may not be something there wh=
en
> > 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 ma=
ke
> > 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.
> >
>=20
> 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...

Because you might want to do things other than send faxes. You might want=
=20
to do something that needs to talk directly to the modem.

> > 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 & amd6=
4,
> > the "native" serial ports are "com", and they are tty??.
>=20
> Why was this design decision made, and where is 'tty' used for on those
> archs?

Look at other architetures and see. It'll differ with each one. A likely=20
reason for doing it is that the only way to add a "com" port is via a PCI=
=20
add-in card. 'tty' most likely points to whatever actually is on the=20
motherboard.

Take care,

Bill

--VACxsDaSTfeluoxK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iD8DBQFGjZLwWz+3JHUci9cRAlYYAJ0Q1AtsMrtOTliKd9VoH6tSc6hgwQCeM6CT
kwZuCjdpv3kCYBGXIAHDf3U=
=L8xn
-----END PGP SIGNATURE-----

--VACxsDaSTfeluoxK--