Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 13: I/O Systems.

Slides:



Advertisements
Similar presentations
I/O Systems & Mass-Storage Systems
Advertisements

Chapter 13: I/O Systems I/O Hardware Application I/O Interface
I/O and Networking Fred Kuhns
I/O Systems Operating System Concepts chapter 13 CS 355
I/O Systems.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface.
04/14/2008CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 Chapter 13: I/O Systems I/O Hardware.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 13: I/O Systems.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
04/16/2010CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying an earlier edition.
I/O Systems CS 3100 I/O Hardware1. I/O Hardware Incredible variety of I/O devices Common concepts ◦Port ◦Bus (daisy chain or shared direct access) ◦Controller.
Chapter 13 Input/Output (I/O) Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
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 Systems CSCI 444/544 Operating Systems Fall 2008.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Copyright ©: Nahrstedt, Angrave, Abdelzaher
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
CHAPTER 13: I/O SYSTEMS Overview Overview I/O Hardware I/O Hardware I/O API I/O API I/O Subsystem I/O Subsystem Transforming I/O Requests to Hardware Operations.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
NETW 3005 I/O Systems. Reading For this lecture, you should have read Chapter 13 (Sections 1-4, 7). NETW3005 (Operating Systems) Lecture 10 - I/O Systems2.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 Chapter 13: I/O Systems I/O Hardware.
Operating Systems CMPSC 473 I/O Management (1) November Lecture 23 Instructor: Bhuvan Urgaonkar.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Silberschatz, Galvin and Gagne  Operating System Concepts I/O Hardware Incredible variety of I/O devices.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-2: I/O Management (Review) Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O.
I/O Systems I/O Hardware Application I/O Interface
1 Module 12: I/O Systems n I/O hardware n Application I/O Interface n Kernel I/O Subsystem n Transforming I/O Requests to Hardware Operations n Performance.
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.
1 Comp 104: Operating Systems Concepts Devices. 2 Today Devices –Introduction –Handling I/O Device handling Buffering and caching.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 13: I/O Systems.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
Cosc 4740 Chapter 12 I/O Systems. I/O Hardware Incredible variety of I/O devices –Storage –Transmission –Human-interface.
Chapter 13: I/O Systems. 13.2/34 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 13: I/O Systems I/O Hardware Application I/O Interface.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Silberschatz, Galvin and Gagne  Operating System Concepts Six Step Process to Perform DMA Transfer.
XE33OSA Chapter 13: I/O Systems. 13.2XE33OSA Silberschatz, Galvin and Gagne ©2005 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel.
CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 Chapter 13: I/O Systems I/O Hardware.
1 Chapter 13 Input/Output (I/O) Systems Dr. İbrahim Körpeoğlu Bilkent University Department of Computer Engineering.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems Overview I/O Hardware Application.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 I/O through system calls Protection.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 13: I/O Systems.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
CMSC 421 Section 0202 I/O Systems Chapter 13: I/O Systems.
Module 11: I/O Systems Reading: Chapter 13 Objectives  Explore the structure of the operating system’s I/O subsystem.  Discuss the principles of I/O.
Chapter 13: I/O Systems.
Lecture 13 Input/Output (I/O) Systems (chapter 13)
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating Systems (CS 340 D)
Chapter 13: I/O Systems.
CSCI 315 Operating Systems Design
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 13: I/O Systems

13.2 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Performance

13.3 Objectives Explore the structure of an operating system’s I/O subsystem Discuss the principles of I/O hardware and its complexity Provide details of the performance aspects of I/O hardware and software

13.4 I/O Hardware Standard computer I/O devices Storage devices Transmission devices Human-interface devices Common concepts Communicate with rest of the system through a connection point (port) Various devices inter-connected to a common set of wired (bus) using standard protocols  Devices can be connected to bus directly, or connected to other devices that are connected to the bus (daisy chain) Devices interface to system using a hardware controller  Several devices can use the same controller

13.5 I/O Hardware PCI bus is the fastest and most common one Connects CPU/Memory to fastest devices Expansion bus used for slower or specialized devices AGP bus historically used for graphics cards Parallel ATA bus (aka IDE bus) used for storage devices

13.6 A Typical PC Bus Structure

13.7 I/O Hardware Controller has internal registers CPU communicates with device by reading/writing bytes in registers through controller’s I/O ports Data-in register to send information from the controller to the CPU Data-out register to send information from the CPU to the controller Status register to inform the CPU of the controller’s current status Command register to allow the CPU to send commands to the controller Some devices alternatively/also support memory-mapped I/O, interact with CPU through shared memory space

