View Single Post
  #5   (View Single Post)  
Old 10th October 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by jggimi View Post
I did not mention flagging an MBR partition for booting. This is done with Windows by setting a partition "Active" -- with OpenBSD's fdisk, you "flag" a partition.
For today's history lesson, this was the original intent of the MBR.

For numerous reasons, hard drives in the mid-'80's to early '90's were logically partitioned into smaller logical block devices. Partitions were used to keep the size of logical devices to within MS-DOS' restrictions, & allow other operating systems to be installed on the same block device. MS-DOS restricted the number of primary partitions to four, & this legacy persists today. Extended partitions was a hack added later to allow more logical devices to be configured. Even if it was a hack, it was a clever hack. Extended partitions were implemented by having the MBR partition entry point to yet another table specifying the logical partitions within that particular extended partition.

When a Wintel computer first boots, it will go through POST & initialize all devices found in the system. Once stasis of the overall system has been reached (including spinning up the hard drive(s)...), the BIOS will search for its configured primary boot block device, & the last thing done before relinquishing control is determine whether the MBR signature, 0xAA55 (also called boot sector's magic number...) has been written to 0x01FE & 0x01FF in the first sector of the boot device. If this value is found, it then loads the boot sector into memory, & begins to execute instructions.

The first instructions found in the MBR checks the validity of the four partitions. Only one partition can be marked active, & execution is intended to abort if this criteria is not met.

This is the role OpenBSD's fdisk(8) (or any other operating system's fdisk(8)-like utility...) plays in the installation process. It will initialize the boot sector with the appropriate instructions, & provide an editor for manipulating the MBR's partition table. If a partition is to be marked active, fdisk(8) will ensure that only one is marked active.

More exciting information can be found in Section 14.6 of the FAQ:

http://openbsd.org/faq/faq14.html#Boot386

Class dismissed.

Reply With Quote