GRUB4DOS(十一) grldr可啓動的軟盤或硬盤分區的說明

摘抄自:http://bbs.znpc.net/viewthread.php?tid=5587
******************************************************************************
***   grldr可啓動的軟盤或硬盤分區的說明                       ***
******************************************************************************
1. Ext2 引導扇區/引導記錄的佈局 (用於載入grldr)

------------------------------------------------------------------------------
一個EXT2/EXT3的卷可以是GRUB可啓動的。複製grldr和可選的menu.lst文件到這個EXT2/EXT3
卷的根目錄,並按照grldr的第五扇區建立它的引導扇區(一些需要更改的字段在下面的表
中做了詳細註釋)。那麼,這個EXT2/EXT3的卷就是GRUB可啓動的。

更新:   bootlace.com是一個dos/linux下的工具,它可以把GRLDR的引導記錄安裝到一個
        EXT2/EXT3卷的第一扇區。

偏移    長度    說明
======    ======    ==============================================================
00h    2    Machine code for short jump over the data.
                近轉移指令的機器碼

02h    1    LBA indicator. Valid values are 0x02 for CHS mode, or 0x42 for
        LBA mode.
                LBA指示碼。CHS模式時,有效值是0x02;LBA模式時有效值爲0x42。

        If the BIOS int13 supports LBA, this byte can be safely set to
        0x42.
                如果BIOS的int13支持LBA,此字節可以安全地設置爲0x42。

        Some USB BIOSes might have bugs when using CHS mode, so the
        format program should set this byte to 0x42. It seems that
        (generally) all USB BIOSes have LBA support.
                某些 USB 設備的BIOS在使用CHS尋址模式時可能有缺陷,所以格式化程
                序應當設置這個字節爲0X42 。似乎所有(多數)的USB BIOS都能支持LBA 。

        If the format program does not know whether the BIOS has LBA
        support, it may operate this way:
                如果格式化程序不知道BIOS是否具有LBA支持,它可以採用以下方法:

        if (partition_start + total_sectors_in_partition) exceeds the
        CHS addressing ability(especially when it is greater than
        1024*256*63), the caller should set this byte to 0x42,
        otherwise, set to 0x02.
                如果(分區的起始地址加上分區的總扇區)超過了CHS的尋址能力。
        (特別是當它大於1024*256*63時),調用程序應當設置此字節爲0x42,
        否則,要設爲0x02。

        Note that Windows98 uses the value 0x0e as the LBA indicator.
                注意 Windows98 使用0x0e作爲LBA指示碼。               

        Update: this byte of LBA indicator is ignored. The boot
        record can probe the LBA support of BIOS.
                更新:LBA指示碼這個字節已被忽略。引導記錄能夠探測BIOS的LBA支持。

03h    10    OEM name string (of OS which formatted the disk).
        Update: this field is now used for error message of "I/O error"
                OEM 名稱字符串(對該磁盤進行格式化的操作系統的名字)。
                更新:此字段現在被用於錯誤提示信息“I/O error”

0Dh    1    Sectors per block. Valid values are 2, 4, 8, 16 and 32.
                每塊扇區數。有效值是2, 4, 8, 16 和 32。
                
0Eh    2    Bytes per block. Valid values are 0x400, 0x800, 0x1000, 0x2000
        and 0x4000.
                每塊字節數。有效值是0x400, 0x800, 0x1000, 0x2000 和 0x4000。

10h    4    Pointers in pointers-per-block blocks, that is, number of
        blocks covered by a double-indirect block.               
                在pointers-per-block塊中的指針數,即一個二級間接塊包含的塊數。

        Valid values are 0x10000, 0x40000, 0x100000, 0x400000 and
        0x1000000.
                有效值是0x10000, 0x40000, 0x100000, 0x400000 和    0x1000000。

14h    4    Pointers per block, that is, number of blocks covered by an
        indirect block.
                每塊指針數,即一個間接塊包含的塊數。

        Valid values are 0x100, 0x200, 0x400, 0x800, 0x1000.
                有效值是0x100, 0x200, 0x400, 0x800, 0x1000 。

