On Thu, Sep 12, 2002 at 08:13:30PM -0400, Daniel Barclay wrote: > > $ ls -l /dev | grep " 6," > > crw-rw---- 1 root lp 6, 0 Nov 30 2000 lp0 > ... > > > Where is it defined in the kernel that character major device number 6 is > parallel port support?
It isn't. > - Is that definition only within the parallel-port support module? > - Is that definition known only once the module is loaded? Sort of. The parallel port support code (whether built into the kernel or loaded as an external module) registers itself as being capable of handling requests for char-major-6. When something is sent to /dev/lp0, the kernel checks to see if there's any code in memory that can handle char-major-6 devices. If there is, the data gets passed to that code. If there isn't, then it looks to see if there's a not-yet-loaded module to provide that capability. At no time does the kernel know that char-major-6 = parallel port. (If it did, adding support for new devices would require changing the core kernel. This way, you can just register a handler and go - although you do have to watch out so nobody else uses the same device mode and number as you until/unless you can get Linus to officially recognize your code.) > - Can the kernel (or the module loader) be informed about the > definition (the mapping from the number to the module name) > so that that module can be loaded when the device is accessed? > If so, how? Yep. That's what /etc/modules.conf does. -- When we reduce our own liberties to stop terrorism, the terrorists have already won. - reverius Innocence is no protection when governments go bad. - Tom Swiss -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]