
"Heiko Schocher" hs@denx.de wrote in message news:1182164674.15090.54.camel@Apollo...
I am not sure if we can use EB:xx:90 or E9:xx:xx (Am I right, this is the "Jump instruction to boot code" on a PBR?) for deciding between a MBR and a VBR, because the First 446 Bytes from a MBR are only "Bootcode", whatever this means, and maybe there is a MBR with EB:xx:90 or E9:xx:xx in the First 3 Bytes ...
Correct, the Microsoft document says the beginning of a VBR will always be "a 3-byte intel x86 unconditional branch (jump) instruction that jumps to the start of the operating system bootstrap code". It says either form is acceptable but 0xEB is used more frequently.
None of the common MBRs start with a jump (http://mirror.href.com/thestarman/asm/mbr/), so it seems like a pretty decent heuristic.
Linux-2.6.20 in fs/partitions/msdos.c has a function msdos_partition() that checks for the 0xAA55 signature and a 0x80 active or 0x00 inactive boot indicator for each partition in the table. I'm not sure if that technique is any better or worse.
-joey