18h    2    Sectors per track.
                每磁道的扇區數。

1Ah    2    Number of heads/sides.
                磁頭數/面數

1Ch    4    Number of hidden sectors (those preceding the boot sector).
                隱藏扇區數(它們位於引導扇區之前)

        Also referred to as the starting sector of the partition.
                也被成爲是分區的起始扇區。

        For floppies, it should be 0.
                對於軟盤,它應當爲0 。
                
20h    4    Total number of sectors in the filesystem(or in the partition).
                文件系統中的扇區總數(或者是分區的扇區總數)。

24h    1    BIOS drive number of the boot device.               
                啓動設備的 BIOS 驅動器號碼。

        Actually this byte is ignored for read. The boot code will
        write DL onto this byte. The BIOS or the caller should set
        drive number in DL.
                實際此字節在讀入時被忽略。引導代碼將把DL的值寫入到此字節中。
                BIOS或者調用程序應當在DL中設置磁盤號碼。

        We assume all BIOSes pass correct drive number in DL.
        Buggy BIOSes are not supported!!
                我們假定所有的BIOS在DL中能傳遞正確的磁盤號碼。
                糟糕的BIOS不被支持!!

25h    1    Partition number of this partition on the boot drive.
                此分區在啓動驅動器上的分區號

        0, 1, 2, 3 are primary partitions.
        4, 5, 6, ... are logical partitions in the extended partition.
                0, 1, 2, 3 是主分區 。4, 5, 6, ... 等等是擴展分區中的邏輯分區。

        0xff is for whole drive. So for floppies, it should be 0xff.
                0xff代表整個磁盤。所以對於軟盤,其分區號碼應當是0xff 。

26h    2    inode size in bytes. (Notice! We use the formerly reserved
        word here for inode size!)
                字節計數的索引節點大小。(注意!我們在此處爲索引節點大小使用
                了以前被保留的一個字,即兩個字節)

28h    4    Number of inodes per group.
                每組的i節點數  

        Normally a 1.44M floppy has only one group, and the total
        number of inodes is 184. So the value should be    184 or
        greater.
                通常,1.44M軟盤只有一個組,並且總的i節點數是184。所以此值
                應爲184或者更大。

2Ch    4    The block number for group descriptors.
                組描述符的塊號碼。

        Valid values are 2 for 1024-byte blocks, and 1 otherwise.
                對於1024字節的塊有效值是2 ,否則是1 。

        The value here is equal to (s_first_data_block + 1).
                這裏的值等於(s_first_data_block + 1)。

30h    1    code for "cld"(0xFC).
                指令“cld”(即0xFC)。

31h    2    code for "xor ax,ax"(0x31, 0xC0).
                指令“xor ax,ax”(即0x31,0xC0)

33h    1    code for "nop"(0x90) or "cwd"(0x99)
                指令“nop”(即0x90)或“cwd”(即0x99)

34h    458    The rest of the machine code.
                機器碼部分。

1FEh    2    Boot Signature AA55h.
                引導簽名AA55h 。


2. FAT12/FAT16 Boot Sector/Boot Record Layout (for loading grldr)
2. FAT12/FAT16 引導扇區/引導記錄的佈局 (用於載入grldr)

------------------------------------------------------------------------------
A FAT12/16 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
the root dir of the FAT12/16 volume, and build the boot sector based on the
fourth sector of grldr(some fields need to be changed as detailed in the
following table). And then the FAT12/16 volume is GRUB-bootable.
一個FAT12/16的卷是GRUB可啓動的。複製grldr和可選的menu.lst文件到這個FAT12/16 卷
的根目錄,並按照grldr的第四扇區建立它的引導扇區(一些需要更改的字段在下面的表中
做了詳細註釋)。然後這個FAT12/16的卷就是GRUB可啓動的。

Update:    bootlace.com is a DOS/Linux utility that can install the GRLDR boot
record onto the boot sector of an FAT12/16 volume.
更新:   bootlace.com 是一個dos/linux下的工具,而它能把GRLDR的引導記錄安裝到一個
        FAT12/16卷的引導扇區。

