Thursday, August 27, 2009

DOS USB Floppy Boot

On my computer:

Write a 1,474,560 bytes bootable floppy image file to a USB disk sector by sector, beginning at sector 0.

The floppy content is visible in Windows.

Boot.

The computer hangs.

Make a copy of the image file, as example to the file dft.bin.

Do in a command box:

edit /64 dft.bin

Press insert to change to replace mode. Go to to line 1 col 27. The character will be ASCII 2.

Press space, which will change the ASCII value to 32.

Save the image file, and write it to the USB disk after verifying that the file size is still 1,474,560 bytes.

Boot, and use BIOS to select boot from USB.

It works.

Byte number 27 (offset 26) is the low byte of the FAT12 boot sector heads field. The BIOS on my computer will read the boot sector, and report the disk geometry using the heads and sectors values from the boot sector. Obviously for some reason, the BIOS will fail if the heads value is 2.

As long as the floppy content is not hard coded to assume a usual 2 heads, 18 sectors geometry, this method should work.

No comments:

Post a Comment