Hi,
Stamerlan wrote:That's what I get for rushing - I got the offsets right, but calculated from 0x7C00, not the start of the "." filled area. Disregard my previous post, refer to this one instead.
Here are the offending bytes:
...
0x7C1C: 0x00
0x7C1D: 0x00
0x7C1E: 0x00
0x7C1F: 0x00
...
0x7C24: 0x00
...
0x7C24 - BYTE Physical drive number - for hard disks it should be 0x80+
0x7C20 - DWORD Large total logical sectors - it shouldn't be 0.
I don't think it's BPB and I can find any docs about using this area
I have the opposite problem - there's so many different versions of the BPB that it's hard to figure out which one the firmware might think it's using.
For one "nice" example, there's an interesting note on
Wikipedia for "DOS 3.31 BPB" offset 0x01C that says:
Wikipedia wrote:Count of hidden sectors preceding the partition that contains this FAT volume. This field should always be zero on media that are not partitioned.[5][6][7] This DOS 3.31 entry is incompatible with a similar entry at offset 0x01C in DOS 3.0-3.3 BPBs. At least, it can be trusted if it holds zero, or if the logical sectors entry at offset 0x013 is zero.
If this belongs to an Advanced Active Partition (AAP) selected at boot time, the BPB entry will be dynamically updated by the enhanced MBR to reflect the "relative sectors" value in the partition table, stored at offset 0x1B6 in the AAP or NEWLDR MBR, so that it becomes possible to boot the operating system from EBRs.
(Some GPT boot loaders (like BootDuet) use boot sector offsets 0x1FA–0x1FD to store the high 4 bytes of a 64-bit hidden sectors value for volumes located outside the first 232-1 sectors.)
On the same page (lower down) in the "Extended BIOS Paramater Block" section, for offset 0x24 it says:
Wikipedia wrote:Physical drive number (0x00 for (first) removable media, 0x80 for (first) fixed disk as per INT 13h). Allowed values for possible physical drives depending on BIOS are 0x00-0x7E and 0x80-0xFE. Values 0x7F and 0xFF are reserved for internal purposes such as remote or ROM boot and should never occur on disk. Some boot loaders such as the MS-DOS/PC DOS boot loader use this value when loading the operating system, others ignore it altogether or use the drive number provided in the DL register by the underlying boot loader (e.g., with many BIOSes and MBRs). The entry is sometimes changed by SYS tools or it can be dynamically fixed up by the prior bootstrap loader in order to force the boot sector code to load the operating system from alternative physical disks than the default.
A similar entry existed (only) in DOS 3.2 to 3.31 boot sectors at sector offset 0x1FD.
If this belongs to a boot volume, the DR-DOS 7.07 enhanced MBR can be configured (see NEWLDR offset 0x014) to dynamically update this EBPB entry to the DL value provided at boot time or the value stored in the partition table. This enables booting off alternative drives, even when the VBR code ignores the DL value.
I think the next step might be to add a "valid looking" BPB or partition table, and see if that's enough to convince firmware to stop trashing your data.
Cheers,
Brendan