|
Heads:
A head refers to the
read/write head that is a part of the physical components of the drive.
Because the disk always has only one top and one bottom with a read/write
head assigned to each, the number of heads is always two.
The last item in the
table is the program that loads either DOS or Windows 9x. Some disks are
bootable, meaning that they contain enough DOS code to load the operating
system—whatever it may be—into memory and to boot to the A or B prompt,
depending on which drive contains the floppy disk. To make a disk
bootable, the disk must include certain parts of the operating system.
For DOS, these parts
are two hidden files and COMMAND.COM. These files can be loaded on the
disk when it is formatted, or they can be loaded with the DOS
SYS command.
When Windows 9x creates a system disk (that is, a bootable disk), it
copies COMMAND.COM and two hidden files, IO.SYS and MSDOS.SYS, to the disk
to make the disk bootable.
All master boot
records, however, are the same whether or not the disk is bootable. When
the PC is looking for a bootable disk during POST, if a disk is in the
drive, the program stored in the master boot record is executed. This
program tries to load the startup files of the operating system.
On a bootable disk, the
boot record contains the names of the two hidden files. For example, for
IBM DOS 3.3, the filenames of the hidden files are IBMBIO.COM and
IBMDOS.COM. The program looks for these two files on the disk. If it does
not find them, the disk is not bootable and a message appears, such as the
following:
Non-system disk or disk
error...Replace and strike any key when ready...Disk boot failure POST
terminates until the user intervenes. Only the program in the master boot
record can determine if the disk is bootable.
The File Allocation
Table (FAT)
Next, the FORMAT
command writes two copies of the file allocation table (FAT) to the disk.
The FAT lists the location of files on the disk in a one-column table.
Because the width of each entry in the column is 12 bits, the FAT is
called a 12-bit FAT or FAT 12. The FAT lists how each cluster or file
allocation unit on the disk is currently used. (Remember that a cluster is
the smallest unit of disk space allocated to a file.) A file is stored in
one or more clusters that do not have to be contiguous on the disk. In the
FAT, some clusters might be marked as bad (the 12 bits to mark a bad
cluster are FF7h). These bits can be entered in the FAT when the disk is
formatted or added later with the DOS RECOVER command. An extra copy of
the FAT is kept immediately following the first. If the first is damaged,
sometimes you can recover your data and files by using the second copy.
When the operating system wants to write a file to a disk, the process
works as follows. The name of the file, its size, and other attributes are
written in a directory. A directory, in its simplest form, is a list of
files on a disk. One piece of information kept in the directory concerning
this file is the cluster number where the data begins (see the figure
below). Only the first cluster number is kept in the directory. The
operating system turns to the FAT to keep track of any additional clusters
that are needed to hold the file.
In the figure above,
the beginning cluster number is 02Ch and is stored in the directory. The
12-bit FAT entry for cluster 02Ch contains 02Dh, or 0000 0010 1101 binary.
This entry is interpreted as the next cluster, the second cluster, used by
the file. Look in the FAT entry for cluster 02Dh to see what cluster is
used next, if any. The entry in the FAT for cluster 02Dh is 02Eh,
indicating that the file continues to a third cluster, 02Eh. The FAT entry
for 02Eh is FFFh (binary 1111 1111 1111), the code for the last cluster
used by the file. The file uses three clusters.
The figure below shows
another FAT. In this example, the file contains 1,798 bytes. The file is
stored beginning in cluster 4, then cluster 5, cluster 1C2, and
cluster 1C3.
Because this file is not stored in consecutive clusters, it is called a
fragmented file.
These four FAT entries
are called a cluster chain. The cluster
chain
determines all cluster
locations for a file on a disk.
<Previous>
<Home>
<Next>
|