Re: [TEST/REVIEW/HEADSUP] tty drivers mega-patch

From: Marcel Moolenaar <marcel_at_xcllnt.net>
Date: Wed, 14 Jul 2004 11:08:16 -0700
On Wed, Jul 14, 2004 at 12:04:57PM +0200, Poul-Henning Kamp wrote:
> >
> >boot -s is generally broken. No characters can be typed. This is
> >with syscons(4) and uart(4) and probably any other driver. Might
> >be related to the lack of NL->CRNL
> 
> I have this fixed in a new patch I just uploaded.

Ok. I'll give it a spin.

> marcel: I don't think the kassert in uart which tripped you should
> be there any more.  Can you try to remove it and see that nothing
> bad happens ?

Will do.

> With respect to the "init"/"lock" devices:
> 
> Drivers are not forced to them, they get created if ttymakeslaves()
> is called, and the driver is free not to do that.
> 
> I added it to uart because I thought it was a sufficiently high-profile
> driver that we should have the cua/init/lock ability on it.  (as
> opposed to ptys or dcons for instance).  If you don't want it,
> I'll remove it again (but read on first).

No, the ability is good. I always wanted something like that. Just not
in the way it was done in sio(4), because it doesn't belong there.

> The traditional naming has been the inserted "i" and "l" which I
> agree is arcane.  I'm not against changing it to ".init" and ".lock"
> if we can get concensus.

We can create a simple compatibility scheme: If the out argument
to ttymakeslaves is a string of exactly 1 character, use the old
naming scheme. Otherwise, a new naming scheme is used. In the old
scheme, the slave (or out) devices are called cua*. In the new
scheme the out devices have the name given by the out argument.

Thus:
sio(4) would call ttymakeslaves with in="d", out="a". This yields
	ttyd#, ttyid#, ttyld#
	cuaa#, cuaia#, cuala#
uart(4) would call ttymakeslaves with in="u", out="uart". This could
yield something like:
	ttyu#, ttyu#.init, ttyu#.lock
	uart#, uart#.init, uart#.lock

Just a thought. See also below.

> I would prefer to stick to the "tty" and "cua" prefixes however.

I can agree on the tty prefix. I've always disliked the cua prefix,
simply because it's nonsensical. It's the kind of prefix you pick
when all the good (and bad) ones have been used and you randomly
grab 3 letters from your scrabble box, sigh, and accept that once
again luck hasn't been on your side :-) :-)

Seriously: the origin of cua is mostly lost and systems like UUCP
have already been removed from the source tree. Anybody new to
FreeBSD and who hasn't been around since the epoch will completely
fail to see why the device is called the way it is.

But anyway, if you think that all serial devices should have tty$#
and cua$#, then just implement it that way. It's better to get this
rework behind us. I can adjust. If not, then I can at least commit :-)

> The plan is to make them on-demand-devices (clonable) so that they
> do not clutter up /dev but appear if you access them.  That would
> leave only the ttyu0 and cuau0 devices.

Yes! I like the cloning.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel_at_xcllnt.net
Received on Wed Jul 14 2004 - 16:08:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:01 UTC