Ink Blot welcomes you to Lance's Web Site!I've decided to resurrect my web site on a limited basis; mainly to discuss FAT32X, but also to test a new site build process. LC
(best viewed at 800x600 full screen!)
Booting ProcessThe booting process begins when you turn on, reset, or reboot your computer in some fashion.
Depending on the BIOS options and its setting, it may try to boot from A: then C:, C: then A:, only C:, B: then C:, the CD, the LAN, etc.
In any event, the BIOS does the same thing for each boot device. It attempts to read the first physical sector (cylinder 0, head 0, sector 1) on the device and stores this data at location 7C00h. If the current drive selection fails, it moves on to the next one until a successful read is performed.
For our purposes, we will consider two options:
1) Booting from floppy disk 2) Booting from hard disk
Floppy Disk BootThe structure of a floppy disk is simple. The first sector on the disk contains a partition boot record, and the remainder of the floppy disk contains the operating system, directories, data, etc.
The BIOS reads the first sector (0.0.1) of the floppy, stores the data at location 7C00h, and transfers control to location 7C00h. From that point on, the partition boot is in control and is responsible for loading the remainder of the operating system from the floppy disk.
Hard Disk BootThe structure of a hard disk is more complicated. The first sector of a hard disk contains a master boot record, which consists of a master boot program and partition table. The partition table contains the information of how the hard disk is divided, and the master boot program is designed to load an operating system from one of the partitions.
Each partition contains a partition boot record as the first sector of the partition, and the remainder of the partition contains the operating system, directories, data, etc.
The BIOS reads the master boot record from the first sector (0.0.1) of the disk, stores the data at location 7C00h, and transfers control to location 7C00h. At this point, the master boot program is in control.
The master boot program first relocates itself from 7C00h (its initial load address) to 600h. It then scans the partition table and finds an entry with the boot flag marked 'active' (typically the value is 80h). Using the starting cylinder.head.sector number in the partition table, It then loads the partition's bootstrap record from the first sector of the corresponding partition into memory at location 7C00h, and transfers control to it. At this point, the partition boot record is in control and is responsible for loading the remainder of the operating system from the hard disk.
SummaryBooting an operating system is a generic process. The OS is required to have its own partition boot record located as the first sector of its partition. The contents of the PBR may be strictly code, or code and partition information (as in FAT12/16/32). The booted OS may rely on information stored in the MBR's partition table, but it's not required to. The OS is required to know where its partition starts and stops, and should only modify data within its limits. An OS that requires itself to be the only OS on the disk, the only bootable OS on the disk, or randomly writes data on the disk is not a very will designed OS.
|Lance Costanzo, [email protected]|