LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2009, 03:44 PM   #1
s3bas
LQ Newbie
 
Registered: Apr 2009
Distribution: Arch Linux
Posts: 4

Rep: Reputation: 0
Kernel Question. Compile or Module?


Hi there,

I am a relative new Linux user and I have a question.

Is it true that when you compile your own kernel without (for example alsa).

You can still load it by using the modules when booting?

And if so, does this go for all "devices" as in, ipv6, oss, sound core, etc...

Thanks in advance, Sorry for the grammar but English is not my primary language.

Hope you guys understand the question.
s3bas
 
Old 04-17-2009, 04:27 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by s3bas View Post
Hi there,

I am a relative new Linux user and I have a question.

Is it true that when you compile your own kernel without (for example alsa).

You can still load it by using the modules when booting?

And if so, does this go for all "devices" as in, ipv6, oss, sound core, etc...

Thanks in advance, Sorry for the grammar but English is not my primary language.

Hope you guys understand the question.
s3bas
Yes, that's true. You can either have device modules compiled into your kernel, or load them after the fact.

Alot of distros come with common things built in, while the system-specific things get loaded as modules after the system is built. That way, if you suddenly add a new hard drive controller, or a different NIC, you can still get the modules loaded after you boot back up.

There are pros and cons to both methods...
 
Old 04-17-2009, 05:19 PM   #3
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
When you compile your kernel, you can use the
Code:
make xconfig
command to configure it. Most options can (with some limitations) be either compiled in, compiled as a module, or not compiled at all.

Compiling as a module has two main advantages. Firstly, when you are not using a feature, the majority of the code for it isn't loaded into memory, meaning that a small amount of RAM is freed up (for each module). The second advantage is mostly for developers: the module can be reloaded for testing without having to reboot the machine each time you test it.

Compiling a feature into the kernel, on the other hand, means that you don't have to load it separately from disk, so you may get a minor speed boost on startup (for each module), particularly on older systems with slow disks, or diskless/thin-client machines with networked disks.

Removing an option means that you can't use that feature (which can make your computer unusable if you're not careful), but it may also speed up other (dependant) parts of the kernel as it means that some checks in the code can be skipped. It also makes the kernel's compile time shorter.

The performance effects are all quite minor, but can add up significant amounts if applied over a large number of modules. Most distributions make almost everything a module, which is a reasonably good choice in most cases.
 
Old 04-17-2009, 08:29 PM   #4
maresmasb
Member
 
Registered: Apr 2009
Posts: 108

Rep: Reputation: 24
Except for the core kernel functionality everything can moved out into a module.

The concept of modules allows to keep the kernel file small. This was once quite important in times when a boot system had to fit on a single floppy disk.

These days it has become quite irrelevant in terms of disk space and file sizes. Modules still make sense, because they allow for updating buggy software without doing a kernel upgrade each time.

Last edited by Tinkster; 10-30-2010 at 03:18 PM.
 
  


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
Adaptec Kernel Module - Kernel Compile Errors dumbsheep Linux - General 3 11-07-2007 03:47 PM
Why can't I compile this kernel module? (kernel: 2.6.8-powerpc Debian sarge) Lannix Linux - Hardware 5 05-01-2007 12:29 PM
how to compile a 2.6 kernel module? NeoMagic Linux - Kernel 1 07-18-2006 10:07 AM
can't Compile a module under Kernel 2.4.20-8 srsairam Linux - Software 3 11-09-2004 12:45 AM
can i compile just one kernel module whithout recompiling the whole kernel? edman007 Linux - Software 3 02-17-2004 03:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:13 PM.

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