[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

1070.0. "The FAT & DMA Loaders" by SIEVAX::JAMIE (Having wrubble with your turds ?) Thu Feb 14 1991 12:51

    On the topic of disk drives;
    
    Could anyone explain the structure of the FAT ? How you determine the
    size of the FAT based on the format of the disk ? How you can figure
    out what sectors go together in what order to make up a file ?
    
    Also, is anyone familiar with "DMA loaders" ?
    
    I've got some info about all this but it's a little confusing. If
    anyone's interested I'll enter what I've got (it's in electronic
    format) into this note.
    
    
    Cheers,
    
    
    				Jamie.
T.RTitleUserPersonal
Name
DateLines
1070.1File Access Table maps current cluster to next clusterPRNSYS::LOMICKAJJeffrey A. LomickaThu Feb 14 1991 16:5333
The "FAT" is the same as MSDOS disks.  You can find the details in any
good technical book on MSDOS internals, such as Microsoft's "Advanced
MSDOS".

As an overview:

	- Block 0 of the disks contains a table of the disks parameters,
	including the size of each FAT, and the number of FAT tables,
	and the block address of the root directory, which always
	follows the FAT.

	- A "cluster" is the allocation unit that is managed in the FAT.
	 The table in block 0 indicates the number of blocks (sectors)
	in a cluster, but for some reason it is always 2.  Therefore,
	cluster 2 is sector 4, cluster 3 is sector 6, etc.

	- A file's entry in a directory contains the cluster number of the
	first block.

	- The File Access Table (FAT) is a table which when indexed
	by a cluster number, and returns the cluster number of the next
	cluster in the file.  Special values are used to indicate free
	clusters, bad blocks, and end-of-file clusters.

	- A "folder" or subdirectory is indicated as a flag in a the
	directory entry, and the starting cluster is the first
	cluster of the directory.  The size of subdirectories is managed
	entirely with the FAT table, so the indicated size is always 0.

I have written code that implements a crude but usable MSDOS file
system, so I can answer questions on it.  (It's crude only because it
doesn't implement any file locking, or protections against programs
crashing with files open, or other similar protections.)
1070.2SIEVAX::JAMIEHaving wrubble with your turds ?Fri Feb 15 1991 14:1211
    Thanks! I hadn't thought of that; I've got a nice thick wadge of
    photocopies now!
    
    In your delving, did you happen to use the WD1772A through the DMA at
    all ?
    
    
    Cheers,
    
    
    				Jamie.
1070.3PRNSYS::LOMICKAJJeffrey A. LomickaSun Feb 17 1991 17:391
Not, I did everything with RWABS and flopfmt().