Offset    Length    Description
偏移    長度    說明

======    ======    ==============================================================
00h    2    Machine code for short jump over the data.
                近轉移指令的機器碼

02h    1    LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
        LBA mode.
                LBA指示碼。CHS模式時,有效值爲0x90;LBA模式時,有效值爲0x0e 。

        If the BIOS int13 supports LBA, this byte can be safely set to
        0x0e.
                如果BIOS int13支持LBA,此字節可以安全地設置爲0x0e 。

        Some USB BIOSes might have bugs when using CHS mode, so the
        format program should set this byte to 0x0e. It seems that
        (generally) all USB BIOSes have LBA support.
                某些USB設備的BIOS在使用CHS尋址模式時可能有缺陷,所以格式化程序
                應當設置這個字節爲0X0e 。似乎所有的(多數)USB BIOS都能支持 LBA 。
                
        If the format program does not know whether the BIOS has LBA
        support, it may operate this way:
                如果格式化程序不知道BIOS是否具有LBA支持,它可以採用以下方法:

        if (partition_start + total_sectors_in_partition) exceeds the
        CHS addressing ability(especially when it is greater than
        1024*256*63), the caller should set this byte to 0x0e,
        otherwise, set to 0x90.
                如果(分區的起始地址加上分區的總扇區)超過了CHS 的尋址能力。
        (特別是當它大於1024*256*63),調用程序應當設置此字節爲0x0e,
        否則,要設爲0x90。

        Update: this byte of LBA indicator is ignored. The boot
        record can probe the LBA support of BIOS.
                更新:LBA 指示碼這個字節已被忽略。引導記錄能探測BIOS的LBA支持。

        Update(2006-07-31): Though GRLDR won't use this LBA-indicator
        byte, Windows 98 uses it. Usually this byte should be 0x90 for
        CHS mode(especially for floppies). If this byte is not set
        properly, Windows 98 will not recognize the floppy or
        partition. This problem was reported by neiljoy. Many thanks!
                更新 (2006-07-31):儘管GRLDR不再使用LBA指示碼這個字節,
                但Windows 98會使用它。通常這個字節在 CHS 模式中應當設置爲0x90
               (軟盤尤其如此)。如果此字節未被正確設置,Windows 98將不能識別
                軟盤或分區。這一問題由neiljoy先生報告。非常感謝!

03h    8    OEM name string (of OS which formatted the disk).
                OEM名稱字符串 (對該磁盤進行格式化的操作系統的名稱)

0Bh    2    Bytes per sector. Must be 512.
                每扇區字節數。必須爲512 。

0Dh    1    Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
        and 128. But a cluster size larger than 32K should not occur.
                每簇的扇區數。有效值是1, 2, 4, 8, 16, 32, 64和128 。但是簇大小
        大於32K的情況不應發生。

0Eh    2    Reserved sectors(number of sectors before the first FAT,
        including the boot sector), usually 1.
                保留的扇區數(第一文件分配表之前的扇區數,包括引導扇區),通常是1。

10h    1    Number of FATs(nearly always 2).
                文件分配表數(幾乎總是2)。

11h    2    Maximum number of root directory entries.
                根目錄項的最大個數。

13h    2    Total number of sectors (for small disks only, if the disk is
        too big this is set to 0 and offset 20h is used instead).
                扇區總數(僅用於小磁盤,如果磁盤太大此處被設置爲0,而偏移 20h 處
        則替代它使用)。

15h    1    Media descriptor byte, pretty meaningless now (see below).
                媒體描述符字節,現在該此節已經沒有太大意義了(參見後面)。

16h    2    Sectors per FAT.
                每個文件分配表的扇區數。

18h    2    Sectors per track.
                每個磁道的扇區數

1Ah    2    Total number of heads/sides.
                磁頭或面的總數。

