Saturday, February 7, 2026

DOS Partition

DOS format disk into 4 primary partitions. There is a boot flag field in the partition to indicate to the boot loader ito boot from this partition. Some bootloader may not follow this convention (eg. unix) and has their one way to identity the partition to boot. 

If there is a need to have more than 4 partitions (drives in Windows term), multiple logical partitions can be defined in a primary partition. However, the windows boot loader will not be able to see and boot from logical partitions. 

BIOS booting

 When computer is powered on, the processor will clear all registers and set the CS and IP to a fixed address in the BIOS for x86. BIOS read the first sector (512 bytes) from the boot device and jump control to it. The code in the first sector is part 1 of the boot loader. It will read in the part 2 of loader which exists in the next 31K of the partition (or volume). Part 2 will then jump to part 3 of the loader which exists in the OS partition which in turn load the kernel. 

The OS partition can be in a separate partition on the disk.