1

I've been playing around modifying the MBR of an old USB stick, booting from it, testing the various BIOS functions, etc...

But I don't seem to understand - What does the BIOS look for when deciding which device to boot from? The obvious 2 requirements are:

  • Changing the BIOS boot order so it tries to boot from the USB when it is connected.
  • Have the MBR singature - 0x55aa at offset 0x1fe.

For some reason, my laptop only boots from the USB for some of the MBRs I wrote, and for others it boots from the main HD, ignoring the USB. Of course all are signed with 0x55aa.

Why does it happen? What else does the BIOS look for?

Jong
  • 9,045
  • 3
  • 34
  • 66

1 Answers1

0

After a valid MBR is found (via the signature you mentioned), the BIOS checks the first byte of each of the MBR's 16-byte partition records. 0x80 means the partition is bootable (or "active"), 0x00 otherwise.

If a bootable partition is found, the code in the first sector of that partition -- the Volume Boot Record -- is loaded. The VBR contains the OS bootstrapping code.

Some implementations may also validate checksums and other flags.

Kevin Richardson
  • 3,592
  • 22
  • 14
  • But as I said, I did boot from other MBRs which have an empty partition table. – Jong Jun 03 '14 at 12:28
  • Your question doesn't mention anything about empty partition tables; it just says that some of your MBRs worked and some didn't. Without looking at the MBRs, it'll be quite difficult for others to identify the problem. – Kevin Richardson Jun 03 '14 at 14:57
  • You're right, my bad for not including them. I'll edit this post later with examples. – Jong Jun 03 '14 at 19:32