> kragen@pobox.com writes:
> > I must have missed the explanation of how autoloading of device-driver
> > modules works with devfs. If a device is to be automatically loaded
> > and configured when someone tries to access it, and devfs creates names
> > in /dev as devices are loaded and configured, then how do you try to
> > access the unloaded, unconfigured device?
>
> When you attempt to access a device node which isn't there (say
> "ide/cd/c0b0t0u0") then for each path component that doesn't exist,
> devfs sends that to kmod. Thus, potentially, you have have the
> following sequence of strings sent to kmod: "ide", "ide/cd",
> "ide/cd/c0b0t0u0".
> In practice, people will have IDE configured into their kernel, so the
> "ide" component is already there. Then the "ide/cd" string will be
> sent to kmod. Now, if you have
>
> # /etc/modules.conf
> alias ide/cd ide-cd
>
> then the ide-cd module will be loaded as required. Then the module
> will detect your CD-ROM and will also register the "c0b0t0u0"
> entry. So in general only one request is made to kmod: "ide/cd".
>
> Something to keep in mind here is that while device entries don't
> appear/exist at first, an explicit lookup of the inode (any syscall
> that provides a pathname) will trigger kmod. So it all just magically
> works.
Does this idea extend to auto-mounting?
I know you can add post-install entries for kmod to follow, but will
there be something similar to post-install entries for devfs?
This would also allow devfs to make the nasty PCMCIA hack completely
redundant, because adding devices could execute user space code.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html