This document describes the format of D format free space maps.
Sector 0:
Name Bytes FreeStart 82*3 Table of free space start sectors Reserved 1 Reserved OldName0 5 1st half of disc name OldSize 3 Disc size in (256 byte) sectors Check0 1 CheckSum on sector 0
Sector 1:
Name Bytes FreeLen 82*3 Table of free space lengths OldName1 5 Second half of disc name OldId 2 Disc id OldBoot 1 boot option FreeEnd 1 Pointer to end of free space list Check1 1 Checksum on sector 1
The 82 three byte entries in the FreeStart and FreeLen tables are in units of 256 bytes. The entries are sorted low addressed free areas first. Contiguous free areas will have been merged together.
The full disc name is the joining together of the bytes in OldName0 and OldName1. OldName0 comes before OldName1 in the name.
OldId is the disc's Id to identify when the disc has been modified.
Calculating Check0 and Check1:
These are checksums of the previous bytes in the map. They are calculated
using repeated 8-bit ADCSs on the bytes if the relevant map block, starting
with a value 0:
If r0 is the accumulated checksum, then it starts at 0, and each byte is
added as follows:
ADC r0, r0, r1 ; r1 is the byte picked up MOVS r0, r0, LSL #24 ; Shifts bit 8 into the carry bit MOV r0, r0, LSR #24 ; Not MOVS here to preserve the carry bitNote that the check byte itself isn't included in the checksum, its value equals the checksum of the previous bytes.