Re: devfs - why not ?

From: David Hinds (dhinds@valinux.com)
Date: Fri Apr 14 2000 - 13:31:54 EST


This discussion seems to be swirling around many of the same issues
that I've been dealing with for PCMCIA devices for years now, so maybe
it is worth describing the system used for PCMCIA.

PCMCIA devices have their own set of configuration scripts that live
in /etc/pcmcia. Each class of device has a master configuration
script, and a *.opts file that describes configurations for those
devices. Device classes include network, SCSI, serial, IDE, etc.

When a new device is configured, the appropriate master configuration
script constructs an "address" describing the device. The format of
the address depends on the device class. For network devices, the
format is:

       "scheme,socket,instance,hwaddr"

where "scheme" is a user supplied tag that I use to manage multiple
sets of configurations; "socket" is the physical PCMCIA socket number;
"instance" is used to enumerate multiple devices of the same class in
the same socket; and "hwaddr" is the card's MAC address. For SCSI
devices, the format is:

        "scheme,type,socket,channel,id,lun[,part]"

where "type" is sr,sd,st,etc; and "channel,id,lun" describes the
position of the device on the SCSI bus.

The *.opts file is supposed to be a big case statement that describes
configurations based on their device addresses. The cases can use
regex syntax to describe which address fields must match for a given
configuration to apply. The *.opts files are unaware of what device
names are assigned by the kernel. So the *.opts files can define
rules like "link any SCSI CD-ROM to /dev/cdrom", or "link the modem in
socket 0 to /dev/modem0", or "mount IDE cards on /mnt/ide", or "use
these settings for my WaveLAN card, and these settings for my ethernet
card; but if I'm at home, use these settings instead".

One can extend this sort of system fairly easily: instead of "socket",
you could have a "bus position" field, that might contain strings like
"pci0:00.0" or "isa0x300" etc. And you could incorporate UUID's as
well. Some of the configuration scripts also automatically create and
remove appropriate entries from /dev as needed.

-- Dave Hinds

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:24 EST