Subject: Re: what's still using pccons ?
To: Luke Mewburn <lukem@wasabisystems.com>
From: Bill Studenmund <wrstuden@zembu.com>
List: tech-kern
Date: 05/10/2001 02:12:00
On Thu, 10 May 2001, Luke Mewburn wrote:

> I've been investigating PR 12862 "openpty() tries to allocate ptyv*".
> In summary, after PCVT was deprecated (which used /dev/ttyv[0-9]),
> openpty(3) was modified to try and use ttyv*. This is a problem if the
> port still supports pccons, which generally uses ttyv0 (see below).

That was the problem. We should have just considered ttyv to be lost, and
had those 16 ptys put at w, and so on.

> I noticed that there was a lot of inconsistency between ports in
> the creation of ttyv0 (pccons) character devices in src/etc/etc.*/MAKEDEV,
> as well as the use of ttyv0 devices by the kernel (/sys/arch/*/*/conf.c).
> 
> After cleaning up various mistakes, here's the situation where we're
> at now:
> 
> 	port	major	device
> 	----	-----	------
> 	arc	14	ttyC0
> 	arm32	4	ttyv0
> 	bebox	12	ttyv0
> 	i386	12	ttyv0
> 	prep	12	ttyv0
> 
> As you can see, the arc uses ttyC (yay!), but the rest use ttyv (in
> hindsight, what a mistake that was; even when pccons was put in the
> tree there were systems with 96 simultaneous connections so choosing
> `v' was a bad idea IMNSHO).
> 
> Well, there's a few things that could be done here:
> 
> 	a) Rename ttyv0 -> ttyC0 (in MAKEDEV and ttys).
> 	   This might have unexpected upgrade problems.

Or an easier thing to do is modify MAKEDEV to forget about ptyv. Mkae it
so that pty6 (which would naively make [pt]tyvX) make [pt]tywX, pty7 make
[pt]tyxX, pty8 make [pt]tyyX and so on.

> 	b) Deprecate pccons. Is there any real reason we
> 	   maintain this in parallel to wscons?

Install media are the main reason.

> 	a) Modify openpty(3) to skip ttyv. This is the easiest
> 	   solution for now, but we lose 16 ptys. I'm going to
> 	   commit this for now; we can always revert once one
> 	   of the above occurs.

Se above for a way around loosing 16 ptys.

> 	b) Implement SYSV style pty cloning. This has many benefits,
> 	   a people have been claiming we need it for ages, but we
> 	   don't have it yet. It still doesn't get around the fact
> 	   we'll still probably have BSD style entries still around,
> 	   so I'd like to clean up this ttyv problem.

While I can see an advantage to always grabbing a new pty pair, if we
don't have the old-style pty names around, how do you get at a particular
pty/tty device?

For instance, with talk, you can say "talk <username> <device name>". How
do you do that for someone who is logged in over a pty, if we don't have
the BSD-style entries around?

Take care,

Bill