
1. boot sector 的组成
boot sector 也就是硬盘的第一个扇区, 它由 mbr (masterboot record),dpt (disk partition table) 和 boot record id 三部分组成.
mbr 又称作主引导记录占用 boot sector 的前 446 个字节( 0 to 0x1bd ),存放系统主引导程序 (它负责从活动分区中装载并运行系统引导程序).
dpt 即主分区表占用 64 个字节 (0x1be to 0x1fd),记录了磁盘的基本分区信息. 主分区表分为四个分区项, 每项 16 字节,分别记录了每个主分区的信息(因此 多可以有四个主分区).
boot record id 即引导区标记占用两个字节 (0x1fe and0x1ff), 对于合法引导区, 它等于 0xaa55, 这是判别引导区是否合法的标志.
boot sector 的具体结构如下图所示:
0000 |---------------------------------------------|
| |
| |
| master boot record |
| |
| |
| 主引导记录(446字节) |
| |
| |
| |
01bd | |
01be |---------------------------------------------|
| |
01cd | 分区信息 1(16字节) |
01ce |---------------------------------------------|
| |
01dd | 分区信息 2(16字节) |
01de |---------------------------------------------|
| |
01ed | 分区信息 3(16字节) |
01ee |---------------------------------------------|
| |
01fd | 分区信息 4(16字节) |
|---------------------------------------------|
| 01fe |01ff |
| 55 | aa |
|---------------------------------------------|
