kernel boot procedure

Manavendra Nath Manav mnm.kernel at gmail.com
Sat Mar 3 16:45:57 EST 2012


On Sun, Mar 4, 2012 at 2:46 AM, beyond.hack <beyond.hack at gmail.com> wrote:
> ***        when bootloader in bios executes its code, it do POST and other
> things...then as I read from somewhere  kernel does initrd to load some
> basic modules so as to mount the root file system and then removes the
> initrd fs.....
> (srry my mistake)
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

Quoting from Understanding the Linux Kernel:

The LILO boot loader is too large to fit into a single sector, thus it
is broken into two parts. The
MBR or the partition boot sector includes a small boot loader, which
is loaded into RAM starting from
address 0x00007c00 by the BIOS. This small program moves itself to the
address 0x00096a00, sets up
the Real Mode stack (ranging from 0x00098000 to 0x000969ff), loads the
second part of the LILO boot
loader into RAM starting from address 0x00096c00, and jumps into it.

The LILO boot loader, which relies on BIOS routines, performs
essentially the following operations:
1. Invokes a BIOS procedure to display a "Loading" message.
2. Invokes a BIOS procedure to load an initial portion of the kernel
image from disk: the first 512 bytes of the kernel image are put in
RAM at address 0x00090000, while the code of the setup( ) function is
put in RAM starting from address 0x00090200.
3. Invokes a BIOS procedure to load the rest of the kernel image from
disk and puts the image in RAM starting from either low address
0x00010000 (for small kernel images compiled with make zImage) or high
address 0x00100000 (for big kernel images compiled with make bzImage).
We say that the kernel image is "loaded low" or "loaded high" in RAM,
respectively.
4. Jumps to the setup( ) code.

So, you see the init routine is run only after the kernel has been
loaded in RAM.

-- 
Manavendra Nath Manav



More information about the Kernelnewbies mailing list