Day 2: Conference: DevFS
Richard Gooch, being on his home turf came to tell us about DevFS, after it was
finally included in the mainstream kernel.
Linux so far has had major and minor numbers (8 bits each). Each driver can
register one or more major number and use minor numbers for subdevices (like
disks and partitions for a disk).
The problems are as follow:
What you get with DevFS
- Limits on both minor and major numbers, which can affect the number of disks
or partitions for instance. The current scheme already prevents access to
thousands of SCSI disks.
- Numbering is done on the fly as hardware is detected, which has the
unfortunate side effect of not providing a stable name for devices like SCSI
disks. As a result, hot pluggability is an issue too.
- Other problems are the number of entries that end up in /dev (2500+ entries
on recent distributions) or you take the risk of not having the device node for
hardware you need.
- There is also a major table that's maintained by one person that you
need to contact if you need a major number allocated to your driver.
- Yet another problem is that it's difficult at best to enumerate devices of
a certain kind (for instance all CD-Rom writers)
- it removes the device number indirection
- it removes limits on number of devices
- hot pluggability comes in for free
- you can easily scan devices of a certain type
- devices can show up in several places (USB and CD-Rom for a USB CD-Rom)
- it works at boot time, which is handy for your boot drive
- it works for read-only filesystems, even on a non Unix root filesystem
- it preserves the "everything is a file" philosophy.
- it's lightweight (72 bytes per entry) and provides a uniform API for drivers
Common questions/comments from people:
- Volume name space
- Physical name space
- Hot plug user space device management
- Overhaul block and SCSI layers
- Use Dcache for devfs internal database
- Why not just pass device creation/removal events to a daemon?
It doesn't work before the kernel is fully booted
- How about a better scsidev?
It doesn't help for anything else then SCSI devices or the root filesystem
- Put /dev on a ramdisk
You need initrd, which makes the whole thing more complex, and you still
need to register hardware to find out what nodes to create
- Do nothing, there is no problem
Link to Home Page
2001/01/27 (19:09): Version 1.0