Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  When DOS formats a diskette, it erases and verifies every sector. In a
  fixed-disk partition, DOS verifies the integrity of each sector without
  erasing pre-existing data. (That is why a program like the Norton
  Utilities' Format Recover can retrieve data from a fixed disk after you
  have accidentally reformatted it.) On both diskettes and fixed disks, the
  format program reserves a certain amount of disk space to store control
  information and indexes that DOS uses to organize the data you store on
  the disk.

  Every DOS diskette or fixed-disk DOS partition is mapped into four
  separate areas. These areas, in the order they are stored, are the
  reserved area, the file allocation table (FAT), the root directory, and
  the files area. (See Figure 5-6.) The size of each area varies among
  formats, but the structure and the order of the areas don't vary.

                   +-------------------+
  Logical sector 0 |  Reserved area    |
                   |-------------------|
                   |                   |
                   | File allocation   |
                   |   table (FAT)     |
                   |                   |
                   |-------------------|
                   |  Root directory   |
                   |-------------------|
                   |                   |
                   | Files area (files |
                   |and subdirectories)|
                   |                   |
                   |                   |
                   |                   |
                   +-------------------+

  Figure 5-6.  DOS disk map.

  The reserved area can be one or more sectors long; the first sector is
  always the disk boot sector (logical sector 0). A table within the boot
  sector specifies the size of the reserved area, the size (and number of
  copies) of the file allocation table, as well as the number of entries in
  the root directory. All diskettes have a reserved area of at least one
  sector, even if they aren't bootable.

  The file allocation table, or FAT, immediately follows the reserved area.
  The FAT maps the usage of all the disk space in the files area of the
  disk, including space used for files, space that hasn't been used, and
  space that is unusable due to defects in the disk medium. Because the FAT
  maps the entire usable data storage area of a disk, two identical copies
  of it are stored in case one is damaged. The size of a FAT depends on the
  size of the disk (or of the partition of a fixed disk): Larger disks
  usually require larger FATs. Figure 5-7 shows FAT sizes for several
  different disk sizes.

                                       Reserved                 Root
  Disk                     Capacity    Area        FAT          Directory
  --------------------------------------------------------------------------
  51/4-inch diskette       360 KB      1 sector     4 sectors    7 sectors
                           1.2 MB      1           14           14
  31/2-inch diskette       720 KB      1            6            7
                           1.44 MB     1           18           14
  --------------------------------------------------------------------------

  Figure 5-7.  Reserved area, FAT, and root-directory overhead for some
  common DOS diskette formats.

  The root directory is the next item on a DOS disk. It is used as a table
  of contents, identifying each file on the disk with a directory entry that
  contains several pieces of information, including the file's name, size,
  and location on the disk. The size of the root directory varies with the
  disk format. (See Figure 5-7.)

  The files area, which occupies the bulk of the available disk space, is
  used to store files; in DOS versions 2.0 and later, the files area may
  contain subdirectories as well as files. For both files and
  subdirectories, space in the files area is allocated as needed in chunks
  of contiguous sectors called clusters. As with the sizes of the FAT and
  the root directory, a DOS disk's cluster size varies with the format. (See
  Figure 5-8.) The number of sectors in a cluster is always a power of 2;
  generally, the cluster size is one sector for single-sided diskettes, two
  sectors for double-sided diskettes, and four or more for fixed disks.

  Disk                                 Capacity           Cluster Size
  --------------------------------------------------------------------------
  51/4-inch diskette                   360 KB             2 sectors
                                       1.2 MB             1
  31/2-inch diskette                   720 KB             2
                                       1.44 MB            1
  Typical PC/XT fixed disk             10 MB              8
  PC/AT fixed disk, type 20            30 MB              4
  PS/2 Model 30, fixed disk, type 26   20 MB              4
  PS/2 Model 60, type 31               44 MB              4
  --------------------------------------------------------------------------

  Figure 5-8.  Cluster size for some common DOS disk formats.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson