MichaelPetch wrote:
Some BIOSes do. We've seen it on posts on this forum the last couple of years, and one of the remedies is to create a self referencing partition table in an MBR that points back to itself so that the MBR is also its own VBR (so it contains not only a partition table, but a BPB). That's if you want it to appear more like unpartitioned media. The same phenomenon has also been observed in a StackOverflow question as well. Some BIOSes booting as USB HDD media are known to read the partition table for an entry marked active and then automatically load the VBR from that partition completely bypassing the code in the MBR. These BIOSes often consider media unbootable if there is no partition table with an active entry. I've written a Stackoverflow answer about this and we've had a discussion on the OS Dev Wiki and in that case it was a Toshiba Pro NB10-A that seems to exhibit this behaviour.
It is also amazing that to this day there are also people who refuse to believe (I'm not suggesting BZT, but I know some others) that some BIOSes blindly copy drive geometry into an boot sector that has been loaded into memory before control is transferred to it, yet there is an ever growing list of machines with BIOSes that do just that.
There is what a spec may say, and then there is what BIOS manufacturers are actually doing.
Hah, interesting. Thanks for the example.
Those BIOSes are definitely broken. It should be nothing more than reading the first sector, check the 55AA magic and transfer control to it. That's all. Doing anything more is really bad, because:
1) the partitioning table format is OS specificThere's a good reason why
the code in the first sector parses the table and not the firmware. Other OSes may use different table formats, like BSD labels, Solaris slices or Minix partitions for example. That's why
the Linux kernel has code for so many variants (and that's why "the standard" MBR partitioning table implemented in a file named msdos.c.)
2) the BPB is strictly part of the FAT, other filesystems usually don't have itWhich means those buggy BIOSes will overwrite valuable code or data in the boot sector, and therefore can only boot from FAT, although we all know that other file systems exists and should boot just fine (and they do with non-buggy BIOSes).
3) there's no way to tell MBR and VBR apart, as they both share the same magicThere's no guarantee that bootable flags are really bootable flags, could be just a mere coincidence. There's nothing to clearly identify an MS-DOS partitioning table. Other partition formats and VBR records could have 80 and 00 bytes accidentally at those offsets, which those buggy BIOSes would then interpret as a partitioning table incorrectly.
4) the first sector can either have a partitioning table or a BPB, and regardless the BIOS should be able to boot from itNeedless to say it should. And just for the records, the
bochs BIOS, which does comply with the BBS standard, does. Note that "case IPL_TYPE_FLOPPY:" and "case IPL_TYPE_HARDDISK:" shares the same code path to boot the OS.
The question is, how common those broken BIOSes are. Frankly I've never met one in the last 30 years, and believe me, I've seen a few computers. Say if there's 1 in 10000 that's broken, does it really worth it for a hobby OS developer to make a workaround for that special case?
Cheers,
bzt