First page Back Continue Last page Overview Graphics
How Bootloader Works
Floppy
- The instructions in the first sector are loaded into RAM and executed
- Bootloader copies itself from 0x00007c00 to 0x00090000
- Sets up real mode stack
- Invokes a BIOS procedure to load the setup() code to 0x00090200
- Invokes a BIOS procedure to load the rest of the image from 0x00100000
- Jumps to setup() code
Hard Disk
- The first sector (MBR) contains the partition table and a small program that loads the first sector of the partition with the chosen OS
- Some OS (e.g. Win98) identify the boot partition with an גactiveג flag
- Only the OS whose image is on the active partition may be loaded
- Sophisticated programs such as LILO or GRUB may allow runtime choice of image
- LILOגs first stage is loaded to 0x00007c00, moves itself to 0x0009a000, sets up real mode stack, loads second stage to 0x0009b000
- User chooses kernel, the rest is similar to floppy
- Execution jumps to setup()