Subject: Re: TTY virtualization driver
To: None <mouse@Rodents.Montreal.QC.CA, tech-kern@netbsd.org>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 01/23/2002 17:33:06
| > 	foo* at pci?
| > 	bar* at pci?
| > 	bit* at pci?
|
| > Traditionally we would then have [...]
|
| > This is all well and good, except it's very messy in /dev, and tty
| > allocation and assignment algorithms
|
| _What_ tty allocation and assignment algorithms?  I don't know of _any_
| case where real hardware ttys are "allocated and assigned" by software;
| the notion don't even really make much sense for anything but a dialout
| farm, and even there, all you need is one list of suitable ttys, much
| like the one /etc/ttys provides for getty.
|
| Of course, just because I don't know of any doesn't mean none exist.
| Can someone cite an example or two?  I'd be interested.
|
| > I personally think there's more benefit to doing this kind of name
| > mapping in ttys, network interfaces (at least per physical layer
| > type), audio interfaces, and anything else that's more likely to be
| > used directly by ordinary (non-superuser) users,
|
| Hm.  I can't see that benefit, unless you just happen to like it
| aesthetically.  Could you explain in a bit more detail?

Right now it's easy to figure out what disks or ethernet interfaces
are on your machine.  

In the first instance you can run disklabel on sd[0-n] for SCSI disks 
and wd[0-n] for IDE disks.  If you have IPI disks or some other 
obsolete technology then it's more complicated, but there are few 
of those machines still around.  And it's obvious what device nodes
they correspond to, since they're pretty much standard, not only
across ports but across many different operating systems.

For ethernet controllers just run `ifconfig -a' or `netstat -a'
and you get a list.  And you don't have to worry about nodes in
/dev since they don't exist.

But, let's say you want to hook up a modem to a serial port and
run getty on it.  How do you determine which device that corresponds
to?  You can determine which serial drivers have attached by looking
through the boot messages.  But there's no real correlation between
a device instance and a node in /dev.  You can look at the man pages
but they tell you about the device instance, not the /dev node.  Even
trying to use kermit or tip to access the device doesn't necessarily
help since it doesn't tell you what device instance a device node
corresponds to, and it may fail due to a number of different reasons
that are often difficult to distinguish.  And you also have all the 
pty nodes in /dev that help to confuse the situation when you do a
`ls /dev/tty*'.  

So what exactly does correspond to /dev/ttyC00?  Or /dev/tty00?  Does
the machine even have a working /dev/tty00?

Eduardo