Hey everyone. I have a question, doing an lsmod gives me a list of all the loaded modules for my system. But how did they know to load? my /etc/modules files is empty, so how did these modules know to load themselves on boot time? If I were to take this hard drive to another computer with a different architecture and devices, would a different set of modules be shown when I did an lsmod?
Also is there any way to see what each of the modules really is? Their names are rather vague.. ehci_hcd, libphy, dcdbas..
Plug-and-play makes this relatively straightforward, devices contain identification codes. Linux drivers use PCI and USB ID's to tell what drivers it should use for what hardware. Drivers keep a list of ID's they're compatible with.
Sometimes the only update a driver needs, to use a new piece of compatible hardware, is another ID added to its list.
Great, now what's the relationship between plug n play and the udev daemon? Is it udev's job to query the device, get the ID number and determine what hardware is plugged in, thus adding or removing the needed modules?
udev manages device nodes. The kernel sends events to the udev daemon whenever a device is discovered or removed. Then udev uses a collection of rules to create or remove device nodes in the filesystem or perform other actions.