1Ch    4    Number of hidden sectors (those preceding the boot sector).
                隱藏扇區數(位於引導扇區之前)。

        Also referred to as the starting sector of the partition.
                也被稱爲是分區的開始扇區。

        For floppies, it should be 0.
                對於軟盤,它應當爲0 。

20h    4    Total number of sectors for large disks.
                大磁盤的扇區總數。

24h    1    BIOS drive number of the boot device.
                引導設備的BIOS磁盤號。

        Actually this byte is ignored for read. The boot code will
        write DL onto this byte. The BIOS or the caller should set
        drive number in DL.
                實際此字節在讀入時被忽略。引導代碼將把DL中的值寫入此字節。
                BIOS或者調用程序應當在DL中設置磁盤號碼。

        We assume all BIOSes pass correct drive number in DL.
        Buggy BIOSes are not supported!!
                我們假定所有的BIOS在DL中能傳遞正確的磁盤號碼。
                糟糕的BIOS不被支持!!

25h    1    Partition number of this filesystem in the boot drive.
                啓動驅動器上此文件系統的分區號碼。

        This byte is ignored for read. The boot code will write
        partition number onto this byte. See offset 41h below.
                此字節在讀入時被忽略。引導代碼將分區號碼寫到此字節。
        見下述偏移41h 。

26h    1    Signature (must be 28h or 29h to be recognised by NT).
                簽名(必須是28h或者29h以便能被 NT 識別)

27h    4    Volume serial number.
                卷的序列號。

2Bh    11    Volume label.
                卷標籤。

36h    8    File system ID. "FAT12   ", "FAT16   " or "FAT     ".
                文件系統ID。“FAT12”, “FAT16”或 “FAT”。

3Eh    1    code for "cli".
                指令“cli”。

3Fh    1    code for "cld".
                指令“cld”。

40h    1    code for "mov dh, imm8".
                指令“mov dh, imm8”。

41h    1    Partition number of this partition on the boot drive.
                此分區在啓動驅動器的分區號。

        0, 1, 2, 3 are primary partitions.
        4, 5, 6, ... are logical partitions in the extended partition.
                0, 1, 2, 3 是主分區。4, 5, 6, ... 等等是擴展分區中的邏輯分區。

        0xff is for whole drive. So for floppies, it should be 0xff.
                0xff代表整個磁盤。所以對於軟盤,其分區號碼應當是0xff 。

42h    442    The rest of the machine code.
                機器碼部分。

1FCh    4    Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
                引導簽名AA550000h 。(Win9x 使用4字節作爲魔數值。)


3. FAT32 Boot Sector/Boot Record Layout (for loading grldr)
3. FAT32 引導扇區/引導記錄的佈局 (用於載入grldr)

------------------------------------------------------------------------------
A FAT32 volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
the root dir of the FAT32 volume, and build the boot sector based on the
third sector of grldr(some fields need to be changed as detailed in the
following table). And then the FAT32 volume is GRUB-bootable.
一個FAT32的卷是GRUB可啓動的。複製grldr和可選的menu.lst文件到這個FAT32卷的根
目錄,並按照grldr的第三扇區建立它的引導扇區(一些需要更改的字段在下面的表中
做了詳細註釋)。然後這個FAT32的卷就是GRUB可啓動的。

Update:    bootlace.com is a DOS/Linux utility that can install the GRLDR boot
record onto the boot sector of an FAT32 volume.
更新:   bootlace.com 是一個dos及linux下的工具而它能把 GRLDR 的引導記錄安裝
        到一個FAT32卷的引導扇區。


Offset    Length    Description
偏移    長度    說明

======    ======    ==============================================================
00h    2    Machine code for short jump over the data.
                近轉移指令的機器碼。

