Page 1 of 1

BIOS MBR sector dumper

Posted: Tue Jan 06, 2026 11:01 am
by Demindiro
Hello

I've made a very simple program which does nothing but print out 512 bytes starting from 0x7c00, i.e. the MBR on boot.
This is because I encountered very strange behavior when trying to get my OS running on real HW.

The source can be found here: https://codeberg.org/Demindiro/bios-mbr-dump (or Github: https://github.com/Demindiro/bios-mbr-dump)

Here are examples (note: nibbles are swapped in the pictures. Fixed in latest version):
2026-01-06-173321_699x415_scrot.png
2026-01-06-173321_699x415_scrot.png (6.08 KiB) Viewed 16462 times
ga-ax370m-gaming-3.jpg
Note the differences :evil:

If other people could run it on real HW I'd appreciate it. I wonder how many BIOSes are broken like this.

Re: BIOS MBR sector dumper

Posted: Tue Jan 06, 2026 11:44 am
by Octocontrabass
When booting from a USB flash drive, most BIOSes examine the contents of LBA 0 to decide whether INT 0x13 should emulate a hard drive or a floppy drive (or boot in the first place). When emulating a floppy drive, some BIOSes will try to correct mistakes in the BPB after loading LBA 0, presumably to work around issues caused by software that doesn't fill out the BPB correctly when making a bootable USB flash drive.

Your MBR doesn't have a valid partition table, so your PC's BIOS gives you the floppy drive treatment, including "corrections" to your nonexistent BPB.

Re: BIOS MBR sector dumper

Posted: Tue Jan 06, 2026 5:19 pm
by BenLunt
Demindiro, may I point you to a conversation once had a while back about this exact issue. Hopefully it will explain a bit more.