-
Notifications
You must be signed in to change notification settings - Fork 2
Boot
KeePromise edited this page Apr 22, 2021
·
1 revision
- The master boot record is the information that exists in the first sector of any hard disk. It contains information about the location and location of the operating system on the hard disk so that it can boot in RAM 1.
- The master boot record (MBR) is located in the first physical sector of the hard disk. Due to historical reasons, the size of a sector of a hard disk is 512 bytes, including up to 446 bytes of boot code, 4 hard disk partition table entries (each table entry is 16 bytes, a total of 64 bytes), and 2 signature bytes (0x55,0xAA) 2.
- The computer system starts by testing the hardware equipment of the machine. After the test is successful, it enters the bootloader INT l9H, and then sets the master boot record of 0 cylinder, 0 head, and 1 sector of the disk. The content is read into the memory designated unit, the first address is the area starting from 0:7C00, and the MBR program segment is executed. The master boot record takes precedence over all the instructions that the operating system is called into the memory, and plays a leading role. Finally, the control is handed over to the operating system in the main partition (active partition), and the main partition information is used to manage the hard disk. It can be seen that the master boot record does not depend on any operating system, and the hard disk boot program is variable, so it is possible to realize the coexistence of multiple systems (but up to 4 systems)3.
The design of KePOS's boot is mainly:
- Initialize the metadata information of a FAT12 file system at the beginning of the code.
- Find the loader code from the FAT12 file system.
- Jump to the loader for execution.
boot occupies 512 bytes of love, and the last 2 bytes are 0x55,0xAA