02h    1    LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
        LBA mode.
                LBA指示碼。CHS模式時,有效值爲0x90,而LBA模式時,有效值爲0x0e。

        If the BIOS int13 supports LBA, this byte can be safely set to
        0x0e. 
                如果BIOS的int13支持LBA,此字節可以安全地設置爲0x0e。

        Some USB BIOSes might have bugs when using CHS mode, so the
        format program should set this byte to 0x0e. It seems that
        (generally) all USB BIOSes have LBA support.
                某些USB設備的BIOS在使用CHS尋址模式時可能有缺陷,所以格式化程
                序應當設置這個字節爲0X0e。似乎所有(多數)的USB BIOS都能支持LBA 。

        If the format program does not know whether the BIOS has LBA
        support, it may operate this way:
                如果格式化程序不知道BIOS是否具有LBA支持,它可以採用以下方法:

        if (partition_start + total_sectors_in_partition) exceeds the
        CHS addressing ability(especially when it is greater than
        1024*256*63), the caller should set this byte to 0x0e,
        otherwise, set to 0x90.
                如果(分區的起始地址加上分區的總扇區)超過了CHS 的尋址能力。
           (特別是當它大於1024*256*63),調用程序應當設置此字節爲0x0e,
        否則,要設爲0x90。

        Update: this byte of LBA indicator is ignored. The boot
        record can probe the LBA support of BIOS.
                更新: LBA 指示碼這個字節已被忽略。引導記錄能探測BIO的LBA支持。

        Update(2006-07-31): Though GRLDR won't use this LBA-indicator
        byte, Windows 98 uses it. Usually this byte should be 0x90 for
        CHS mode(especially for floppies). If this byte is not set
        properly, Windows 98 will not recognize the floppy or
        partition. This problem was reported by neiljoy. Many thanks!
                更新 (2006-07-31):儘管GRLDR不再使用 LBA 指示碼這個字節,
                但Windows 98會使用它。通常這個字節在 CHS 模式中應當設置爲0x90
               (軟盤尤其如此)。如果此字節未被正確設置,Windows 98 將不能識別
                軟盤或分區。這一問題由neiljoy先生報告。非常感謝!

03h    8    OEM name string (of OS which formatted the disk).
                OEM名稱字符串 (對該磁盤進行格式化的操作系統的名稱)

0Bh    2    Bytes per sector. Must be 512.
                每扇區字節數。必須爲512 。

0Dh    1    Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
        and 128. But a cluster size larger than 32K should not occur.
                每簇的扇區數。有效值是1, 2, 4, 8, 16, 32, 64 和 128 。
                但是簇大小大於32K的情況不應發生。

0Eh    2    Reserved sectors(number of sectors before the first FAT,
        including the boot sector), usually 1.
                保留的扇區數(第一文件分配表之前的扇區數,包括引導扇區),
                通常是1 。

10h    1    Number of FATs(nearly always 2).
                文件分配表數(幾乎總是2)。

11h    2    (Maximum number of root directory entries)Must be 0.
               (根目錄項的最大個數)必須爲0 。

13h    2    (Total number of sectors for small disks only)Must be 0.
               (僅用於小磁盤的扇區總數)必須爲0 。

15h    1    Media descriptor byte, pretty meaningless now (see below).
                媒體描述符字節,現在該此節已經沒有太大意義了(參見後面)。

16h    2    (Sectors per FAT)Must be 0.
               (每個文件分配表的扇區數)必須爲0 。

18h    2    Sectors per track.
                每個磁道的扇區數

1Ah    2    Total number of heads/sides.
                磁頭或面的總數。

1Ch    4    Number of hidden sectors (those preceding the boot sector).
                隱藏扇區數(它們位於引導扇區之前)。

        Also referred to as the starting sector of the partition.
                也被稱作是分區的起始扇區。

        For floppies, it should be 0.
                對於軟盤,它應當爲0 。

20h    4    Total number of sectors for large disks.
                大磁盤的扇區總數。

24h    4    FAT32 sectors per FAT.
                每個文件分配表的 FAT32 扇區數。

28h    2    If bit 7 is clear then all FATs are updated, otherwise bits
        0-3 give the current active FAT, all other bits are reserved.
                如果第7位被清零,所有文件分配表將被更新,否則0-3位給出當前活
                動的文件分配表,所有其它位被保留。

2Ah    2    High byte is major revision number, low byte is minor revision
        number, currently both are 0.
                高字節是主修訂號碼,低字節是小修訂號碼,現在都是0 。

2Ch    4    Root directory starting cluster.
                根目錄起始簇。

30h    2    File system information sector.
                文件系統信息扇區。

32h    2    If non-zero this gives the sector which holds a copy of the
        boot record, usually 6.
                如果非零它給出具有引導記錄的備份扇區,通常是6。

34h    12    Reserved, set to 0.
                保留,設爲0 。

40h    1    BIOS drive number of the boot device.
                啓動設備的 BIOS 驅動器號碼。

        80h is first HDD, 00h is first FDD.
                第一硬盤是80h,第一軟盤是00h。

        Actually this byte is ignored for read. The boot code will
        write DL onto this byte. The BIOS or the caller should set
        drive number in DL.
                實際此字節在讀入時被忽略。引導代碼將把DL中的值寫入此字節。
                BIOS或者調用程序應當在DL中設置磁盤號碼。

        We assume all BIOSes pass correct drive number in DL.
        Buggy BIOSes are not supported!!
                我們假定所有的 BIOS 在DL中能傳遞正確的磁盤號碼。
                糟糕的BIOS不被支持!!

41h    1    Partition number of this filesystem in the boot drive.
                啓動驅動器上此文件系統的分區號碼。

        This byte is ignored for read. The boot code will write
        partition number onto this byte. See offset 5Dh below.
                此字節在讀入時被忽略。引導代碼將分區號碼寫到此字節。
        見下述的偏移5Dh 。

42h    1    Signature (must be 28h or 29h to be recognised by NT).
                簽名(必須是 28h 或者 29h 以便能被 NT 識別)

43h    4    Volume serial number.
                卷的序列號。

47h    11    Volume label.
                卷標籤。

52h    8    File system ID. "FAT32   ".
                文件系統標識。“FAT32 ”。

5Ah    1    opcode for "cli".
                指令 “cli”。

5Bh    1    opcode for "cld".
                指令 “cld” 。

5Ch    1    opcode for "mov dh, imm8". 
                指令 “mov dh, imm8”。

5Dh    1    Partition number of this partition on the boot drive.
                此分區在啓動驅動器上的分區號。

        0, 1, 2, 3 are primary partitions.
        4, 5, 6, ... are logical partitions in the extended partition.
                0, 1, 2, 3 是主分區。4, 5, 6, ...等等是擴展分區中的邏輯分區。

        0xff is for whole drive. So for floppies, it should be 0xff.
                0xff 代表整個磁盤。所以對於軟盤,其分區號碼應當是0xff 。

5Eh    414    The rest of the machine code.
                機器碼部分。

1FCh    4    Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
                引導簽名AA550000h 。(Win9x 使用4字節作爲魔數值。)


4. NTFS Boot Sector/Boot Record Layout (for loading grldr)
   NTFS 引導扇區/引導記錄的佈局 (用於載入grldr)

------------------------------------------------------------------------------
An NTFS volume can be GRUB-bootable. Copy grldr and an optional menu.lst to
the root dir of the NTFS volume, and build the boot sector based on the
6th-9th sectors of grldr(some fields need to be changed as detailed in the
following table). And then the NTFS volume is GRUB-bootable.
一個FAT32的卷是GRUB可啓動的。複製grldr和可選的menu.lst文件到這個FAT32卷的根
目錄,並按照grldr的第6至9扇區建立它的引導扇區(一些需要更改的字段在下面的表
中做了詳細註釋)。然後這個FAT32的卷就是GRUB可啓動的。

Update:    bootlace.com is a DOS/Linux utility that can install the GRLDR boot
record onto the leading 4 sectors of an NTFS volume.
更新:   bootlace.com是一個在dos/linux下的工具,而它能把GRLDR的引導記錄安裝到
        一個NTFS卷的開頭4個扇區。

Offset    Length    Description
偏移    長度    說明

======    ======    ==============================================================
00h    2    Machine code for short jump over the data.
                近轉移指令的機器碼。
                
