Re: Kernel-generated /dev...

David Holland (dholland@hcs.harvard.edu)
Mon, 23 Oct 1995 15:18:34 -0400 (EDT)


> > Here's one possible compromise... have /proc/dev have all of the devices,
> > with their suggested names, owned by root, with permission 000.
> >
> > A simple script can move them to /dev and rename, chown and/or chmod
> > them at boot time to useful values.
>
> I'd rather see a single file containing all the necessary information.
> The file would then be parsed by a utility to generate the appropiate
> /dev/* files.

This already exists. Look at /proc/devices. Both extant versions of
MAKEDEV parse this. The only trouble is that it doesn't have enough
information; lots of things need to be coded into MAKEDEV. In the case
of MAKEDEV-C, these are kept in an external config file, but it's
nonetheless a nuisance to maintain.

One possibility is to make some kind of devfs that mounts from a file
in the root partition that stores the necessary persistent
information. This way the permissions and group ownerships come out
right, but the device names are enforced. Another way is to generate a
more verbose /proc/devices that lists minor numbers and names as well
as major numbers. MAKEDEV becomes trivial then. This is a good thing.

[Regarding what Alan said: there is a lot of virtue in having a
uniform set of device names. But even if you don't want to use them
yourself, there should be a uniform set of canonical names.

That is, the user/kernel interface for device binding should, at some
level, be by name, not by number. It's too easy to get numbers
wrong. We have DNS for the analogous problem with the network. For
devices, it needs to be a kernel-level function, since only the kernel
knows what devices actually exist, and the source for each driver is
the only safe place to keep the names of the devices it supports.]

-- 
   - David A. Holland             | Average number of times an American 
     dholland@hcs.harvard.edu     | opens the refrigerator each day: 22