Messages in this thread | | | Date | Thu, 10 Jul 1997 04:20:25 -0400 | From | Jeff Garzik <> | Subject | kernel-managed /dev, revisited |
| |
Solaris is kinda fun to play with, and the guys at Sun occasionally have a good idea or two.
One of my biggest Linux pet peeves is having to reshuffle my !@#$@! /etc/fstab every time I reshuffle my drives. [I do know about Youngdale's tools for this] Running a news server means many SCSI ids, many SCSI hosts, and a lot of reshuffling, on into the night...
I like the way Solaris has a separate /devices tree. Kernel-configured devices magically appear here upon bootup. Most of /dev is symlinks into the /devices hierarchy. Why not do this in Linux?
Here's what I propose...
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.
1. Kernel init. procdev root structure init. 2. SCSI subsystem init. Adds subdirectory "scsi" to procdev struct. 3. BusLogic driver init. Adds several device entries to the procdev scsi subdirectory...
/proc/dev/scsi/h0t3l0 /proc/dev/scsi/rh0t3l0 /proc/dev/scsi/h0t4l0 /proc/dev/scsi/rh0t4l0
h0t3l0 = host #0, scsi id[target] #3, LUN #0 An 'r' prefix to the device name indicates a raw device.
4. Ramdisk driver init. Adds ramdisk subdirectory to procdev struct, and adds several entries to the subdirectory.
/prov/dev/ramdisk/0 ... /prov/dev/ramdisk/3
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.
The current /dev structure continues to exist, of course. Distribution maintainers can choose whether to hand-maintain /dev -- like they do now -- or symlink the /dev entries to their proper names in /proc/dev.
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.
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. -- Jeff Garzik Quality news feeds News Administrator INN Technical info, Consulting Spinne, Inc. http://www.spinne.com/usenet/
| |