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
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值