On Wed, 15 Dec 2004, Dan Kaspi wrote:

> I tried to understand the correlarion between initrd in grub.conf and the
> call to initrd_load() in the kernel (under init subtree).
> My question is : when we do not use initrd in grub (meaning there is no
> entry for initrd in grub.conf), does the kernel still calls load_initrd()?
> Or does it sets somehow the mount_initrd variable to false ? if so - how ?
>
> Grepping the kernel for no_initrd() shows that do_mounts_initrd.c is the
> only
> "C" file where this method definition appears.
> Does it have to do with the_setup call in this file : __setup("noinitrd",
> no_initrd) ?
>
> I did not see initrd it in the kernel command line:
> When I runcat /proc/cmdline to see the kernel command line,
> I do not see any mention of initrd (thoughin my grub.conf I DO USE initrd ).
> What I see is:
> ro root=/dev/hda3 hdb=none hdc=none hdd=none

ok, as a mulixes replacement, here's how things look in kernel 2.4:

1. the code you saw was just the tip of the iceburg. this code loads the
initrd device - but not from memory. rather, it is loaded form a device
file, /dev/root, which is created in this code with the major number of
the ramdisk block driver.

2. the ramdisk block driver contains variables 'initrd_start' and
'initrd_end' - which are supposed to be memory addresses from which the
initrd data is copied by the driver (look at drivers/block/rd.c)

3. from this i undrestand that the boot load loads the initrd file to
memory, uncompresses it, and writes its start and end addresses inside the
'initrd_start' and 'initrd_end' variables.

4. the question that remans - how does the boot loader know where to find
initrd_start and initrd_end? does it look their location directly in the
kernel's elf file and updates their contents? naah... this is done in the
architecture-specific code (e.g. for i386, in arch/i386/kernel/setup.c -
look for initrd_start there).

follow the yellow-break road....

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to