13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Device hardware 151Magnetic tape is often used for the input because it is relatively inexpensive and can beread sequentially very quickly. Algorithms to sort massive sets of data generate largeintermediate results, which can also be stored on tape. Tapes created during one passover the data are read back in during the next pass.Like disks, tapes store data by maintaining magnetic regions. There are typicallynine such regions across the width of the tape (hence the name ‘‘nine-track tape’’). A setof nine bits is called a frame. Eight bits of the frame are used to store one byte of data,and the ninth is a parity bit set to make the number of one bits in the frame an evennumber. This redundancy is used to help detect errors on the tape. We will discuss parityand other techniques for reliability shortly. Tapes are typically packed at densities of1600 or 6250 frames per inch. The entire tape is written at the same density even thoughsome tape drives are capable of writing at either density. Frames are grouped intorecords separated by inter-record gaps. The gap indicates the end of a record and givesthe tape drive room to speed up as it starts to read or write a record and to slow downafter it finishes. Magnetic tape is always read and written in entire records. A collectionof records constitutes a file. <strong>An</strong> inter-file gap, which is larger than an inter-record gap,marks the end of a file. Figure 5.2 shows the layout of a magnetic tape.Unlike disks, magnetic tapes are not formatted to have a particular record size.Records may be of any convenient length, and successive records on the tape may havedifferent lengths. When the tape is read, adequate main store must be available to holdan entire record at a time, regardless of its size. The use of larger records packs moredata on the tape, because there aren’t as many inter-record gaps. However, it requireslarger main-store buffers for transput. A typical record size is on the order of 2000 bytes.Smaller virtual records can be packed together to gain the efficiency of larger physicalrecords.filefiletracksrecord record recordinter-record gapinter-file gapFigure 5.2 Structure of magnetic tape

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!