Comprehension question: Are drivers generally compiled as loadable modules?
I recently read that the kernel now exceeds 15 million lines of code, each version adding about 200.000 to 300.000 new lines. By far the most of these lines constitute the sources of drivers.
How is this handled, are those drivers just loadable modules and those statistics just show all available source code? Or does each kernel of an average distro contain all (most) drivers? Can anybody point me to sources to read up on that? |
Most will probably be for loadable modules. Some is in the kernel proper, but only included if you select that option when building the kernel. Server distributions such as Red Hat may include fewer options. A server is less likely to need the last est hardware drivers. Home users on the other hand want their new wireless device to work.
Remember that many kernel build options can be loadable, or built in. It's up to you when you build your own kernel. |
How is it done? I mean, runs the kernel a hardware scan and decides what to load additionally? Or are all available modules loaded regardless of their being needed or not? How does SuSE handle that, would you know?
|
Firstly, if you don't configure a kernel module, it can't be loaded period. It won't be built as a .ko module either. If it is, the udev system will detect it and the kernel module will be loaded (modprobed). Also look at the documentation for depmod.conf. It or the files in /etc/depmod.d/ determine how modules are loaded. Which options to use, and if it's name is aliased. Sometimes module options are given on the kernel boot line (menu.lst). Some kernel modules are added to the initrd file, so the device can be loaded before the filesystem is loaded.
Things may have changed some under systemd. |
Quote:
Quote:
Quote:
|
For the first part, I meant when it isn't built into the kernel or built as a module. In that case its code isn't used.
|
So this way one can keep the kernel small. Okay, understood. Thanks for your help and explanations jschiwal, they are much appreciated :).
|
All times are GMT -5. The time now is 06:01 PM. |