I have written a simple bootloader of my own. I, first, have initial typical 3 lines of code
bits 16
org 0x7c00
jmp main
followed by BIOS Parameter Block for FAT 12 and for 1.44MB Floppy disk, up to offset byte 0x003D. Let’s say the main bootloader is printing “Hello World” for simplicity.
When I copy my bootloader using
PARTCOPY 0 200 -f0 0
it makes my disk to lose its format, triggering “Disk not formatted” message on Windows.
On the other hand, if I copy my bootloader using
PARTCOPY 0 3 -f0 0
PARTCOPY 3E 1C2 -f0 3E ; Do not copy BIOS Parameter Block
Windows does not complain about the formatting.
With these different results, I would like to know how BPB affects the formatting and/or Partition Table. I mentioned Partition Table, because I got an advice that I need to have the Partition Table to resolve the “Disk not formatted” problem after copying the boot sector.
Any help or comment would be appreciated.
Sincerely,
Windows performs a number of checks on boot sectors and is a little too picky in what it considers a valid boot sector. If you preserve the first 62 (0x3E) bytes of a FAT12 formatted floppy and don’t corrupt the FAT, Windows won’t complain. It doesn’t care about what’s in bytes at offsets 0x3E through 0x1FD. You can change the
OEM nameandvolume label nameentries too. The rest, just keep it as-is. Your code may use the values in the BPB to read a file from the FAT.