LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-19-2012, 01:47 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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?
 
Old 01-19-2012, 02:41 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
1 members found this post helpful.
Old 01-19-2012, 02:57 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
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?

Last edited by JZL240I-U; 01-19-2012 at 03:58 AM.
 
Old 01-19-2012, 03:49 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
1 members found this post helpful.
Old 01-19-2012, 04:04 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jschiwal View Post
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.
Is it then automatically part of the monolithic kernel, i.e. inbuilt?

Quote:
Originally Posted by jschiwal View Post
If it is, the udev system will detect it and the kernel module will be loaded (modprobed).
When requested, i.e. needed by some event in the running system if I understand this right.


Quote:
Originally Posted by jschiwal View Post
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.
Ahh yes, this makes things more clear. Thank you .
 
Old 01-21-2012, 11:29 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 01-23-2012, 01:20 AM   #7
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
So this way one can keep the kernel small. Okay, understood. Thanks for your help and explanations jschiwal, they are much appreciated .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loadable Kernel Modules jbrashear Debian 7 04-03-2005 05:11 PM
Loadable modules question dudds Linux - Newbie 5 07-20-2004 02:13 AM
of course I have loadable modules enabled! jmynkbht Linux - Software 0 04-26-2004 03:52 AM
Compiled source files. Why no loadable module? Darrell22 Linux - Newbie 4 01-30-2004 01:01 PM
loadable modules vs built-in modules nuzzy Linux - Hardware 1 07-21-2003 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration