LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-15-2008, 02:08 PM   #1
drut
LQ Newbie
 
Registered: Mar 2007
Posts: 21

Rep: Reputation: 15
What has to be compiled in, and what can be a module?


Hi
I am just about to configure the kernel for LFS v6.3 and am unsure as to what "must" be compiled into the kernel - and what can be done as modules?

I read somewhere:-
Quote:
"The only thing that really is required to be compiled into the kernel are the drivers for the root file system"
Is this OK, so I only need to bother with ext3 (everything else modules) or are there general rules that I can follow?

Thanks for any advice





PS. I was going to just compile everything I needed directly into the kernel, but got the impression this was wrong and would make the kernel run slower(?), so I am thinking sound, network drivers etc - should be loaded as modules - does this make any sense?

Last edited by drut; 05-15-2008 at 02:48 PM. Reason: Added the PS
 
Old 05-15-2008, 03:13 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
If you're not using a ramdisk at boot time, then it is recommended that you build both the filesystem that you
use for your root partition, and the disk controller for that disk, into the kernel, instead of having it as a module. Also, everything that can't be built as a module has to be built into the kernel .

I don't think there's anything "wrong" with building everything into the kernel vice as modules. The speed really depends on the arch from what I've read. A better reason to build modules is that you can unload them if something goes haywire.
 
Old 05-15-2008, 03:16 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

If you genuinely need it, then compiling it directly into the kernel will make the system go (slightly!) faster.

But compiling stuff you *don't* need each and every time you boot into the kernel could easily make the system go noticably slower.

Guideline: if you're not 100% sure, make it a loadable module.

IMHO .. PSM
 
Old 05-15-2008, 04:44 PM   #4
drut
LQ Newbie
 
Registered: Mar 2007
Posts: 21

Original Poster
Rep: Reputation: 15
Many thanks for the quick responses and useful info.

As you may have guessed it's the first time I'm configuring a kernel, and I have downloaded O’Reilly's 'Kernel in a Nutshell' - but it's a fairly big nutshell and I've not got through it all yet.

But with your advice I can carry on and hopefully get this LFS system up and running soon..

Thanks
 
Old 05-21-2008, 09:25 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
LFS is quite an adventure... but well worth the trouble.

When I built my (Gentoo) kernel, I determined (from a Knoppix DVD) what drivers were needed by my hardware. I put those drivers into the resident kernel and omitted everything else. In this way, when "my kernel" comes into memory, it has everything needed to run "my system."

What did I put into modules? Cryptographic routines, drivers for removable devices, stuff like that.

I don't like to set up systems that require the "initial ramdisk" approach. I understand of-course why distro writers use it, but for my own systems "I know precisely what I want."

Last edited by sundialsvcs; 05-21-2008 at 09:26 PM.
 
Old 06-17-2008, 07:53 AM   #6
ludist
Member
 
Registered: Nov 2005
Location: Greece
Distribution: Slackware
Posts: 172

Rep: Reputation: 21
If you have problematic hardware is better to compile as module. For example my sound card needs modprobe -r mycard; modprobe mycard to operate after suspend.
 
Old 06-19-2008, 08:36 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Thumbs up Suspend ... Good point!

That's a good point: "suspend" can be a problem and many drivers out there are not aware of its implications. Device-initialization needs to be performed a second time since the electrical power has been turned off and back on again. If you have a driver for a non-essential device that is not suspend-friendly, removing and then reloading the module is a way to be sure that the device-initialization step happens (again).
 
  


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
error: -1 Invalid module format when using insmod with module cross-compiled for arm AndrewShanks Linux - Embedded & Single-board computer 4 10-15-2007 03:50 AM
how to find out if a module has been compiled in my kernel? kpachopoulos Linux - General 2 09-17-2005 04:58 PM
ext3 compiled in? (As opposed to a module) akshunj Slackware 2 01-16-2005 05:39 PM
couldn't find the kernel version the module was compiled for famewolf Linux - Software 0 03-21-2004 09:52 PM
(usb)printer module not compiled.. What now ? Dark Carnival Slackware 14 02-07-2004 10:23 AM

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

All times are GMT -5. The time now is 07:47 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