Octocontrabass wrote:doing the same with offset 0xF (heads) caused it to hang during POST.
Sounds to me like a BIOS bug. I don't think it worth the effort to support that particular buggy BIOS.
Octocontrabass wrote:bzt wrote:First, you say that Dell BIOS checks for the BPB, then you say it doesn't. Which one is it then?
Where did I say it doesn't?
Here:
Octocontrabass wrote:(This only happens with unpartitioned drives, of course.)
That's why I asked how does the BIOS know if the disk is unpartitioned?
Octocontrabass wrote:bzt wrote:How does the BIOS know if the disk is unpartitioned (talking about non-GPT)?
Second, how do you distinguish an MBR from a VBR?
That depends on the firmware. Some will look for a valid BPB, and if they don't find one, they assume the disk is partitioned.
Hold on right there. You said BPB is only checked if the disk is unpartitioned, therefore you cannot use the BPB check to determine if the disk is partitioned.
Octocontrabass wrote:Some will look for a valid partition table
But how? Can you explain how to detect for an MBR partitioning table existence? (Other than it is in the first sector).
I mean, can you give an implementation for this?
Code: Select all
/* return 1 if there's a partitioning table included, 0 otherwise */
int hasPartitioningTable(char sector[512])
{
/* I'm curious about this part */
}
But take a step back, why is there a need for any BIOS to know if there's a partition on the disk? According to the BIOS Boot Specification, the BIOS just loads the first sector, it doesn't care nor need to know if there are partitions or not. Any BIOS which does, is not BBS compliant and should be considered buggy and faulty.
Octocontrabass wrote:Some will look for both a valid BPB and a valid partition table, and if they find neither, they refuse to boot the disk. Of course, there is no standard for what counts as "valid".
As I've said before it simply does not worth the effort to support such buggy BIOSes which violate the BBS specification. They are extremely rare, and now with UEFI taking over on real machines and BIOS soon will be exclusive to VMs it simply doesn't matter any more. (Plus this only happens if you choose "floppy emulation for USB" in the BIOS setup, so the solution on your Dell is just to uncheck that option. Sometimes called "use HDD emulation for USB" with reverse flag, but that's the same.)
The best and simplest solution is:
1. start your sector with a jump instruction (E8h or E9h)
2. finish it with 55h AAh magic
3. leave both the BPB and partitioning table area empty (leave it to be filled up by another tool, like fdisk or mkfs.vfat for example)
4. play with your BIOS setup, there'll be a configuration which does not check for BPB nor partitions
My boot loader does this, and it works as MBR, VBR and even as CDROM "no emulation" boot record too, and nobody ever complained about any BIOS refusing to boot it on real hardware, regardless to the configuration. It Just Works (tm)
BTW, if you still have that old Dell, I would appreciate if you could give a try to boot BOOTBOOT on it and see if it works.
Cheers,
bzt