Root Directory
Following the last FAT is the Root Directory. The root directory is like a table of contents for the information stored on the hard disk drive. The location of the Root Directory can easily be established by adding up the values from boot record, as it is positioned following the FATs.
The directory area keeps the information about the file name, date and time of the file creation, file attribute, file size and starting cluster of the particular file. Each directory entry describing this information about a file is a 32 byte information.
The root directory contains information about the files and directories branching from the root directory. All further directories are themselves stored as files, in the same format as the root directory. Previously the root directory used to be fixed in size and located at a fixed position on disk but now it is free to grow as necessary as it is now treated as a file.
The number of files that one can store on the root directory depends on the FAT type being used. For Example, for a 3½ Inch 1.44Mb floppy Disk with 12–Bit FAT, it is limited to 224 entries, if one tries to store 225th file DOS will display a “File creation error”. When a 16–Bit FAT is used one can have a total 512 entries in the root directory. Each main directory on a floppy or hard disk, also acts as a root directory entry.
The following table lists the limits of root entries for different media and FAT:
Media and File System Description |
Maximum Root Directory Entries |
Single-sided 5¼ Inch 180K FDD |
64 |
Double-sided 5¼ Inch 320K FDD |
64 |
Double-sided 5¼ Inch 360K FDD |
112 |
Double-sided 3½ Inch 720K FDD |
112 |
Double-sided 5¼ Inch 1.2-megabyte FDD |
224 |
Double-sided 3½ Inch 1.44-megabyte FDD |
224 |
Double-sided 3½ Inch 1.68-megabyte DMF format disks (This is why Microsoft created CAB Files!) |
16 |
Double-sided 3½ Inch 2.88-megabyte FDD |
240 |
Hard Drives (FAT12 & FAT16) |
512 |
Hard Drives with FAT 32 (As it treats the route directory as a file) |
65,536 |
This does not mean that with 16–Bit FAT one is limited to storing only 512 files on the hard disk drive. One can use sub-directories to store any number of files limited only by the size of the drive.
Remember that the volume label for a floppy is usually stored within the boot sector, but the volume label for a hard drive is stored as a root directory entry and the space reserved in the boot sector is left blank with spaces. The DIR command of DOS returns the one in the directory if present, or the one in the boot sector if not.
Directory entries contain the entry into the chain of clusters and the filename. Therefore the most important Directory Entries are of the root directory, because it contains cluster indexes that points to all Sub–Directories.
All directories contain two entries, "." for Current directory (This Sub Directory) and ".." for parent directory (Parent Directory of this Sub Directory). We can track these entries easily as they will always be positioned in the beginning of a cluster if the cluster contains a directory.
|