From the Bootloader to the Kernel

From the Bootloader to the Kernel

In general, real mode’s memory map is as follows:

In the beginning of this post, I wrote that the first instruction executed by the CPU is located at address , which is much larger than (1MB). The kernel header arch/x86/boot/header.S starts from:

The bootloader must fill this and the rest of the headers (which are only marked as being type in the Linux boot protocol, such as in this example) with values which it has either received from the command line or calculated during boot. As we can see in the kernel boot protocol, the memory will be mapped as follows after loading the kernel:

So, when the bootloader transfers control to the kernel, it starts at:

where is the address of the kernel boot sector being loaded.

Source: 0xax.gitbooks.io