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.

164 Transput Chapter 5error. After the program has rejected it, the user can recall the erroneous line,correct it by using the editing features, and then resubmit it.There are many different terminals on the market, and each seems to have its own conventionsfor such actions as clearing the screen and moving to a particular place on thescreen. In addition, terminals are capable of transferring data at different rates. Someoperating systems provide some amount of customization in how they deal with terminals.For example, once the terminal driver knows what kind of terminal is being used, itcan decide how to echo editing characters. Users have personal preferences, as well.Some prefer to use X to erase lines. Customization can be provided by servicecalls that establish these special characters. The user who wants a particular set of conventionscan run a program that submits these calls. Even the activation character, whichis usually just the carriage return, can be reset in many operating systems.3.4 Disk device driversOne trivial function of a disk device driver is to smooth out the chunky structure of thephysical disk, with its sectors, tracks, and cylinders, and provide the abstraction of a virtualdisk that is a linear array of sectors. Sector s on track t in cylinder c has this identifyingnumber:SectorId = (c . TracksPerCylinder + t ) . SectorsPerTrack + sHigher levels of software in the kernel can use sector identifiers instead of triples todescribe locations on a disk.A less trivial function of the disk driver is to reduce the effect of latencies inaccessing the disk. Several techniques are available.Processes that require disk access may be blocked in a disk-wait list until therequest can be satisfied. Meanwhile, other processes can run. We call this techniquesynchronous transput. Alternatively, a process that can perform usefulcomputation before the transput completes may be allowed to continue. We callthis technique asynchronous transput. We discuss this difference later. In eithercase, it is important to overlap transput and computation.Large data objects can be stored in contiguous regions on the disk so that once thefirst seek has finished, the rest of the data can be accessed without additionaldelays. For this reason, allocation of disk space is often made in increments ofentire tracks or even entire cylinders.Similarly, the blocks that constitute a file might be constrained to reside close toeach other. (We will discuss physical allocation of files in Chapter 6.)When the same disk pack is used both for secondary store (files) and backing store(swap space), the swap space should occupy the tracks halfway between the centerand the edge, because items in this location can be accessed with the lowest averageseek latency.Disk requests are continually generated by main-store management (swapping ofpages or segments) and file usage; often several requests are pending. We can

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

Saved successfully!

Ooh no, something went wrong!