How does DOS 3.3 remember which sectors are used to store a file?
Every file has a set of one or more Track/Sector List sectors. A Track/Sector List (T/S List) lists sectors (by Track and Sector number) which make up the file. Each T/S List sector points to up to 122 data sectors If the file is too long for one T/S List sector, a second one is allocated, and a pointer to it is stored in the first one, and so on. Note that DOS 3.3 supports “sparse” files…there may 0/0 pairs in the T/S List indicating parts of the file that were never written. When DOS 3.3 is reading a file and encounters a 0/0 pair in the T/S List, it passes a buffer full of binary zeros back to the calling program. A Track/Sector List sector looks like this: Byte Meaning —- ——- $00 Unused $01-02 Track/Sector location of next T/S List sector (00 for Track means the list uses no more sectors since Track 0 can not be used) $03-04 Unused $05-06 Sector number in file (offset) of first sector represented in this T/S List sector (starting at byte $0C below). Ex: 00 00 = file sector