第二章 啟動磁區Boot Sector
對於一般的2HD, 2DD來說、啟動磁區都佔有磁區的前512KiB啟動磁區的大小,一般的5吋跟3.5吋都是512KiB,只有某些舊式的8吋磁碟會有其他的大小
所以基本上,先讀512KB進來分析就對了!!
雖然最近的系統裡都會定義這個部分,但是某些舊式的系統(像是MSX-DOS 1.0,還有MOTOMAN的軟碟片)會直接跳過這部分,而讀取FAT磁區的第一byte來確認磁碟格式。
當系統讀不出磁碟內容的時候,絕對是Boot Sector被跳過了!!
這512KiB中,資料依照以下內容排列:
Sector Offset 磁區偏移 |
BPB Offser |
length 長度 |
說明 |
---|---|---|---|
0x000 | 3 | Jump instruction. 跳轉指令(跳過開頭一段區域) |
|
0x003 | 8 | OEM Name (padded with spaces
0x20). OEM名稱(空白0x20補齊) |
|
0x00B | 0x00 | 2 | Bytes per logical sector 磁區位元組數 |
0x00D | 0x02 | 1 | Logical sectors per cluster.
每叢集磁區數 |
0x00E | 0x03 | 2 | Reserved logical sectors 保留磁區數(包括啟動磁區) |
0x010 | 0x05 | 1 | Number of File Allocation
Tables. 檔案分配表數目 |
0x011 | 0x06 | 2 | Maximum number of FAT12 or FAT16
root directory entries. 根目錄磁區最大登錄數 |
0x013 | 0x08 | 2 | Total logical sectors. 總磁區數. |
0x015 | 0x0A | 1 | Media Descriptor 介質描述。常用0xF0: 2HD144, 0xF9: 2DD720, 0xFB: 2DD640 |
0x016 | 0x0B | 2 | Logical sectors per File
Allocation Table for FAT12/FAT16. 每個檔案分配表的邏輯磁區數 |
0x018 | 0x0D | 2 | Physical sectors per track for
disks with INT 13h CHS geometry. 磁軌磁區數 |
0x01A | 0x0F | 2 | Number of heads
for disks with INT 13h CHS geometry 磁頭數 |
0x01C | 0x11 | 4 | Count of hidden sectors
preceding the partition that contains this FAT volume. 隱藏磁區數 |
0x020 | 0x15 | 4 | Total logical
sectors(FAT16) 總磁區數。當大於65535時(0xffff)。FAT12下是通常不會用到… |
0x026 | 0x1B | 1 | Extended boot
signature(0x29) 延伸啟動磁區記號。通常為0x29 |
0x027 | 0x1C | 4 | Volume ID(serial number) 磁碟ID。"xxxx-xxxx" 通常是系統時間與系統日期的綜合。至於位元組內容可以參考根目錄磁區的檔案時間與日期 |
0x02B | 0x20 | 11 | Partition Volume Label, padded
with blanks(0x20). 分割區標籤。 |
0x036 | 0x2B | 8 | File system type, padded with
blanks(0x20). 檔案系統格式。e.g., "FAT12 ","FAT16 ", "FAT " |
0x1FE | 2 | Boot sector signature (0x55
0xAA) 磁區結束符 |
為了快速查詢各種參數,請看下面的表(出自英文版的Wikipedia。中文翻譯則以中文維基百科為主)
Media Descriptor 界質描述 |
0xF0 | 0xF9 | 0xFA | 0xFB | 0xFC | 0xFD | 0xFE | 0xFF | |
---|---|---|---|---|---|---|---|---|---|
DISC Size 物理磁碟尺寸 |
3.5" | 5.25" | 3.5" | 3.5" 5.25" |
3.5" 5.25" |
5.25" | 5.25" | 5.25" | 5.25" |
Density 磁碟密度 |
HD | HD | DD | DD | DD | DD | DD | ||
Modulation 調變 |
MFM | MFM | MFM | MFM | MFM | MFM | MFM | MFM | MFM |
Formatted Capacity(KiB) 格式化磁碟容量 |
1440 | 1200 | 720 | 320 | 640 | 180 | 360 | 160 | 320 |
Cylinders(CHS) 磁柱數 |
80 | 80 | 80 | 80 | 80 | 40 | 40 | 40 | 40 |
Physical sertors/track 磁軌磁區數[0x18] |
18 | 15 | 9 | 8 | 8 | 9 | 9 | 8 | 8 |
Number of heads 磁頭數[0x1A] |
2 | 2 | 2 | 1 | 2 | 1 | 2 | 1 | 2 |
Bytes/Logical sector 邏輯磁區位元組數[0x0B] |
512 | 512 | 512 | 512 | 512 | 512 | 512 | 512 | 512 |
Logical sectors/cluster 每個簇的邏輯磁區數[0x0D] |
1 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 |
Reserved Logical Sectors 保留磁區數[0x0E] |
1 | 1 | 1(2) | 1 | 1 | 1 | 1 | 1 | 1 |
Number of FATs FAT數[0x10] |
2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
Root directory entries 根目錄條目數[0x11] |
224 | 224 | 112 | 64 | 112 | 64 | 112 | 64 | 112 |
Total logical sectors 總磁區數 |
2880 | 2400 | 1440 | 640 | 1280 | 360 | 720 | 320 | 640 |
logical sectors/FAT FAT磁區數 |
9 | 7 | 3 | 2 | 2 | 2 | 2 | 1 | 1 |
Hidden sectors 隱藏磁區數 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 件のコメント:
コメントを投稿