View previous topic :: View next topic |
Author |
Message |
phs n00b
Joined: 29 Nov 2008 Posts: 8 Location: California, US
|
Posted: Sun Nov 30, 2008 6:13 pm Post subject: understanding the boot process: loading kernel modules |
|
|
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 |
|
|
szczerb Veteran
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Sun Nov 30, 2008 6:30 pm Post subject: |
|
|
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 |
|
|
phs n00b
Joined: 29 Nov 2008 Posts: 8 Location: California, US
|
Posted: Sun Nov 30, 2008 10:27 pm Post subject: |
|
|
Thanks.
You said "I'd hate it." What's the drawback to using an initrd?
-Paul |
|
Back to top |
|
|
poly_poly-man Advocate
Joined: 06 Dec 2006 Posts: 2477 Location: RIT, NY, US
|
Posted: Sun Nov 30, 2008 10:48 pm Post subject: |
|
|
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 |
|
|
pappy_mcfae Watchman
Joined: 27 Dec 2007 Posts: 5999 Location: Pomona, California.
|
Posted: Mon Dec 01, 2008 5:55 am Post subject: |
|
|
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 |
|
|
phs n00b
Joined: 29 Nov 2008 Posts: 8 Location: California, US
|
Posted: Mon Dec 01, 2008 7:34 am Post subject: |
|
|
Okay. Thanks for the advice. I think I'll just build it into the kernel.
-Paul |
|
Back to top |
|
|
|