Re: kernel-managed /dev, revisited

Christopher Turcksin (
Fri, 11 Jul 1997 22:34:49 +0100 (BST)

On Thu, 10 Jul 1997, Jeff Garzik wrote:

> Each device registers an entry in a procfs structure, which creates (to
> the user) a procfs device file. Major kernel subsystems handle their
> own registries. I can best describe this with an example of kernel
> boot-up. "procdev" is what I call this new feature.
> /proc/dev/scsi/h0t3l0
> /proc/dev/scsi/rh0t3l0
> /proc/dev/scsi/h0t4l0
> /proc/dev/scsi/rh0t4l0

Seems like a very good idea to me, but I would propose to use the same
names you're already using in the existing kernels (ref. /proc/devices).

/proc/dev/scsi0/sd0 scsi disk host adapter 0
/proc/dev/scsi0/scd0 scsi disk "
/proc/dev/scsi0/st0 scsi tape "
/proc/dev/scsi1/sd0 scsi disk ID 0 host adapter 1
/proc/dev/ide0/hd0 master IDE drive on primary adapter
/proc/dev/ide1/hd0 master IDE drive on secondary adapter

You get the picture.

> The key to /proc/dev's success is its correctness. The devices listed
> in /proc/dev are absolutely guaranteed to exist on the system, and their
> device major/minors are 100% accurate.

That should be good news for slackware users :) (no offence intented).

> The current /dev structure continues to exist, of course.


> The ultimate in spiffiness would be a boot parameter to the kernel,
> which would say "yes dammit, scramble my /dev" -- in other words, have
> the kernel update /dev such as all its entries point to /proc/dev
> locations. /dev/sda would point to /proc/dev/scsi/h0t3l0, etc.

I see no reason why this should be done in the kernel. A user-mode utility
should be able to do this?

> What do you think? Adding the "procdev" feature doesn't disrupt
> existing systems' /dev, so legacy systems are completely undisrupted.
> Kernel patch and driver authors are not forced to upgrade anything; if
> you don't want to, or can't afford to add /proc/dev support to your
> driver... don't. :) A kernel-maintained /proc/dev would be very
> useful.

Hmm. It seems to me that support for this in the drivers is not necessary.
I thought that the drivers are already registering their minor and major
device numbers with the kernel somehow. This is, afaik, all you would need
to construct procdev.

I could be wrong ofcourse. After all, I'm just a simple wabbit.

If there was incomplete support for this in the drivers, I would find it a
lot less useful though.

--- Christopher