Showing changes from revision #0 to #1:
Added | Removed | Changed
A disc has a section of information defined as a Map. It controls the allocation of the disc to the files and directories.
Old Maps have the following format:
Name | Bytes | Meaning |
---|---|---|
FreeStart | 82 × 3 | Table of space start sectors |
Reserved | 1 | Reserved (must be zero) |
OldName0 | 5 | Half disc name (interleaved with OldName1) |
OldSize | 3 | Disc size in 256 byte sectors |
Check0 | 1 | Checksum on first 256 bytes |
FreeLen | 82 × 3 | Table of free space lengths |
OldName1 | 5 | Half disc name (interleaved with OldName0) |
OldId | 2 | Disc id |
OldBoot | 1 | Boot option (as in *Opt 4,n) |
FreeEnd | 1 | Pointer to end of free space list |
Check1 | 1 | Checksum on second 256 bytes |
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. The name is interleaved, with OldName0 providing the first character, OldName1 the second, and so on.
OldId is the disc’s Id to identify when the disc has been modified.
If an old map does not end at a sector boundary, then it is padded with null bytes to the end of the sector. The sector immediately following the old map always holds the start of the root directory.
These are checksums for the previous bytes in the map. They are calculated using repeated 8-bit ADC’s on bytes of the relevant map block, starting with a value of 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 bit
Note that the check byte itself isn’t included in the checksum; its value equals the checksum of the previous bytes.