Alasir Enterprises
Main Page >  Motley >  MicroHouse PC Hardware Library Volume I: Hard Drives  

 
Previous Table of Contents Next

 
Although I have stated that each disk sector is 512 bytes in size, this statement technically is false. Each sector does allow for the storage of 512 bytes of data, but the data area is only a portion of the sector. Each sector on a disk typically occupies 571 bytes of the disk, of which only 512 bytes are usable for user data. The actual number of bytes required for the sector header and trailer can vary from drive to drive, but this figure is typical. A few modern drives now use an ID-less recording that virtually eliminates the storage overhead of the sector header information. In an ID-less recording, virtually all of the space on the track is occupied by data.

You may find it helpful to think of each sector as being a page in a book. In a book, each page contains text, but the entire page is not filled with text; rather, each page has top, bottom, left, and right margins. Information such as chapter titles (track and cylinder numbers) and page numbers (sector numbers) is placed in the margins. The “margin” areas of a sector are created and written to during the disk-formatting process. Formatting also fills the data area of each sector with dummy values. After the disk is formatted, the data area can be altered by normal writing to the disk. The sector header and trailer information cannot be altered during normal write operations unless you reformat the disk.

Each sector on a disk has a prefix portion, or header, that identifies the start of the sector and a sector number, as well as a suffix portion, or trailer, that contains a checksum, which helps ensure the integrity of the data contents. Each sector also contains 512 bytes of data. The data bytes normally are set to some specific value, such as F6h (hex), when the disk is physically (or low-level) formatted. (The following section explains low-level formatting.)

In many cases, a specific pattern of bytes that are considered to be difficult to write are written so as to flush out any marginal sectors. In addition to the gaps within the sectors, gaps exist between sectors on each track and also between tracks; none of these gaps contains usable data space. The prefix, suffix, and gaps account for the lost space between the unformatted capacity of a disk and the formatted capacity.

Table 1.1 shows the format for each track and sector on a typical hard disk with 17 sectors per track.

Table 1.1  Typical 17-Sector/17-Track Disk Sector Format.

Bytes Name Description

16 POST INDEX GAP All 4Eh, at the track beginning after the Index mark.
The following sector data (shown between the lines in this table) is repeated 17 times for an MFM encoded track.

13 ID VFO LOCK All OOh; synchronizes the VFO for the sector ID.
1 SYNC BYTE A1h; notifies the controller that data follows.
1 ADDRESS MARK FEh; defines that ID field data follows.
2 CYLINDER NUMBER A value that defines the actuator position.
1 HEAD NUMBER A value that defines the head selected.
1 SECTOR NUMBER A value that defines the sector.
2 CRC Cyclic Redundancy Check to verify ID data.
3 WRITE TURN-ON GAP 00h written by format to isolate the ID from DATA.
13 DATA SYNC VFO LOCK All 00h; synchronizes the VFO for the DATA.
1 SYNC BYTE A1h; notifies the controller that data follows.
1 ADDRESS MARK F8h; defines that user DATA field follows.
512 DATA The area for user DATA.
2 CRC Cyclic Redundancy Check to verify DATA.
3 WRITE TURN-OFF GAP 00h; written by DATA update to isolate DATA.
15 INTER-RECORD GAP All 00h; a buffer for spindle speed variation.

693 PRE-INDEX GAP All 4Eh, at track end before Index mark.

   571  Total bytes per sector

   512  Data bytes per sector

10,416  Total bytes per track

 8,704  Data bytes per track

This table refers to a hard disk track with 17 sectors. Although this capacity was typical during the mid 1980s, modern hard disks place as many as 150 or more sectors per track, and the specific formats of those sectors may vary slightly from the example.

As you can see, the usable space on each track is about 16% less than the unformatted capacity. This example is true for most disks although some may vary slightly.

The POST INDEX GAP provides a head-switching recovery period so that when switching from one track to another, sequential sectors can be read without waiting for an additional revolution of the disk. In some drives this time is not enough. Additional time can be added by skewing the sectors on different tracks so that the arrival of the first sector is delayed.

The Sector ID data consists of the CYLINDER NUMBER, HEAD NUMBER, and SECTOR NUMBER fields, as well as a CRC field to allow for verification of the ID data. Most controllers use bit 7 of the HEAD NUMBER field to mark the sector as bad during a low-level format or surface analysis. This system, however, is not absolute; some controllers use other methods to indicate a marked bad sector. Usually, though, the mark involves one of the ID fields.

WRITE TURN-ON GAP follows the ID field CRC bytes and provides a pad to ensure a proper recording of the following user data area as well as to allow full recovery of the ID CRC.

Previous Table of Contents Next