Port-alpha archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Configuring Serial Printer - DEC 3000 Model 700 / NetBSD V4.0



> Another aspect of this machine I don't understand.  [...]

> $ dmesg | grep zstty*
> zstty0 at zsc0 channel 1
> zstty2 at zsc1 channel 1 (console i/o)

> For purposes of the ttys file, these ports are somehow redefined as
> ttyB0 ("modem port") and ttyB1 ("printer" port.)

Not quite "redefined".  That's like saying, of someone named Joseph
with email address stupidities%example.com@localhost, that Joseph is redefined 
as
stupidities for purposes of email.  It's not a redefinition; it's just
a single entity appearing in two completely independent namespaces.

> Both work (for terminals, at least) when referred to as ttyB0 and
> ttyB1.  Using zstty0 and zstty2 gets me nowhere in the ttys file.

Right.

What you seem to be missing is that there is not necessarily any
connection between the name by which a device is known to the autoconf
machinery (the boot-time messages, such as dmesg prints) and the name
of the entry, if any, in /dev/ for it (which is what goes in /etc/ttys
for tty lines, and for most devices is the name by which userland knows
the device).

There _is_, of course, a connection at some level, but it is an
indirect one, and one that does not give any reason for the names to
match.  The device name as known to autoconf is actually used by very
little - config(8) uses it to build the autoconf data structures and to
link drivers up to major device numbers and that's just about it.
(Network devices appear to use it, but this is misleading; there is
actually nothing that requires the name of the interface in the running
system to match anything autoconf uses, as far as I can tell.  A driver
known to config(8) as, say, "fred* at pci?" could provide network
interfaces named wilma0, wilma1, etc, if it felt like it.)

A driver is tied to an autoconf name through the config(8)-created
autoconf data structures.  The driver is also tied (through more
config(8)-generated data structures - cdevsw and/or bdevsw) to a major
device number.  Names in /dev/ are also tied to major device numbers,
through the major portion of the major/minor device number used when
the entry in /dev/ was created.

The important path is /dev/ entry to major device number to [bc]devsw
entry to driver.  The name printed by autoconf is completely irrelevant
except to humans looking at boot messages and relating them to other
things; if humans weren't looking at them, autoconf would not need to
even _have_ names for device-tree nodes, that's how irrelevant they are
to everything else.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index