SECONDARY STORAGE CHARACTERISTICS Random/Sequential Access In the case of random access devices, access time (the time taken to locate and then read or write data) is similar for all data stored on the device. Main memory and disks are examples of ramdom access devices. Access time for sequential devices depends on where the data are stored on such devices. In order to access a particular piece of data on a sequential access device, it is necessary to by-pass all preceding data on the same device. Magnetic tapes are sequential access devices. Magnetic Tapes Magnetic tapes are the most frequently used sequential storage devices. They consist of flexible material such as Mylar, coated with ferric oxide. Data bits are stored on the ferric oxide coating by magnetising it in one direction or the other. Magnetic tapes are typically over 2000 feet long, and 1/2 or 1 inch wide. The wider the tape, the more data can be stored in parallel. Half-inch tape commonly has 7 or 9 tracks, allowing 7 or 9 bits to be stored in parallel. Data on tapes are stored at densities ranging from 200 to 1600 bits per inch on each track. Because of the high data density and the high speed at which tapes are moved (around 120 inches per second), data are stored in records or blocks, separated by interrecord gaps. These gaps are about 3/4-inch long. The interrecord gaps are used for starting and stopping the tape. The lengths of the records themselves vary from system to system, and can sometimes be determined by the programmer. In any event, they would be much longer than the interrecord gaps. Tapes can be either formatted or unformatted. Formatted tapes use one track for timing, on which each bit is set to 1. The tape reader can then use this track to locate the exact position of any character (each of whose bits are held in parallel across the tape width). If a timing track is used, it is possible to rewrite accurately to any point on the tape, without the risk of overwriting data either before or after that point. Where a timing track is not used, some of the following block will be overwritten if the tape speed during the rewrite is greater than the tape speed during the original write. Files held on magnetic tape consist of one or more physical records, terminated by an end of file marker. Tape drive operations: REWIND the tape so that the first block is under the read/write heads. WRITE a block at the current head position, leaving the heads ready to write the next block. If a formatted tape is being written to, a multiple of a fixed number of words can be written. If the tape being written to is unformatted, a programmer- specified number of words can be written. READ the block positioned under the heads, leaving the heads positioned over the following block. If a formatted tape is being read, a fixed block can be read as written, or a given number of words. If the tape being read is unformatted, either the whole block written can be read, of a programmer-specified number of words. It is not possible to perform a tape read on any of the blocks downstream of (after) a write operation on an unformatted tape. BACKSPACE, or rewind the tape so that the heads are positioned over the preceding block. In the case of an unformatted tape, it is possible to backspace to the preceding file on the tape. SKIP or forward space so that the heads are positioned over the next block. In the case of an unformatted tape, it is possible to skip to the next file on the tape. WRITE END OF FILE. Write a special block called the end-of file mark at the current head position, leaving the heads ready to write the next block (the first block of the next file). DETECT END OF FILE. Detect the end of file mark duting tape read. Magnetic Disks Magnetic disks are the most frequently used secondary storage devices. Disk storage on larger machines (minicomputers and mainframes) is frequently in the form of disk packs - several ferric oxide coated, coaxial, circular recording surfaces or platters. Data are written to disk and read from a disk pack by a set of read-write heads - one for each platter - attached to an access arm. At any given arm position, there is a ring- shaped surface called a track. Each platter might hold anything from 100 to 1000 tracks. The set of tracks (one for each platter) at each arm position is called a cylinder. Each track can contain one or more blocks. To access a block on a disk pack, the access arm is moved to the cylinder, the head is selected, and the track is scanned until the block rotates to the head position. The block can then be read or written to as it passes under the head. The time taken to access a block then depends on the time taken to move the disk heads to the required cylinder, and the rotation speed of the disk. It can take up to 1/10 of a second to move the access arm (on a tape, the equivalent operation of positioning of the tape head can be anything up to 4 minutes). Data can be read from a track at rates of between 100 kB/sec (kB = kilobytes) and 400 kc/sec, as compared to 30 to 180 kB/sec for a magnetic tape. Disks can hold anything from about 1 megabyte to about 400 megabytes, depending on their size and data densities. Data are read from and written to the disk in blocks. Blocks and physical records need not coincide as they do on magnetic tapes, although they often do. Records may occupy several blocks, in which case the blocks can be read or written as a single operation, or they may occupy only part of a block, in which case the rest of the block is wasted. Some disks allow variable record sizes, each record being separated by an interrecord gap. The address of a record is specified by its cylinder number, track number and record number. A disk file is a collection of physical records, not necessarily held contiguously on the disk. Disk drive operations: SEEK: move the access arm to a specified cylinder, and select a specified track. READ a block, starting at a specified physical record, and continuing for a specified number of characters WRITE a block, starting at a specified physical recird, and continuing for a specified number of characters. DRUM STORAGE Magnetic drums are rarely used now. A drum is a cylinder, about 10 inches in diameter and 20 inches long, whose surface is coated in a magnetic material. Drums can rotate faster than disks, and also hold data at a higher density. Tracks wrap round the surface of the drum in much the same way as tracks wrap round a disk. Tracks are divided into blocks or sectors. Several tracks can be read simultaneously if there are several disk heads. CORE STORAGE Magnetic core is rarely used now, as it bulkier and more expensive than semiconductor memory. It was the primary storage medium on older machines. It consisted of small magnetised rings, intersected by wires. The rings could be remagnetised by changing the direction of current flow inside the wires. One advantage that it has over semiconductor memory is that it is not volatile, i.e. it 'remembers' the data stored even after the machine is powered off.