HostedDB - Dedicated UNIX Servers

-->
Internet Security Professional Reference:Viruses
Previous Table of Contents Next


Key Hardware

This section reviews the hardware involved in computer startup and the logical organizations created for data storage and describes basic hardware building blocks, such as platters, heads, and tracks.

Both floppy disks and hard disks use the same phenomenon as a tape recorder to store data. A recording head magnetizes microscopic particles embedded in a surface; moving the particles past the magnetized head magnetizes the particles. In an audio or digital computer tape, the magnetic medium is a long string of plastic tape embedded with metal particles usually composed of iron oxide (rust). A floppy disk contains a single double-sided, magnetically coated platter onto which the microscopic iron particles are scattered. A metallic coil wrapped around the floppy drive’s read/write head electronically magnetizes these particles and organizes them into bits and other larger elements. The floppy drive’s head can write and read binary code, which consists of 1s and 0s, to and from the platter.

Formatting a floppy disk using DOS logically apportions its platter into the following elements:

  Heads. Imagine an old vinyl record. (Or, if you are too young to remember them, ask someone older…) Just like vinyl records, floppy disks have two sides that are treated with a magnetic coating, enabling you to record on both surfaces, which yields economies of scale. These two sides of a disk are called heads, and are numbered 0 and 1.
  Track. Imagine touching your index finger to an ink pad and then holding it just above a record spinning on a turntable. If you touch the spinning record lightly with your inky finger, you leave a finger-width ring of ink on the record. Now imagine that the record is a floppy disk and your fingertip is a magnetic read/write head. The inky trail your finger left on the disk would be called a track.
  Sectors. There are many concentric tracks on a disk, each of which is divided into a specific number of sectors. Disk controllers, both floppy and hard, read and write only one track sector at a time. The particular number of bytes in each sector depends on the controller hardware and the operating system. Versions of DOS use 512-byte sectors exclusively, for both floppy disks and hard disks.
A floppy disk can include up to 18 sectors per track and maintain reliability. Although dividing the track up into sectors solves certain problems, more information is required to find data. To find a piece of data requires the side, track, and sector number within the track.

Sectors are organized into clusters, which are disk space allocation units. Disk space is allocated to a file in whole clusters, each of which can consist of one or more sectors.

A 3 ½-inch high-density disk breaks down as follows:

18 sectors — 80 tracks — 512 bytes per sector = 1.44 MB

Key Software

To efficiently access particular bytes on a disk, the operating system constructs directories and indexes that describe what’s occupied, what’s free, and what parts should never be used. This type of disk information is called the logical format.

DOS uses the same logical format for all disk types to organize the disk into four main areas: the boot record, the file allocation table (FAT), the root directory, and the data area. Hard disks have a fifth area, the partition table, which is described in the section “Hard Drive Master Boot Record.” (Although other operating systems might have different ways of logically arranging the information on a hard disk, we will focus our discussion primarily on DOS file management.)

The Boot Record

The first sector on the floppy disk, track 0, head 0, sector 1, is reserved for the boot record, which contains the bootstrap routine, a machine language program designed to load the operating system. The bootstrap machine gets its name because it lets the computer essentially pull itself up by its bootstraps by reading and executing a short program—the boot code—that in turn launches the rest of the operating system.

The boot record also includes the BIOS parameter block (BPB), which identifies the floppy disk’s operating parameters, including the number of bytes per sector, sectors per cluster and track, and tracks per disk. The BPB also identifies sectors that are reserved for special purposes. By identifying disk architecture, the BPB allows an operating system to understand the format of the disk. If the BPB is corrupted, the floppy disk is unreadable.

The FAT

The File Allocation Table (FAT) is a table of entries corresponding to each cluster on the disk. But it is more than a simple index. Each entry indicates whether its associated cluster is available, bad, or in use by a file. If the cluster is in use, the entry either points to the next cluster/FAT entry of the file, or indicates that the cluster is the last cluster of the file. The file directory also is responsible for this record-keeping task. It records both the length of each file and its starting cluster number, and the last FAT entry of each file is specially marked.

The FAT’s importance is such that DOS stores two identical copies of it. Whenever a file expands, DOS looks in the FAT to find and reserve the next free cluster.

The Root Directory

The root directory is the last part of the system area of any DOS-formatted disk. It’s the only directory in the system area, located immediately following the FAT. Each directory entry contains important information, such as the starting cluster number, size of each file, the file name associated with a starting cluster number, time and date fields, a file attributes field, and additional DOS-reserved bytes. The attributes represent special properties that can be applied to a file, such as read-only, hidden, system, and volume label.


Previous Table of Contents Next