Technical information

© Jean Louis-Guérin V1.2a September 2014 Page 66 / 69
The same MBR is interpreted differently by the HDDRIVER on the Atari platform:
The content of the MBR is ignored until 0x01DE and from this point the MBR is interpreted as TOS
partition
The first entry is at location 0x01DE:
The first byte at location 0x01DE is interpreted as the state of the partition and is set to 0x01 for
a non-bootable partition and to 0x81 for a bootable partition.
The next three bytes contains the ID: GEM for partition < 32MB and BGM for partition 32 MB
The next 4 bytes indicate the location of the partition
The next 4 bytes indicate the size of the partition.
The second entry is at location 0x01EA:
The first byte at location 0x01DE is the state and is set to 0x01
The next three bytes contains the ID: should be XGM
The next 4 bytes indicate the location of the next partition
The next 4 bytes indicate the size of the next partition.
Here is an example:
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
000001B0 00 00 00 00 00 00 00 00 00 00 00 00 21 B0 00 01 !°
000001C0 01 00 06 3B 3F FD 3F 00 00 00 39 A6 0E 00 00 00 ;?ý? 9¦
000001D0 01 FE 05 3B FF F6 78 A6 0E 00 A4 E4 2B 00 81 42 þ ;ÿöx¦ ¤ä+ B
000001E0 47 4D 00 00 00 40 00 0E A6 38 01 58 47 4D 00 0E GM @ ¦8 XGM
000001F0 A6 78 00 2B E4 A4 00 00 00 00 00 00 00 00 55 AA ¦x +ä¤ Uª
Beyond what we just explained about the interpretation of the MBR by DOS and HDDRIVER we can
also see several particularities in the above example:
The position of the partition as interpreted by DOS is given at location 0x01C6 and is equal to
63 (0x3F in little-endian format). The size is given at location 0x01CA and is equal to 96057
(0x0EA639) sectors.
The position of the partition as interpreted by HDDRIVER is given at location 0x01E0 and is
equal to 64 (0x40 in big-endian format). The size is given at location 0x1E6 and is equal to
96056 (0x0EA638) or sectors (one less sector).
If we remember that the first logical record of a partition is the Boot Sector, we can see that DOS will
see the Boot Sector at position 63 and TOS will see the Boot Sector at position 64. We will see later
that these two boot sector point to the same FAT, Root Directory and data.
The technique used by HDDRIVER has few problems in term of compatibilities with DOS/FAT:
The MBR does not follow the standard DOS rules: in the third and fourth entries there are some
values used by HDDRIVER instead of null bytes. Windows and other DOS utilities do not like to
see invalid values in null partition entries. Therefore in the best case they offer to fix it and in
worst case they fix it silently rendering the partition unusable by HDDRIVER.
Therefore watch out for these problems when using HDDRIVER TOS&DOS partition. Note that this
is further exacerbated with Windows 7 & 8.