kernel presentation at ILUG on Sat.

Charles Steinkuehler charles at steinkuehler.net
Mon May 5 18:51:01 CDT 2003


Jason Clinton wrote:
> Charles Steinkuehler wrote:
> 
>> <ugh>  See previous e-mails.  The kernel does decompress itself into 
>> memory.  There are many C (and assembly) programs "mashed together" to 
>> form the kernel binary, but everything is rolled into the single 
>> bzImage (or zImage) file.
>>
>> The only loading of seperate binary files to form "one large rutnime 
>> monolithic kernel" that occurs is if you load kernel modules at 
>> runtime, and I think even then they'd be considered kernel modules, 
>> rather than part of a monolithic kernel, as they can still be unloaded.
>>
> Is there a way to load kernel modules from the kernel boot command line? 
> Say I did make such a mistake and were to build in reiserfs as a module 
> ... could I (theoretically, not saying this is good practice) copy the 
> reiserfs modules from another installation of the same kernel version on 
> to a floppy and pass something like: kernel root=/dev/hda3 
> loadmodule=(fd0,0)/reiserfs.o ?

AFAIK, there is no way for the kernel to directly load modules from the 
command line.  You would have to do this from an initial ramdisk image 
(note that you could make a very simple initrd that included a small 
shell and something like busybox, which would allow you to mount various 
devices and install modules prior to continuing the boot process).

I recall, however, some work underway to allow bypassing the initial 
ramdisk functionality by using the bootloader (ie you could tell the 
bootloader to load the kernel *AND* various modules).  I have not stayed 
on top of this lately, so I'm not sure what (if anything) has been 
implemented as a standard part of the kernel and/or any of the normal 
bootloaders.

In general, everything you need to access your root partition must 
either be compiled into the kernel, or built into the initial ramdisk 
image.  So if your root partition is formatted with reiserfs, you need 
to make a custom initial ramdisk, or compile riserfs support into your 
kernel.

NOTE:  Another thing to keep in mind if you're using reiserfs (or any 
other fs for that matter) is how your bootloader interacts with it. 
Some boot loaders (like grub) talk directly to the filesystem, while 
others (like lilo) store sector maps of where particular files live on 
the physical disk.  Both can be confused by filesystems they are not 
written to support.  Obviously grub needs to be very filesystem aware, 
while even lilo can be confused if your file does not directly map into 
physical blocks on the disk (IIRC, reiserfs puts part of the data for 
small files in the directory structure for optimizations, but this might 
confuse something expecting the file to be a collection of 512 byte raw 
sectors).

-- 
Charles Steinkuehler
charles at steinkuehler.net




More information about the Kclug mailing list