When a USB flash drive is formatted as USB-HDD, when booting, the mainboard generally recognizes it as a hard disk and assigns drive letter C. But some mainboards will recognize it as a floppy disk and assign drive letter A. Both situations can boot normally.
We know that the 0-0-1 (or logical sector 0) of a hard disk is the Master Boot Record (MBR), which contains the partition table. There are 3F sectors (number of hidden sectors) apart, that is, 0-1-1 (or logical sector 3F) is the Boot Sector (DBR), which contains BPB parameters. When booting a hard disk, the Master Boot Record is loaded first, and then the Boot Sector is loaded by the Master Boot Record. When the boot program looks for the boot file (io.sys, ntldr or grldr, etc.), it needs to calculate the starting positions (CHS or LBA) of the sectors of the File Allocation Table, Directory Area, and Data Area. At this time, the parameter of the number of hidden sectors (3F) is used. When performing the read operation int13/02 (or 42), the physical drive number 80 of the disk is assigned to dl.
And the 0-0-1 (or logical sector 0) of a floppy disk is the Boot Sector (DBR), which contains BPB parameters. When booting a floppy disk, the Boot Sector is directly loaded. When the boot program looks for the boot file (io.sys, ntldr or grldr, etc.), it also needs to calculate the starting positions (CHS or LBA) of the sectors of the File Allocation Table, Directory Area, and Data Area. At this time, the parameter of the number of hidden sectors (00) is used. When performing the read operation int13/02 (or 42), the physical drive number 00 of the disk is assigned to dl.
This gives rise to a question. For a USB flash drive formatted as USB-HDD, the physical drive number of the disk in its BPB parameters is 80 (at offset 7C24), and the number of hidden sectors is 00 00 00 3F (at offset 7C1C). At this time, it can be understood that it boots normally as a hard disk. But when booting as a floppy disk, the 00 that should be assigned to dl becomes 80, and the number of hidden sectors 00 becomes 3F. How can it correctly find the boot file?
In order to explore this mystery, a section of test code was compiled. After detection, it was found:
1. After booting, the Boot Sector is first loaded to 7C00, which is 0-0-1 (logical sector 0), and the Master Boot Record is not visible.
2. Modify 7C24 to 00 (physical drive number of the disk), and modify 7C1C to 00 00 00 00 (number of hidden sectors). (Modify memory, not the USB flash drive!)
3. Then execute the boot code from the 7C00 place. It turns out that the mainboard modifies the BPB parameters, so it can correctly find the boot file and boot successfully.
In addition, it was detected that when the BIOS loads 0-0-1 (for a hard disk it is the Master Boot Record, for a floppy disk it is the Boot Sector), the parameter substituted for dl is the physical drive number of the disk. When the USB flash drive is recognized as a hard disk, DX=0080, and when it is recognized as a floppy disk, DX=0000.
When the BIOS loads 0-1-1 (when the USB flash drive is recognized as a hard disk), DX=0180.
The advantage of a USB flash drive formatted as USB-HDD and recognized as a floppy disk by the mainboard is that it does not occupy drive letter C, which is beneficial for installing the operating system. Reminder: If the USB flash drive is divided into 2 partitions, the other partition will be assigned drive letter C!
When a USB flash drive formatted as USB-HDD is recognized as a floppy disk by the mainboard, using bootlace.com to install grub4dos cannot boot normally when recognized as a hard disk. It is necessary to modify the boot sector:
1. Open the disk with WinHex;
2. Change 00 at 7E1C to 3F, change 00 at 7E24 to 80, and change 89 at 7E54 to 8B.
3. Modify grldr, and delete all '--ignore-floppies ' in the menu at the end of the file.
Or install grub4dos with bootlace.com on a computer where it is recognized as a hard disk by the mainboard.
[ Last edited by yaya on 2008-9-12 at 04:10 PM ]
We know that the 0-0-1 (or logical sector 0) of a hard disk is the Master Boot Record (MBR), which contains the partition table. There are 3F sectors (number of hidden sectors) apart, that is, 0-1-1 (or logical sector 3F) is the Boot Sector (DBR), which contains BPB parameters. When booting a hard disk, the Master Boot Record is loaded first, and then the Boot Sector is loaded by the Master Boot Record. When the boot program looks for the boot file (io.sys, ntldr or grldr, etc.), it needs to calculate the starting positions (CHS or LBA) of the sectors of the File Allocation Table, Directory Area, and Data Area. At this time, the parameter of the number of hidden sectors (3F) is used. When performing the read operation int13/02 (or 42), the physical drive number 80 of the disk is assigned to dl.
And the 0-0-1 (or logical sector 0) of a floppy disk is the Boot Sector (DBR), which contains BPB parameters. When booting a floppy disk, the Boot Sector is directly loaded. When the boot program looks for the boot file (io.sys, ntldr or grldr, etc.), it also needs to calculate the starting positions (CHS or LBA) of the sectors of the File Allocation Table, Directory Area, and Data Area. At this time, the parameter of the number of hidden sectors (00) is used. When performing the read operation int13/02 (or 42), the physical drive number 00 of the disk is assigned to dl.
This gives rise to a question. For a USB flash drive formatted as USB-HDD, the physical drive number of the disk in its BPB parameters is 80 (at offset 7C24), and the number of hidden sectors is 00 00 00 3F (at offset 7C1C). At this time, it can be understood that it boots normally as a hard disk. But when booting as a floppy disk, the 00 that should be assigned to dl becomes 80, and the number of hidden sectors 00 becomes 3F. How can it correctly find the boot file?
In order to explore this mystery, a section of test code was compiled. After detection, it was found:
1. After booting, the Boot Sector is first loaded to 7C00, which is 0-0-1 (logical sector 0), and the Master Boot Record is not visible.
2. Modify 7C24 to 00 (physical drive number of the disk), and modify 7C1C to 00 00 00 00 (number of hidden sectors). (Modify memory, not the USB flash drive!)
3. Then execute the boot code from the 7C00 place. It turns out that the mainboard modifies the BPB parameters, so it can correctly find the boot file and boot successfully.
In addition, it was detected that when the BIOS loads 0-0-1 (for a hard disk it is the Master Boot Record, for a floppy disk it is the Boot Sector), the parameter substituted for dl is the physical drive number of the disk. When the USB flash drive is recognized as a hard disk, DX=0080, and when it is recognized as a floppy disk, DX=0000.
When the BIOS loads 0-1-1 (when the USB flash drive is recognized as a hard disk), DX=0180.
The advantage of a USB flash drive formatted as USB-HDD and recognized as a floppy disk by the mainboard is that it does not occupy drive letter C, which is beneficial for installing the operating system. Reminder: If the USB flash drive is divided into 2 partitions, the other partition will be assigned drive letter C!
When a USB flash drive formatted as USB-HDD is recognized as a floppy disk by the mainboard, using bootlace.com to install grub4dos cannot boot normally when recognized as a hard disk. It is necessary to modify the boot sector:
1. Open the disk with WinHex;
2. Change 00 at 7E1C to 3F, change 00 at 7E24 to 80, and change 89 at 7E54 to 8B.
3. Modify grldr, and delete all '--ignore-floppies ' in the menu at the end of the file.
Or install grub4dos with bootlace.com on a computer where it is recognized as a hard disk by the mainboard.
[ Last edited by yaya on 2008-9-12 at 04:10 PM ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| fujianabc | +3 | 2008-09-12 10:23 |
