bootloader-bios interaction


I am looking for the boot sequence for Linux OS (Intel P4 processor) In particular, where the BIOS finisies the POST and jumps to the predefined location where the bootloader code is executed. I believe while the BIOS is running the processor is configured in real mode. So when the bootloader code is executing, will the processor switch to protected mode?( i am not sure). If the processor runs the bootloader in real mode then it can see only 1MB of RAM. In this case if the linux image is greater than 1MB how can it uncompress the image? Could anyone give me some pointers about this execution ??

Thanks Uday

Reply to
Uday Mullangi
Loading thread data ...

"Uday Mullangi"



No,bootloader running in real mode then it do not load the whole kernel image. Bootloader only load part of kernel,and jump to it. In the kernel ,there is a asm function named setup() switch the processor to protected mode and call startup_32().The startup_32 do something and load other part of kernel image


Reply to

If you have a kernel up to 2.4.x with sources, look at the directory /usr/src/linux/arch/i386/boot/. These kernels are able to self-boot if they are copied at the start of a diskette. The file first executed is bootsect.S.

The standard loaders (LILO, GRUB) do their own loading, and they are much more complicated than the simple self-loader.

The whole kernel is read into the memory by the boot loader, and it has to use the BIOS disk drivers, as there are no other disk drivers in the system yet.

The code continues from bootsect.S to setup.S which changes the CPU to protected mode and continues to startup32() function in /usr/src/linux/arch/i386/boot/compressed/head.S. The function calls the function decompress_kernel() in misc.c in the same directory. A LILO or GRUB -loaded kernel is also started from startup32().

The decompressed kernel starts at startup32() in /usr/src/linux/arch/i386/kernel/head.S. It sets up the rest of the 32 bit runtime environment and calls the start_kernel() function in /usr/src/linux/init/main.c


Tauno Voipio
tauno voipio (at) iki fi
 Click to see the full signature
Reply to
Tauno Voipio

For a description of the boot process, see this file in the kernel source distribution "linux/Documentation/i386/boot.txt". You can download a copy from

I think this is the sequence for Windoze. I've never seen setup() and setup_32() in Linux.

Look in "linux/arch/i386/boot/setup.S" this is where the bios calls in real mode and the switch to protected happens.

Reply to
Craig Bergren

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.