PC/AT Boot

Every PC has a BIOS (Basic Input/Output System). BIOS checks and initializes the computer. For instance, it checks and initializes computer memory.

BIOS has basic services like read/write in disk, video, etc.

When the computer starts or restarts, the processor is in real mode, that is, it works like a faster old 8086. In this mode, we have a 1 MB memory limit and all instructions are 16 bits. At boot process only BIOS services exist - BIOS interrupts.

After checking and initializing the computer, BIOS tries to load a program from disk. Normally this disk is the boot disk of an operating system. But it can be any program.

BIOS can read this program from drive A, from HD, and more recently, from CDROM, second HD, etc.

If BIOS will read from drive A or from HD, it reads the first sector (sector 1, cylinder 0, head 0) to memory address 0000:7C00h and looks for an ID saying that this sector is a boot sector. This ID (55AAh) stay in the last two bytes of the sector. If the sector don't has this ID, BIOS goes to the next device. If it has, control goes to the sector.

Normally in the floppy disk there's a operating system's boot program which loads the operating system. But in the HD this is different. The boot sector chooses a partition, the active partition, loads the first sector of this partition and pass control to this sector.