We introduced the concept of file systems and how they fit in an OS. We covered many possible alternative mechanisms for storing the files and tracking free space. Designers of real file systems have to make choices about the mechanisms they will include. File Systems Examples We will see that modern OSs use all of the techniques we have described, but none of them uses these techniques in exactly the ways we have described.
Often, real OSs use some combination of the basic techniques described in Chapter 12. We have already mentioned, for example, that some OSs allow both contiguous file allocation and chained file allocation. In the following sections, we look a little more closely at some modern file systems and how they are implemented.
The first file system we look at more closely is a modification of a linked system. Instead of having each data block contain the pointer to the next data block, those pointers will be stored in a separate table. File Systems Examples This system was used in the original Microsoft DOS and is known by the name given to the area used to store this table, the file allocation table, or FAT. In this case, the FAT is not kept in the area that would be used for data storage.
It is in a separate area of the disk just after the boot block. This table will contain space for one disk pointer for each block in the data area. If a block is not allocated to a file, then this pointer will be zero. If this block is a part of a file, then this pointer will normally contain the pointer to the next block in the file. If this block is the last one in the file, then it will contain a special pointer value that indicates that it is the end of the list. how a FAT might look with two files in it. We have indicated the end of file mark as FFFFFFFF.
There are some very interesting things to notice about the FAT mechanism. First, there is no separate mechanism to keep track of free space. The free space blocks have a zero pointer in the FAT. File Systems Examples Second, it is very easy to allocate contiguous space for a file. Just as with a bitmap free space mechanism, all that is necessary to find a contiguous group of free blocks is to scan the FAT and find a contiguous string of zero pointers. It is also easy to allocate single sectors to support the allocation of single blocks for chained file access.
NTFS is the native file system for the Windows NT family. It is a variation on a two-level indexed structure. NTFS uses a master file table ( MFT) to store all the metadata about files and directories. File Systems Examples In the MFT it creates a file record for each file and a folder record for each folder, even for the MFT itself. These records are 1 KB.