Where to store the bootloader on a floppy disk?

I am going to write and test the bootloader. To do this, I plan to copy the bootloader to a floppy disk image file and mount it in a virtual machine.

However, I do not know where to put the loader machine code. Does it just flush to the first few bytes of the file?

+4
source share
2 answers

The boot sector of a floppy disk was the first sector. If you're talking about a raw floppy disk (1440K), this should be the first 512 bytes of the image file.

From memory, this is loaded by the BIOS at 7c00: 0000 (real mode), and then goes to that address.

DOS boot floppies had a 3-byte JMP command to jump over the disk parameter block (DPB), which details disk attributes. But if you have full control of the drive and your boot code, I don’t think you need to follow this convention. I don’t remember any BIOS checking what was loaded for reality (although admittedly, it was a long time ago).

+2
source

it was VERY long time, but if I recall in DOS, it was saved in MBR. I believe that he is still the same today

http://en.wikipedia.org/wiki/Master_boot_record

0
source

All Articles