02h    1    LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
        LBA mode.
                LBA指示碼。CHS模式時,有效值爲0x90;LAB模式時,有效值爲0x0e。

        If the BIOS int13 supports LBA, this byte can be safely set to
        0x0e.
                如果BIOS的int13支持LBA,此字節可以安全地設置爲0x0e 。

        Some USB BIOSes might have bugs when using CHS mode, so the
        format program should set this byte to 0x0e. It seems that
        (generally) all USB BIOSes have LBA support.
                某些USB設備的BIOS在使用CHS尋址模式時可能有缺陷,所以格式化程
                序應當設置這個字節爲0X0e 。似乎所有(多數)的USB BIOS 都能支持LBA。

        If the format program does not know whether the BIOS has LBA
        support, it may operate this way:
                如果格式化程序不知道BIOS是否具有LBA支持,它可以採用以下方法:

        if (partition_start + total_sectors_in_partition) exceeds the
        CHS addressing ability(especially when it is greater than
        1024*256*63), the caller should set this byte to 0x0e,
        otherwise, set to 0x90.
                如果(分區的起始地址加上分區的總扇區)超過了CHS 的尋址能力。
           (特別是當它大於1024*256*63),調用程序應當設置此字節爲0x0e,
        否則,要設爲0x90。

        Update: this byte of LBA indicator is ignored. The boot
        record can probe the LBA support of BIOS.
                更新: LBA 指示碼這個字節已被忽略。引導記錄能探測BIOS的LBA支持。

        Update(2006-07-31): Though GRLDR won't use this LBA-indicator
        byte, Windows 98 uses it. Usually this byte should be 0x90 for
        CHS mode(especially for floppies). If this byte is not set
        properly, Windows 98 will not recognize the floppy or
        partition. This problem was reported by neiljoy. Many thanks!
                更新 (2006-07-31):儘管GRLDR不再使用 LBA 指示碼這個字節,但
                Windows 98會使用它。通常這個字節在 CHS 模式中應當設置爲0x90
               (軟盤尤其如此)。如果此字節未被正確設置,Windows 98 將不能識別
                軟盤或分區。這一問題由neiljoy先生報告。非常感謝!

03h    8    OEM name string (of OS which formatted the disk).
                OEM名稱字符串 (對該磁盤進行格式化的操作系統的名稱)

0Bh    2    Bytes per sector. Must be 512.
                每扇區字節數。必須爲512 。

0Dh    1    Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
        and 128. But a cluster size larger than 32K should not occur.
                每簇的扇區數。有效值是1, 2, 4, 8, 16, 32, 64 和 128 。
                但是簇大小大於32K的情況不應發生。

0Eh    2    (Reserved sectors)Unused.
               (保留的扇區數)未被使用。

10h    1    (Number of FATs)Must be 0.
               (文件分配表數)必須爲 0 。

11h    2    (Maximum number of root directory entries)Must be 0.
               (根目錄項的最大個數)必須爲0 。

13h    2    (Total number of sectors for small disks only)Must be 0.
               (僅用於小磁盤的扇區總數)必須爲0 。

15h    1    Media descriptor byte, pretty meaningless now (see below).
                媒體描述符字節,現在該此節已經沒有太大意義了(參見後面)。

16h    2    (Sectors per FAT)Must be 0.
               (每個文件分配表的扇區數)必須爲0 。

18h    2    Sectors per track.
                每個磁道的扇區數。

1Ah    2    Total number of heads/sides.
                磁頭/面的總數。

1Ch    4    Number of hidden sectors (those preceding the boot sector).
                隱藏扇區數(它們位於引導扇區之前)。

        Also referred to as the starting sector of the partition.
                也被稱作是分區的起始扇區。

        For floppies, it should be 0.
                對於軟盤,它應當爲0 。

20h    4    (Total number of sectors for large disks)Must be 0.
               (大磁盤的扇區總數)必須爲 0 。

