Floppy Disk Formats Stephen W. Bartlett August 6, 1983 I. Overview A "floppy disk" is a magnetic medium of information storage, just as cassette tapes are. Floppy disks consist of a protective jacket that encloses a thin circular sheet of material (mylar?) that has been coated with a magnetic medium. When in use, the medium spins within the jacket at some 360 revolutions per minute. Floppies that are brand-new are, as a rule, practically useless. The reason for this is that in order for a disk drive to reference information on a floppy, the drive must know where the read/write head is relative to the information. The drive cannot know where on the disk the head is if there is absolutely no information on the disk. Before a disk can be used, it must be given a structure of signposts or flags that enable the drive to reference specific areas. This structure or organization of a floppy disk is called its "format." This document describes the types of disk formats used by the Educational Technology Center's microcomputers. Although an attempt was made while writing this to be thorough, this document will become more and more incomplete as the Center acquires different microcomputers. II. Definitions A floppy is divided into a number of concentric circles. These circles are termed "tracks" on single-sided disks. On double-sided disks, pairs of opposing tracks are termed "cylinders." Each track is further divided into "sectors." The information in a sector includes, in addition to the data space, sector identification and synchronization information. On each disk, all of the tracks (with the possible exception of the first one) have the same number of sectors, and all sectors are of the same size. The very first track of a disk is sometimes "special" and different from all other tracks on a disk. It may have a different number of sectors, and its sectors may be of a different size. The first track will, for a particular machine, most likely be of an unchanging format, regardless of the recording density. The reason for this is to enable the hardware to always read the first track using a preset format. (On some machines the first track contains information that indicates to the machine the recording density of the rest of the disk.) The U.C.S.D. p-System has a standard buffer size through which it is convenient to do input or output. This buffer size is called a "block," and it is defined to be exactly 512 bytes (256 16-bit words). The p-System manuals speak of blocks much more frequently than tracks or sectors. There are entities called "blocked volumes" and there are intrinsic I/O routines called "BLOCKREAD" and "BLOCKWRITE." Other operating systems may deal with sectors or their own standard buffer size. There are two factors controlling the relationship between the p-System's blocks and the physical ordering of tracks and sectors. The first, "interleaving," means that blocks as read from and written to the disk are not necessarily in order. As the disk rotates, the numbers of the blocks seen may appear: 1 0 3 2 5 4 7 6 ... (the author is not sure of the exact ordering of blocks on an interleaved disk; this information is hard to find). The second factor, "skewing," may be described as follows: a skewed disk is one whose sector numbers do not coincide exactly with the sector numbers on neighboring tracks. For example, assume two disks A and B each have 8 sectors per track (numbered from 0 to 7). Further, assume disk A is normal and disk B is skewed. Then their sector numbers, were they written out one line per track, might appear: Disk A (normal) Disk B (skewed) track n 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 track n+1 0 1 2 3 4 5 6 7 1 2 3 4 5 6 7 0 track n+2 0 1 2 3 4 5 6 7 2 3 4 5 6 7 0 1 Skewing is done to reduce the waiting done on a non-interleaved disk when the disk controller is to read (for example) track n, sector 7 and track n+1, sector 0 of disk A. The read/write head moves to track n, waits for sector 7 to rotate underneath the head, and reads it. The head then seeks to track n+1 in preparation for reading sector 0. However, the disk is still rotating while the head is moving. When the head arrives at track n+1, sector 0 has already gone by. The disk controller has to wait almost a full revolution of the disk before sector 0 comes up again. That takes up time, so tracks are offset from each other (skewed) enough so that after a seek to an adjacent track, the controller doesn't have to wait a full revolution for the next sector. Another factor in a disk's format is "byte-sex." Within the words (16-bits or 2-bytes) of information on a disk, the most significant byte of the word may be the first one or the last one. Disks whose ordering of their bytes is different are "byte-flipped" from each other. A slightly related note: floppy disks provide for a means of protecting against writing information to the disk. This is called "write- protection", and it is indicated by the presence or absence of a paper tab across a notch in the disk's jacket. The method varies for different machines. {$P} III. Specific Cases | Track 0 | Track > 0 | Disk |# of |sectors|sector|sectors|sector|blocks|relative|inter-|skewed|write type |tracks|per |size |per |size | |byte sex|leaved| |pro- | |track |(byte)|track |(byte)| | | | |tect ------+------+-------+------+-------+------+------+--------+------+------+----- Terak | 77 | 26 | 128 | 26 | 128 | 494 | normal | Yes | No | n/a single| | | | | | | | | | ------+------+-------+------+-------+------+------+--------+------+------+----- Terak | 77 | 26 | 128 | 26 | 512 | 1140 | normal | Yes | No | n/a double| | | | | | | | | | ------+------+-------+------+-------+------+------+--------+------+------+----- PDQ | 77 | 26 | 128 | 26 | 128 | 494 | flipped| No |should| tab single| | | | | | | | |be | off ------+------+-------+------+-------+------+------+--------+------+------+----- PDQ | 77 | 26 | 128 | 26 | 256 | 988 | flipped| No |should| tab double| | | | | | | | |be | off ------+------+-------+------+-------+------+------+--------+------+------+----- ACI | 77 | 26 | 128 | 26 | 128 | 494 | normal | No |should| tab single| | | | | | | | |be | off ------+------+-------+------+-------+------+------+--------+------+------+----- ACI | 77 | 26 | 128 | 26 | 256 | 988 | normal | No |should| tab double| | | | | | | | |be | off ------+------+-------+------+-------+------+------+--------+------+------+----- Xerox | 77 | 26 | 128 | 26 | 128 | 494 | normal | Yes | No | tab single| | | | | | | | | | off ------+------+-------+------+-------+------+------+--------+------+------+----- Xerox | 77 | 26 | 128 | 26 | 256 | 988 | normal | Yes | No | tab double| | | | | | | | | | off ------+------+-------+------+-------+------+------+--------+------+------+----- IBM | 40 | 8 | 512 | 8 | 512 | 320 | normal | ? | ? | tab single| | | | | | | | | | on ------+------+-------+------+-------+------+------+--------+------+------+----- IBM | 40 | 8 | 512 | 10 | 512 | 400 | normal | ? | ? | tab double| | | | | | | | | | on ------+------+-------+------+-------+------+------+--------+------+------+----- Apple | 35 | 16 | 256 | 16 | 256 | 280 | normal | ? | ? | tab | | | | | | | | | | on ------+------+-------+------+-------+------+------+--------+------+------+----- Rain- | 80 | 10 | 512 | 10 | 512 | 800 | ? | ? | ? | tab bow | | | | | | | | | | on ------+------+-------+------+-------+------+------+--------+------+------+----- SAGE | 160 | 8 | 512 | 8 | 512 | 1280 | flipped| ? | No | tab | | | | | | | | | | on ------+------+-------+------+-------+------+------+--------+------+------+----- {$P} IV. Disk Formatting Utilities Usually, formatting a disk requires that you boot on the machine that you wish the disk to be compatible with and execute a program whose name is one of "format," "formatter," "diskformat," etc. However, there are some peculiarities to watch out for. Under NCI's IBM IV.1 operating system, the program is TURNKEY. On the SAGE, the program is SAGEUTIL. On the ACI-90 under Volition System's III.0 operating system, the program asks for the amount to skew the tracks on the disk. Give the number "19." It is a good idea to format a disk TWICE if it is not apparent that the formatting program does not verify the format. The Dysan and Maxell 8-inch disks we buy are already formatted for Terak single density (IBM 3740 format). SWB/me