I/O Management and Disk Scheduling (Chapter 10) Perhaps the messiest aspect of operating system design is input/output A wide variety of devices and many.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

I/O Management and Disk Scheduling
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
I/O Management and Disk Scheduling (Chapter 11)
Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.
I/O Management and Disk Scheduling
Categories of I/O Devices
CT213 – Computing system Organization
I/O Management and Disk Scheduling
Input and Output CS 215 Lecture #20.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
Day 30 I/O Management and Disk Scheduling. I/O devices Vary in many ways Vary in many ways –Data rate –Application –Complexity of control –Unit of transfer.
Input/Output Management and Disk Scheduling
Operating System - Overview Lecture 2. OPERATING SYSTEM STRUCTURES Main componants of an O/S Process Management Main Memory Management File Management.
1 Chapter 11 I/O Management and Disk Scheduling –Operating System Design Issues –I/O Buffering –Disk Scheduling –Disk Cache.
Chapter 1 and 2 Computer System and Operating System Overview
Device Management.
CS623: Lecture 4 2/17/2004 © Joel Wein 2003, modified by T. Suel.
1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
I/O Management and Disk Scheduling (Chapter 11)
External Devices I/O Modules Programmed I/O Interrupt Driven I/O Direct Memory Access I/O Channels and Processors.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
I/O Management and Disk Scheduling
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Input/OUTPUT [I/O Module structure].
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
1 IO Management and Disk Scheduling Chapter Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals.
1 I/O Management and Disk Scheduling Chapter
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable  Used to communicate with the user  Printers  Video display.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display.
Input/Output Computer component : Input/Output I/O Modules External Devices I/O Modules Function and Structure I/O Operation Techniques I/O Channels and.
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
Page 1 2P13 Week 10. Page 2 Page 3 Static table-driven approaches performs a static analysis of feasible schedules of dispatching result is a schedule.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
I/O Management and Disk Scheduling Chapter 11. Categories of I/O Devices Human readable Used to communicate with the user  Printers, Display terminals,
1 I/O Management and Disk Scheduling Chapter I/O Devices Can be group into three categories: 1.Human readable Used to communicate with the computer.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Device Management Mark Stanovich Operating Systems COP 4610.
Chapter 101 I/O Management and Disk Scheduling Chapter 11.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
ECE 456 Computer Architecture Lecture #9 – Input/Output Instructor: Dr. Honggang Wang Fall 2013.
Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Computer Organization and Architecture + Networks Lecture 6 Input/Output.
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Computer Architecture
Information Storage and Spintronics 15
Operating Systems Chapter 5: Input/Output Management
Operating Systems.
Presentation transcript:

I/O Management and Disk Scheduling (Chapter 10) Perhaps the messiest aspect of operating system design is input/output A wide variety of devices and many different applications of those devices. It is difficult to develop a general, consistent solution. Chapter Summary –I/O devices –Organization of the I/O functions –Operating system design issue for I/O –I/O buffering –Disk I/O scheduling –Disk Caching

I/O Devices External devices that engage in I/O with computer systems can be roughly grouped into three categories: Human readable: Suitable for communicating with the computer user. Examples include video display terminals, consisting of display, keyboard, mouse, and printers. Machine readable: Suitable for communicating with electronic equipment. Examples are disk and tape drives, sensors, controller, and actuators. Communication: Suitable for communicating with remote devices. Examples are digital line drivers and modems.

Differences across classes of I/O Data rate: Refer to Table 10.1 Application: The use to which a device is put has an influence on the software and policies in the O.S. and supporting utilities. For example: –A disk used for file requires the support of file- management software. –A disk used as a backing store for pages in a virtual memory scheme depends on the use of virtual memory hardware and software. –A terminal can be used by the system administrator or regular user. These use imply different levels of privilege and priority in the O.S.

Differences across classes of I/O (continue) Complexity of control: A printer requires a relatively simple control interface. A disk is much more complex. Unit of transfer: Data may be transferred as a stream of bytes or characters or in large blocks. Data representation: Different data-encoding schemes are used by different devices, includes differences in character code and parity conventions. Error conditions: The nature of errors, the way in which they are reported, their consequences, and the available range of responses differ widely from one device to another.

Organization of the I/O Function Programmed I/O: The processor issues an I/O command on behalf of a process to an I/O module; that process then busy-waits for the operation to be complete before proceeding. Interrupt-driven I/O: The processor issues an I/O command on behalf of a process, continues to execute subsequent instructions, and is interrupted by the I/O module when the latter has completed its work. The subsequent instructions may be in the same process if it is not necessary for that process to wait for the completion of the I/O. Otherwise, the process is suspended pending the interrupt, and other work is performed. Direct memory access (DMA): A DMA module controls the exchange of data between main memory and an I/O module. The processor sends a request for the transfer of a block of data to the DMA module and is interrupted only after the entire block has been transferred.

The Evolution of the I/O Function The processor directly controls a peripheral device. This is seen in simple microprocessor-controlled devices. A controller or I/O module is added. The processor uses programmed I/O without interrupts. With this steps, the processor becomes somewhat divorced from the specific details of external device interfaces. The same configuration as step 2 is used, but now interrupts are employed. The processor need not spend time waiting for an I/O operation to be performed, thus increasing efficiency. The I/O modules is given direct control of memory through DMA. It can now move a block of data to or from memory without involving the processor, except at the beginning and end of the transfer.

The Evolution of the I/O Function (continue) The I/O module is enhanced to become a separate processor with a specialized instruction set tailored for I/O. The central processor unit (CPU) directs the I/O processor to execute an I/O program in main memory. The I/O processor fetches and executes these instructions without CPU intervention. This allows the CPU to specify a sequence of I/O activities and to be interrupted only when the entire sequence has been performed. The I/O module has a local memory of its own and is, in fact, a computer in its own right. With this architecture, a large set of I/O devices can be controlled with minimal CPU involvement. A common use for such an architecture has been to control communications with interactive terminals. The I/O processor takes care of most of the tasks involved in controlling the terminals.

Operating System Design Issues Design Objectives: Efficiency and Generality Efficiency –I/O is always the bottleneck of the system –I/O devices are slow –Use multi-programming (process1 put on wait and process2 go to work) –Main memory limitation => all process in main memory waiting for I/O –Virtual memory => partially loaded processes, swapping on demand –The design of I/O for greater efficiency: Disk I/O hardware & scheduling policies Generality –simplicity & freedom from error, it is desirable to handle all devices in a uniform manner. –Hide most details and interact through general functions: Read, Write, Open Close, Lock, Unlock.

Logical Structure of the I/O Function Logical I/O: Concerned with managing general I/O functions on behalf of user processes, allowing them to deal with the device in terms of a device identifier and simple commands: Open, Close, Read, and Write. Device I/O: The requested operations and data are converted into appropriate sequence of I/O instructions. Buffering techniques may be used to improve use. Scheduling and control: The actual queuing and scheduling of I/O operations occurs at this level. Directory management: Symbolic file names are converted to identifiers. This level also concerned about user operations that affect the directory of files, such as Add, Delete, and Reorganize File system: Deals with logical structures of files. Open, Close, Read, Write. Access rights are handled in this level. Physical organization: References to files are converted to physical secondary storage addresses, taking into account the physical track and sector structure of file. Allocation of secondary storage space and main storage buffer is handled in this level.

I/O Buffering Objective: To improve system performance Methods: –To perform input transfer in advance of the requests being made; –To perform output transfer some time after the request is made; Two types of I/O devices –Block-oriented: Store information in blocks that are usually of a fixed size. Transfer are made a block at a time. –Stream-oriented: Transfer data in and out as a stream of bytes. There is no block structure. Examples are terminals, printers, communication ports, mouse, other pointing devices.

Process, main memory and I/O device Program Data Process1 Main memory I/O device Transfer data block I/O request (read) Program Data Process1 Main memory I/O device Transfer data block I/O request (write) Reading and writing a data block from and to an I/O device may cause single process deadlock. When the process invoke an I/O request, the process will be blocked on this I/O event and can be swapped out of the main memory. However, before the I/O device issue the transfer and the process is swapped out, a deadlock occurs. Solution to this problem is to have a buffer in the main memory. Reading a data block from an I/O deviceWriting a data block to an I/O device

The utility of Buffering Buffering is a technique that smoothes out peaks in I/O demand. No amount of buffering will allow an I/O device to keep pace indefinitely with a process when the average demand of the process is greater than the I/O device can service. All buffers will eventually fill up and the process will have to wait after processing each block of data. In a multiprogramming environment, when there is a variety of I/O activity and a variety of process activity to service, buffering is one of the tool that can increase the efficiency of the OS and the performance of individual processes.

Disk I/O The speed of processors and main memory has far outstripped that of disk access. The disk is about four order of magnitude slower than main memory. Disk Performance Parameters: –Seek time Seek time is the time required to move the disk arm to the required track. Seek time consists of two components: the initial startup and the time taken to traverse the cylinders that have to be crossed once the access arm is up to speed. The traverse time is not a linear function of the number of tracks. Ts = m X n + s where Ts = seek time, n = # of tracks traversed, m is a constant depends on the disk drive, and s = startup time.

Disk I/O (continue) –Rotational delay Disks, other than floppy disks, rotate at 3600 rpm, which is one revolution per 16.7 msec. On the average, the rotational delay will be 8.3 msec. Floppy disks rotate much more slowly, between 300 and 600 rpm. The average delay for floppy will then be between 100 and 200 msec. –Data transfer time Data transfer time depends on the rotation speed of the disk. T = b / (r X N) where T = Data transfer time, b = # of bytes to be transferred, N = # of bytes on a track, r = rotation speed in revolution per second. –Total average access time can be expressed as –Taccess = Ts + 1/2r + b/rN where Ts is the seek time.

A Timing Comparison Consider a typical disk with a seek time of 20 msec, a transfer rate of 1 MB/sec, and 512-byte sectors with 32 sectors per track. Suppose that we wish to read a file consisting of 256 sectors for a total of 128 Kbyte. What is the total time for the transfer? Sequential organization –The file is on 8 adjacent tracks: 8 tracks X 32 sectors/track = 256 sectors –Time to read the first track: seek time: 20 msec rotation delay: 8.3 msec read a track (32 sectors): 16.7 msec time needed: 45 msec –The remaining tracks can now be read with “essentially” no seek time. –Since it need to deal with rotational delay for each succeeding track, each successive track is read in = 25 msec. –Total transfer time = X 25 = 220 msec = 0.22 sec.

A Timing Comparison (continue) –Random access (the sectors are distributed randomly over the disk) For each sector: –seek time: 20 msec –rotational delay: 8.3 msec –read 1 sector: 0.5 msec –time needed for reading 1 sector: 28.8 msec Total transfer time = 256 X 28.8 = 7373 msec = 7.37 sec! –It is clear that the order in which sectors are read from the disk has a tremendous effect on I/O performance. –There are ways to control over the data / sector placement for a file. –However, the OS has to deal with multiple I/O requests competing for the same files. –Thus, it is important to study the disk scheduling policies.