13.8 Perform functions Read busy bit Controller Status register Registers CPU Clear busy bit Set busy bit Read busy bit Command register Data-out register Data-in register Write command Write data for command Read busy bit Read command Clear busy bit Set busy bit Execute command Read input data Write output data Clear error bit Read output ready bit Set output ready bit Read output Polling

13.9 Interrupts Polling is very efficient Read status register + AND to extract busy bit + JNZ = 3 CPU cycles Problem: what if a device is rarely ready? Alternative: notify the CPU when a device is ready (interrupt) You need: An input line for hardware The CPU interrupt-request line Intel 80x86 has two, one maskable and one nonmaskable Priority mechanisms Lower-value interrupts have higher priority Maskable interrupts can be ignored, nonmaskable interrupts cannot

13.10 Direct Memory Access Having the CPU do polling and read/write data in data registers byte by byte is inefficient to transfer large amounts of data (programmed I/O) Wasteful of CPU time Alternative: Direct Memory Access (DMA) Bypasses CPU to transfer data directly between I/O device and memory through DMA controller CPU only needs to specify memory address and size to DMA controller DMA controller read/writes information between data registers and memory while Downside: Memory not accessible to CPU during this time  But worth the trade-off

13.11 Direct Memory Access

13.12 Application I/O Interface Great variety of I/O devices Can vary in multiple ways

13.13 Application I/O Interface Devices separated into general types Kernel define standard set of interface functions for each kind Device drivers encapsulate device-specific details OS usually also have a backdoor system call to pass arbitrary commands directly from application to device driver ( ioctl() in Unix)

13.14 Application I/O Interface Block devices (disk drives) interface read(), write() seek() if random-access is supported Abstract device as a linear array of blocks (raw I/O) Give access to application without OS buffering or locking, for applications that do this themselves (direct I/O) Character devices (keyboards) interface Single-character read and write: get(), put() Libraries of stream functions include buffering and editing Network devices Devices connect to remote address through local socket select() function returns information on a set of sockets  Which are ready to send or receive information  Eliminates need for polling for network communication

13.15 Concurrent I/O Execution Blocking: process is suspended until I/O completed Easy to implement, use, and understand Inefficient if process can continue while I/O occurs I/O execution time unpredictable Nonblocking: I/O returns after maximum delay Makes I/O execution time predictable Process needs to handle partial I/O results if I/O not completed in allocated time Multithreading Process thread continues while I/O thread blocks Asynchronous: I/O operation returns immediately I/O operation completes after return call Process notified once I/O operation is complete  Can use user interrupt, shared variable, notification function, etc.

13.16 Kernel I/O Subsystem Kernel services are essential to I/O Scheduling I/O is usually the slowest part of the system OS responsibility to schedule processes’ I/O requests for most efficient use Buffering Different devices have wildly different transfer speeds Different devices have different data-transfer sizes Copy semantics: make a copy of the data at the time of system call, so that subsequent changes to data by process do not cause a race condition Caching Keep a copy of frequently-needed data in faster memory Spooling Simultaneous Peripheral Operations On-Line Intercept and hold output for a device that can serve only one request at a time (ex.: printer), allowing the process to continue

13.17 Kernel I/O Subsystem Device reservation Provides exclusive access to a device Can cause deadlocks Error handling I/O operation can fail Error bit in status register informs system about controller’s successful execution of operation – but OS needs to check it! Many controllers also give an error code in data-in register – but again, the OS needs to check it (they seldom do) I/O protection Need to protect system from user processes misusing I/O devices I/O performed via system calls that check if the request is valid Kernel Data Structures Kernel maintains state information on usage of all I/O devices Example: the system-wide open-file table

13.18 Life Cycle of An I/O Request

13.19 Improving Performance I/O a major factor in system performance Interrupts looks smarter than polling; however Each interrupt involves two context switches Interrupt code longer than polling routine Interrupt needs to transfer data between different functions

13.20 Improving Performance How to improve performance? Reduce number of context switches Reduce data copying Reduce frequency of interrupts by using large transfers, smart controllers, polling Use DMA to minimize use of CPU in copying data Balance CPU, memory, bus, and I/O performance: overload of one causes idleness in others Move code towards hardware More specialized and efficient execution Execution by controller: frees up CPU Longer, more expensive development for less flexible or reusable code

13.21 Review What is polling? What’s the difference between a blocking, a non-blocking, and an asynchronous I/O operation?

13.22 Exercises Read everything except section 13.6 (Streams) If you have the “with Java” textbook, skip the Java sections and subtract 1 to the following section numbers

Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, End of Chapter 13