DOC PREVIEW
Chico CSCI 640 - Chapter 13-­4 I/O Systems

This preview shows page 1-2-3-27-28-29 out of 29 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 13 4 I O Systems Chapter 13 I O Systems Chapter 13 1 and 13 2 I O Hardware Chapter 13 3 Application I O Interface Kernel I O Subsystem Transforming I O Requests to Hardware Operations Performance Operating System Concepts 13 2 Silberschatz Galvin and Gagne 2005 Kernel I O Subsystem Operating System Concepts 13 3 Silberschatz Galvin and Gagne 2005 Kernel I O Subsystem I O Services Scheduling Buffering Caching Spooling Device Reservation and Error Handling I O system is also responsible for protecting itself from malicious or accidental misuse Much more on these topics in the next couple of chapters Remember the kernel is tht part of the operating system that is always resident Thus these services are always available and quite necessary Operating System Concepts 13 4 Silberschatz Galvin and Gagne 2005 Disk Scheduling Scheduling blocking I Os A good ordering of disk I O request handling is critical Want to reduce average wait times and yet not starve others Disk Scheduling was discussed in the previous chapter FCFS SSTF SCAN Requests for service are entered into a wait queue in some kind of an optimal order depending upon the scheduling algorithm Asynchronous I O A different animal we must keep track of potentially many I O requests at the same time Here a wait queue is often attached to some kind of device status table Table is associated with specific devices and indicates device status busy idle or not working is Thus judicious scheduling I O operations is an effective way to speed up I O Without question I O is the slowest operation on a computer operations Operating System Concepts 13 5 Silberschatz Galvin and Gagne 2005 Device status Table Can see the queues Operating System Concepts 13 6 Silberschatz Galvin and Gagne 2005 Buffering Buffering techniques are used throughout computer systems in so very many ways Main idea is that buffers serve to address the inherent mismatch in speeds timing etc between two or more devices or between a device and an application These mismatches arise due to incredible differences in speed between devices such as say modems and a disk As an example buffers may be created in this case in main memory to accumulate inputs when the entire input is received a very quick single transfer to disk can readily occur Done all the time Often two buffers are used double buffering Here a modem can continue to fill one buffer while the other buffer s data is written to disk Double buffering is used in many applications too to speed up I O handling but there s a cost space in the application s address space for one thing Idea behind all this is to decouple producers from consumers Operating System Concepts 13 7 Silberschatz Galvin and Gagne 2005 Sun Enterprise 6000 Device Transfer Rates Operating System Concepts 13 8 Silberschatz Galvin and Gagne 2005 Buffering more Another example of the use of buffering takes place in message passing where typically messages are broken down into packets sent over a network These packets can be reassembled back together for processing Copy Semantics We often have buffers of data to be written to say disk When a write system call is issued a pointer to the buffer and an integer citing the number of bytes to transfer are passed to the write system call We ve seen this in the device status tables a couple of slides back But what if the application needs to write more to this buffer or modify it before the physical write takes place Remember the I O is scheduled Using copy semantics we guarantee the version sent to disk is correct one This is accommodated by the system call by the call writing the data into a kernel buffer before returning control to the application Disk writes then takes place from the kernel buffer This approach copying data between kernel buffers and application data space is common in operating systems even though there is some copying overhead Operating System Concepts 13 9 Silberschatz Galvin and Gagne 2005 Caching Caching as opposed to buffering although they may be used together and may be complementary at times really deals with copies of data First of all we have our primary memory cache and then there are CPU secondary and primary caches Buffers typically contain a copy of a data item whatever it is maybe a page or perhaps something smaller But caches represent additional storage usually in faster access storage This means the switching technology is much faster Caches are used extensively in improving I O efficiency in accessing directories FATs recently read written data and a host of other things etc In these cases cache stores may be accessed much more quickly than a corresponding area of primary memory or disk Operating System Concepts 13 10 Silberschatz Galvin and Gagne 2005 Spooling Spooling a technique usually used as a holding place for data for a device such as a printer Spooling is very useful for devices that need non interleaved access as in the case of printers or tapes that cannot multiplex I O requests for concurrent applications A printer can only print one file at a time Upon writing output files application data is spooled to a disk file until the entire file is developed Then this spool file can be queued up and sent to the printer for printing Usually there is a daemon a background process that might handle the actual spooling or perhaps some in kernel thread Most operating systems do however additionally allow for exclusive device access where a process may obtain total control over a device which can be allocated and later de allocated to this process Advantages to this but overall system wide performance is reduced Operating System Concepts 13 11 Silberschatz Galvin and Gagne 2005 Error Handling OS can recover from lots of errors during operations such as bad disk reads device unavailable and other transient write failures if the way we do business so specifies We have commands such as read retry resend Most of these system calls return an error number or code when I O request fails sometimes just a single bit indicating a success or a failure Sometimes some operating systems can return a host of return codes that really nail a pretty comprehensive description of the return Indexed sequential operations using VSAM for example may return codes that indicate a successful operation end of file record not found and a host of other messages pertinent to indexed operations Unix has many of these including Bad pointer argument out of range etc I ve had a number of these SCSI


View Full Document

Chico CSCI 640 - Chapter 13-­4 I/O Systems

Download Chapter 13-­4 I/O Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chapter 13-­4 I/O Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chapter 13-­4 I/O Systems and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?