Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
understanding the boot process: loading kernel modules
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
phs
n00b
n00b


Joined: 29 Nov 2008
Posts: 8
Location: California, US

PostPosted: Sun Nov 30, 2008 6:13 pm    Post subject: understanding the boot process: loading kernel modules Reply with quote

I have a 2nd IDE controller card in addition to the one on the motherboard. Booting is not a problem, as the disk with the root filesystem is on the IDE controller on the motherboard.

Now, I have a choice of either building support into the kernel for my extra IDE controller, or loading a module. Doing the kernel build is pretty straightforward. However, because the extra card is removable (i.e. not on the motherboard), I like the idea of supporting it via a kernel module. So, if I have to replace the card, I simply replace the module, not the kernel.

My question is, can I do this? My understanding of the boot process is not solid. I do know that if I load the kernel module via /etc/modules.autoload.d/<your kernel here>, it loads too late in the boot process for fstab. Can I get the module to load sooner, or is this something I simply have to build into the kernel?

BTW, I am not currently using an initrd.


-phs
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Sun Nov 30, 2008 6:30 pm    Post subject: Reply with quote

Too have modules which load soon enough to use them for the rootfs you'd have to use initrd (I'd hate it ;]). If you build something as a module you can have it loaded on boot with modules-autoload. You can unload it at any time with rmmod, list curently loaded modules with lsmod and load modules with either modprobe or insmod. Generally use modules only for devices you are likely to replace with others often (or just build drivers for both of them into the kernel) or which must have modules for some reason.
Back to top
View user's profile Send private message
phs
n00b
n00b


Joined: 29 Nov 2008
Posts: 8
Location: California, US

PostPosted: Sun Nov 30, 2008 10:27 pm    Post subject: Reply with quote

Thanks.

You said "I'd hate it." What's the drawback to using an initrd?

-Paul
Back to top
View user's profile Send private message
poly_poly-man
Advocate
Advocate


Joined: 06 Dec 2006
Posts: 2477
Location: RIT, NY, US

PostPosted: Sun Nov 30, 2008 10:48 pm    Post subject: Reply with quote

phs wrote:
Thanks.

You said "I'd hate it." What's the drawback to using an initrd?

-Paul
initrd's are an extreme PITA... especially when you're doing them yourself.

Just build the driver in-kernel... what is it, a few kilobytes of extra memory taken up if you decide to remove the board?
_________________
iVBORw0KGgoAAAANSUhEUgAAA

avatar: new version of logo - see topic 838248. Potentially still a WiP.
Back to top
View user's profile Send private message
pappy_mcfae
Watchman
Watchman


Joined: 27 Dec 2007
Posts: 5999
Location: Pomona, California.

PostPosted: Mon Dec 01, 2008 5:55 am    Post subject: Reply with quote

Absolutely. Modules are good for lots of things, but IMHO, disk drivers aren't it. The only time to consider such a plan of attack is if the secondary IDE card initializes before the main one on your MB. If that isn't going to be a problem, skip the initrd and do it the right way.

Blessed be!
Pappy
_________________
This space left intentionally blank, except for these ASCII symbols.
Back to top
View user's profile Send private message
phs
n00b
n00b


Joined: 29 Nov 2008
Posts: 8
Location: California, US

PostPosted: Mon Dec 01, 2008 7:34 am    Post subject: Reply with quote

Okay. Thanks for the advice. I think I'll just build it into the kernel.

-Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum