Block Availability Map

Directory track 18 sector 0, the BAM and disk details

Track 18 sector 0 contains the Block Availability Map (BAM) and details about the disk including it's title.

Track 18 Sector 0

Byte Content
7 6 5 4 3 2 1 0
00 15 Location of first directory sector 8 Header
01 7 0
02 DOS version type, normally 0x41 "A"
03
04 Free sector count Track 1 Block Availability Map
05 S7 S6 S5 S4 S3 S2 S1 S0
06 S15 S14 S13 S12 S11 S10 S9 S8
07 S20 S19 S18 S17 S16
08 Free sector count Track 2
09 S7 S6 S5 S4 S3 S2 S1 S0
0A S15 S14 S13 S12 S11 S10 S9 S8
0B S20 S19 S18 S17 S16
   
44 Free sector count Track 17
45 S7 S6 S5 S4 S3 S2 S1 S0
46 S15 S14 S13 S12 S11 S10 S9 S8
47 S20 S19 S18 S17 S16
48 Directory Track 18 = 0 Free
49 All allocated so should be set to 0
4A as entire track is reserved for the directory
4B
4C Free sector count Track 19
4D S7 S6 S5 S4 S3 S2 S1 S0
4E S15 S14 S13 S12 S11 S10 S9 S8
4F S18 S17 S16
   
60 Free sector count Track 24
61 S7 S6 S5 S4 S3 S2 S1 S0
62 S15 S14 S13 S12 S11 S10 S9 S8
63 S18 S17 S16
64 Free sector count Track 25
65 S7 S6 S5 S4 S3 S2 S1 S0
66 S15 S14 S13 S12 S11 S10 S9 S8
67 S17 S16
   
78 Free sector count Track 30
79 S7 S6 S5 S4 S3 S2 S1 S0
7A S15 S14 S13 S12 S11 S10 S9 S8
7B S17 S16
7C Free sector count Track 31
7D S7 S6 S5 S4 S3 S2 S1 S0
7E S15 S14 S13 S12 S11 S10 S9 S8
7F S16
   
8C Free sector count Track 35
8D S7 S6 S5 S4 S3 S2 S1 S0
8E S15 S14 S13 S12 S11 S10 S9 S8
8F S16
90 Disk Name padded with 0xA0 Disk title & type
91
92
93
94
95
96
97
98
99
9A
9B
9C
9D
9E
9F
A0 Unused set to 0xA0A0
A1
A2 7 Disk ID 0
A3 15 8
A4 Unused set to 0xA0
A5 DOS type, usually ASCII "2A"
A6
A7 Unused set to 0xA0
A8
A9
AA
AB Unused, set to 0x00 Reserved
 
FF

Offset for each Track BAM entry

Track Offset
0104
0208
030C
0410
0514
0618
071C
0820
0924
1028
112C
1230
1334
1438
153C
1640
1744
1848
194C
2050
2154
2258
235C
2460
2564
2668
276C
2870
2974
3078
317C
3280
3384
3488
358C

How BAM entries work

Each track has a BAM entry, which consists of 4 bytes. The first byte is the number of free sectors on that track.

The next three bytes form a bit map of the available sectors in little endian format. A 1 represents a free sector, whilst a 0 represents an allocated sector.

As there are 24 bits available but tracks range from 16 to 21 sectors then the unavailable sectors are marked as allocated, i.e. 0.