Amiga Old File System: Encyclopedia II - Amiga Old File System - Characteristics
Amiga Old File System - Characteristics
Amiga uses MFM encoding/decoding by default when handling floppy disks. There are 80 cylinders on an Amiga floppy disk. Each cylinder has 2 MFM tracks, 1 on each side of the disk. Double density (DD) disks have 11 sectors per MFM track, High density (HD) disks have 22 sectors.
The geometry of an Amiga Floppy Disk is as follows:
- DD disks: 512 bytes/sector, 11 sector/track, 2 track/cyl, 80 cyl/disk
- HD disks: 512 bytes/sector, 22 sector/track, 2 track/cyl, 80 cyl/disk
The DD disk has 11 * 2 * 80 = 1760 (0 to 1759) blocks, while the HD disk has 22 * 2 * 80 = 3520 blocks.
Amiga stores 880 KiB on a DD disk and 1760 KiB on an HD floppy disk.
The standard Amiga filesystem has a internal 32 bit wide offset parameter (unsigned). It tells where to start the read/write operation. The biggest size for an Amiga disk is therefore 2^32 = 4 GiB. This limit was changed with Amiga OS 3.5 and 3.9 and now is 2^64 = 4 Exabyte.
OFS Datablock stores Block Size BSIZE-24 bytes (i.e. normally 488 bytes at most frequently used BSIZE of 512 bytes), FFS stores BSIZE bytes (512 bytes per block). FFS supports directory caching, links and international mode. The FFS is also faster than OFS.
The Rootblock is located at the physical middle of the media: block number 880 for DD disks, block 1760 for HDs.
The exact calculation for where it is stored is as follows:
numCyls = highCyl − lowCyl + 1
highKey = numCyls * numSurfaces * numBlocksPerTrack − 1
rootKey = INT(numReserved + highKey) / 2
The Rootblock contains information about the disk: its name, its formatting date, etc. It also contains information on accessing the files/directories/links located at the uppermost (root) directory.
The characters '/' and ':' are forbidden in file and volume names, but *!@#$%|^+&_()=\-[]{}';",<>.? and accented like âè are allowed.
The date fields in the root block (and other blocks) are structured in the form of DAYS, MINS and TICKS. The DAYS field contains the number of days since January 1. 1978. MINS is the number of minutes that have passed since midnight and TICKS are expressed in 1/50s of a second. A day value of zero is considered illegal by most programs. The Amiga filesystem does not have an inherent year 2000 problem.
To reach a file, directory or a link in a removable media, Amiga has to compute its hash value with an algorithm often called a Hash function. After having computing the hash value, this is then used to access HashTable ('ht' field in Rootblock/Directory block). The HashTable[ HashValue ] contains the number of the first block of the object (File header block, Directory block or Link block).
It happens that different names can result in the same HashValue. If more than one name has the same HashValue, the other blocks (for files and directory only) are stored in a chained list. This linked list starts at the 'next_hash' field of the File header or Directory block. For example : file_1a, file_24 and file_5u have the same hash value.
There was a bug in the old AmigaDOS versions when applying the Hash function to international characters (ASCII codes > 128). Consequently, FFS was then created with the 'international mode' (INTL). Filename characters can be lowercase and uppercase, but are not case sensitive.
Files are comprised of a file header block, which contains information about the file (size, last access time, data block pointers, ETC), and the data blocks, which contain the actual data. The file header block contains up to BSIZE/4-56 data block pointers (which amounts to 72 bytes with the usual 512 byte blocks). If a file is larger than that, file extension blocks will be allocated to hold the data block pointers. File extension blocks are organised in a linked list, which starts in the File header block ('extension' field).
Other related archivesAmiga, Amiga Fast File System, Amiga OS, Fast File System, Hash function, List of file systems, MFM, Professional File System, Smart File System, TripOS, Xerox, block, floppy disks, metadata
 Adapted from the Wikipedia article "Characteristics", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |