no need for a devfs

Andreas Jellinghaus (aj@dungeon.inka.de)
Wed, 7 Jan 1998 09:40:53 +0100


i see no need for a devfs. the problems of /dev are :
- no good software to manage /dev
- software not up-to-date
- no way to find out what devices are needed.

all device drivers should register the devices they support within the
kernel : name, type (block/char), major and minor number, proposed
permission and class (will explain this later).

this list should be available as /proc/devlist.

makedev is currently a long list of device names, major and minor
numbers and types. all this is obsolete, as it can get this informations
from the kernel.

it should be trivial to compare /proc/devlist to /dev and create missing
devices (or remove unnecessary devices, or ...).

the thing with the class is :
at least on my systems, all disk devices have the same permissions,
all floppy devices have the same permissions, all audio devices etc.

to set user, group and permission, it's often enought to know which
class of device it is (example from my /etc/makedev.cfg) :
class audio: root audio 0660
class cdrom: root cdrom 0440
class disk: root root 0600
class floppy: root floppy 0660
...

this mapping can be done by a program useing a simple config file
(of course you can oversteer the permissions from a class by nameing the
device and it's owner and group directly).

and i think, the author of the device driver should also give a hint for
default permissions. he knows, whether

- reading/writing will neither give additional resources nor compromise
security (/dev/zero, /dev/null, ...)
- reading/writing will give additional resources, but not compromise
security (/dev/floppy, serial devices ...)
- reading/writing will compromose security
( all hard disks, /dev/kmem ... )

haveing such an information for all devices is important, and at least i
don't know the status of all devices.

for example with writing to mouse devices you can maybe not kill the
system (but wasn't there something nasty with psaux), but at least hang
the X server (this works with my serial noname mouse).
many distributions have mouse devices world writeable ?

back to the topic :
with the above registry in /proc, and a good makedev software (more a
device manager), i see no need for a /dev filesystem.

btw : of course you could extent the kernel daemon to also manage
devices this way (should be trivial), but it is important to me, that
the whole system will run good without kernel daemon.

andreas