On Thursday 09 November 2006 10:01, Arnau Bria <[EMAIL PROTECTED]> wrote about '[gentoo-user] Semi OT: hotplug / coldplug / udev ...': > I have some doubts about the way hotplug / coldplug / udev work. > > What really happen when you plug a (again, > i.e.) pendrive in your computer? Which programs take care in that > process? What about kernel?
Here's my understanding, I'm sure others will correct me, and possibly exapnd on it: First, there's either a HW interrupt or the kernel scans the bus and sees a new device. Then, the kernel queries the device and populates /sys (and possibly /proc) and notifies udev. udev is responsible for loading the appropriate module, if not already loaded, and creating the device nodes. In the past, hotplug and coldplug where responsible for loading the module, and devfs would create device nodes under control of the module. Neither hotplug nor coldplug are required with recent udev (w/ module loading support). Hotplug and/or coldplug can provide module loading for early versions of udev (in addition to their role with devfs). In ancient times, device nodes had to be created by the user (static /dev), possibly in response to kernel events (put that would require a module for the kernel hooks) or en masse for all possible devices. One (dis?)advantage to static /dev was that device nodes would persist across reboots, which does not happen under devfs or udev -- unless your distro. provided /dev tarballs (ala Gentoo) or another method to save /dev on shutdown and restore it on startup. -- "If there's one thing we've established over the years, it's that the vast majority of our users don't have the slightest clue what's best for them in terms of package stability." -- Gentoo Developer Ciaran McCreesh -- gentoo-user@gentoo.org mailing list