iMBR(8) | System Manager's Manual (x86) | iMBR(8) |
The code present in the MBR typically examines the partition table with four entries, finds the partition that is marked ‘active’, and boots from it. Booting from a partition simply means loading the first sector of that partition (called Partition Boot Record or PBR) into memory, checking the PBR's signature and executing the code in the PBR, as is done for the MBR itself.
The boot disk is usually specified in the BIOS setup program.
The PC BIOS has an API to manipulate any disk that the BIOS happens to support. The API (known as CHS disk addressing) uses 10 bits to address the Cylinder, 8 bits to address the Head, and 6 bits to address the track Sector of a disk. This restricts any application (including MBRs and PBRs) using the BIOS to being able to address only 1024 cylinders, 256 heads, and 63 sectors (since the sectors are numbered from 1) on a disk. CHS disk addressing has the maximum address limit for a PBR placement on a disk. This limit equals to 8064 Megabytes (C*H*S*sector_size = 1024*256*63*512 bytes).
Modern disks have many more cylinders than the CHS disk addressing BIOS API can support, and likely more sectors per track as well. So the BIOS has to ‘re-map’ the cylinder/head/sector of the real disk geometry into something that would allow the applications using the BIOS to access these large disks, still using the restricted BIOS API. This geometry ‘re-mapping’ is disk controller and computer specific.
Note about the difference beetween tracks and cylinders. A hard disk is usually made up of multiple platters, each of which use two heads to record and read data, one for the top of the platter and one for the bottom (this is not always the case, but usually is). The heads that access the platters are locked together on an assembly of head arms. This means that all the heads move in and out together, so each head is always physically located at the same track number. It is not possible to have one head at track 10 and another at track 100. Because of this arrangement, often the track location of the heads is not referred to as a track number but rather as a cylinder number. A cylinder is basically the set of all tracks that all the heads are currently located at. So, for example, if a disk had four platters, it would (normally) have eight heads, and cylinder number 17 would be made up of the set of eight tracks, one per platter surface, at track number 17. Such a statement is valid for any cylinder. Each track is uniquely defined by the cylinder number and the head number of the disk.
To support larger addressing modes, an interface known as “INT 13h Extensions” was introduced. It uses Logical Block Addressing (LBA). LBA is a linear addressing scheme where only one number is used to address a disk sector. Sectors are sequentially numbered as integer indexes starting with 0. MBR partition tables use 32 bits for storing LBA numbers and size information. LBA extends the address limit for a PBR up to (512*(2**32)) bytes or 2 Terabytes.
Also iMBR can be configured so as it will present the user with a prompt, allowing a choice between partitions to boot from. The choices and default settings can be set through iMBR_editor(8).
iMBR outputs the prompt “OS: ”. The user can then type via the keyboard an OS name (which has been assigned to a partition) to boot.
The <Enter> key (and the expired timeout) causes iMBR to find the ‘active’ partition, and boot from it. If no key is pressed, the default OS is picked.
iMBR will await further input.
January 28, 2018 |