Atari ST series Technical Reference Manual page 123

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

tains a pointer to the first file cluster. When you look up the
FAT entry for that first cluster, you get a pointer to the next
cluster. The FAT entry for that cluster contains a pointer to
the next one, and so on until you get to a FAT entry that ■
contains a last-cluster marker.
FAT entries come in two sizes. Floppy disks use FAT en­
tries that are 12-bits in length, while hard disks use 16-bit en­
tries. You can tell which kind of FAT entries are used for a
particular disk by looking at the bflag byte of the BIOS Pa­
rameter Block (see the discussion of the Getbpb() function in
Chapter 2). The meaning of each type of FAT entry is shown
in Table 6-3.
Table 6-3. Meaning of FAT Entries
12-Bit Value
16rBit Value
$000
$0000
$001
$0001
$002-$FEF
$0002-$7FFF
$8000-$FFEF
$FF0-$FF7
$FFF0-$FFF7
$FF8-$FFF
$FFF8-$FFFF
To convert cluster numbers to logical sector numbers,
subtract 2 and multiply by the number of sectors per cluster
(2). Thus, if the directory entry for the first file shows that it
starts at cluster 4, it tells you that the first data block for that
file starts at sector 4 of the data area (which starts with the
first sector of track 2). To find the next data block for the file,
look up the FAT entry for cluster 4, which gives you the
cluster number for that block. When you get a FAT entry of
$FF8 ($FFF8 for 16-bit FATs), you know you've reached the
last block of the file.
The FAT is an absolutely critical part of the disk. If the
sectors containing the FAT become unreadable, the file sys­
tem will not be able to follow the directory chain, and will
not be able to read the files on the disk. As a security mea­
sure, two FAT areas are maintained simultaneously, so if one
becomes unreadable, the other may be used to find the files.
Data Area
The last logical division of the disk is called the data area or
files area. The sectors in this area of the disk are viewed as
clusters of two sectors each. As a file is created (or ex­
GEMDOS File System Functions
Free cluster (unused)
Invalid value
Next cluster number
Invalid value
Bad cluster
End of file
Description
115

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents