home *** CD-ROM | disk | FTP | other *** search
- ======================================
- DOS & Don'ts -- Part 35
-
- by James Gregory Weiler
- ======================================
-
- Part D: The Directory
- ======================================
-
- The directory contains the name
-
- and address of every file on each
-
- disk.
-
- The first two bytes of the BAM
-
- block point to the directory. The
-
- directory normally resides at track 18
-
- blocks 1 through 18. However, after
-
- that, the blocks are not laid out on
-
- the disk in order. Each is offset
-
- from the previous block by at least
-
- three intervening blocks. Commodore
-
- does that to speed up directory I/O.
-
- If your 1541 had to access block 1,
-
- block 2, block 3, etc, in order, it
-
- would take more than twice as long as
-
- it does to read a directory. Changing
-
- the order of sectors in order to speed
-
- up reading is known as interleaving or
-
- skewing. The 1541 skews disk files
-
- the same way it skews the directory.
-
- Because everything except the BAM
-
- can be stored on the disk higgledy-
-
- piggledy, 1541 DOS needs some way to
-
- find its way around. DOS uses LINKS
-
- to navigate.
-
- The first two bytes of each
-
- directory block link it to the next
-
- directory block. Block 1 is linked to
-
- block 4, block 4 to block 7, etc.
-
- Look at map 3 to see the order in
-
- which the blocks are linked. The last
-
- directory block with file names in it
-
- links nowhere (track 0, block 255).
-
- ======================================
-
- Map 3: Typical directory track.
-
- description address/linked to
- --------------------------------------
- BAM: 18,00 / 18,01
- directory block 1 18,01 / 18,04
- directory block 2 18,04 / 18,07
- directory block 3 18,07 / 18,10
- directory block 4 18,10 / 18,13
- directory block 5 18,13 / 18,16
- directory block 6 18,16 / 18,02
- directory block 7 18,02 / 18,05
- directory block 8 18,05 / 18,08
- directory block 9 18,08 / 18,11
- directory block 10 18,11 / 18,14
- directory block 11 18,14 / 18,17
- directory block 12 18,17 / 18,03
- directory block 13 18,03 / 18,06
- directory block 14 18,06 / 18,09
- directory block 15 18,09 / 18,12
- directory block 16 18,12 / 18,15
- directory block 17 18,15 / 18,18
- directory block 18 18,18 / 0,255
-
- =======< continued in Part 36 >=======
-