24h    4    (FAT32 sectors per FAT) - Usually 80 00 80 00, A value of
        80 00 00 00 has been seen on a USB thumb drive which is
        formatted with NTFS under Windows XP. Note this is removable
        media and is not partitioned, the drive as a whole is NTFS
        formatted.
               (每個文件分配表的 FAT32 扇區數)- 通常是 80 00 80 00 ,值
                爲80 00 00 00將被看作是由Windows XP格式化爲NTFS的USB拇指碟

28h    8    Number of sectors in the volume.
                此卷的扇區號。

30h    8    LCN of VCN 0 of the $MFT.
                $MFT的邏輯簇號。

38h    8    LCN of VCN 0 of the $MFTMirr.
                $MFTMirr的邏輯簇號。

40h    4    Clusters per MFT Record.
                每個MFT記錄的簇數。

44h    4    Clusters per Index Record.
                每個索引的簇數。

48h    8    Volume serial number.
                卷序列號

50h    4    Checksum, usually 0.
                校驗和,通常爲 0 。

54h    1    opcode for "cli".
                指令 “cli”。

55h    1    opcode for "cld".
                指令 “cld”。

56h    1    opcode for "mov dh, imm8".
                指令 “mov dh, imm8”。

57h    1    Partition number of this partition on the boot drive.
                此分區在啓動驅動器上的分區號。

        0, 1, 2, 3 are primary partitions.
        4, 5, 6, ... are logical partitions in the extended partition.
                0, 1, 2, 3 是主分區。4, 5, 6, ...等等是擴展分區中的邏輯分區。

        0xff is for whole drive. So for floppies, it should be 0xff.
                0xff 代表整個磁盤。所以對於軟盤,其分區號碼應當是0xff 。

58h    420    The rest of the machine code in the first sector.
                機器碼部分。

1FCh    4    Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)
                引導簽名AA550000h 。(Win9x 使用4字節作爲魔數值。)

200h    1536    The rest of the machine code in the last 3 sectors.
                末尾 3 個扇區爲機器碼部分。

------------------------------------------------------------------------------

附錄A:FAT32 的文件系統信息扇區(不用於引導grldr)

Offset    Length    Description
偏移    長度    說明
======    ======    ==============================================================
0h    4    Leading Signature 41615252h.
                起始處簽名 41615252h 。

4h    480    Reserved, set to 0.
                被保留,設爲 0 。

1E4h    4    FSI structure signature 61417272h.
                故障徵兆指數結構簽名 61417272h 

1E8h    4    Contains the last known count of free clusters, if this is
        equal to FFFFFFFFh, then the count is unknown.
                最後已知的空閒簇數,如果它等於FFFFFFFFh,簇數是未知的。

1ECh    4    Cluster number at which you should begin a search for a free
        cluster, if this is equal to FFFFFFFFh then the field has not
        been set.
                假如它等於FFFFFFFFh的話,你應當去尋找一個空閒簇的簇號碼 。
        此字段沒有被設置。

1F0h    12    Reserved, set to 0.
                被保留,設爲 0 。

1FCh    4    Trailing Signature AA550000h.
                結尾簽名AA550000h 。

------------------------------------------------------------------------------

Appendix B: Media Descriptor Byte(not used by grldr)
附錄B:媒體描述字節(非用於grldr)

The Media descriptor byte is meaningless because of the duplications, F0h for
example.
此媒體描述字節沒有意義,因爲有些字節具有多重意義,例如 F0h 。

Byte    Type of disk    Sectors    Heads    Tracks    Capacity
字節    磁盤種類        扇區    頭      磁道    容量
----    ------------    -------    -----    ------    --------
FFh    5 1/4"        8    2    40    320KB
FEh    5 1/4"        8    1    40    160KB
FDh    5 1/4"        9    2    40    360KB
FCh    5 1/4"        9    1    40    180KB
FBh    both        9    2    80    640KB
FAh    both        9    1    80    320KB
F9h    5 1/4"        15    2    80    1200KB
F9h    3 1/2"        9    2    80    720KB
F0h    3 1/2"        18     2    80    1440KB
F0h    3 1/2"        36     2    80    2880KB
F8h    hard disk    NA    NA    NA    NA
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章