Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.

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.
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: I/O Systems I/O Hardware Application I/O Interface
I/O Systems CSCI 444/544 Operating Systems Fall 2008.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
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.
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:
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-2: I/O Management (Review) Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 13: I/O Systems.
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.
I/O Management Chapter 8.
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.
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.
Computer Studies (AL) I/O Management. Reference Silberschatz, Galvin, Gagne “Operating System Concepts 6 th edition”, 2003, Wiley Stallings, “Operating.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems Overview I/O Hardware Application.
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.
FILE SYSTEM IMPLEMENTATION 1. 2 File-System Structure File structure Logical storage unit Collection of related information File system resides on secondary.
Introduction to Operating Systems Concepts
Chapter 13: I/O Systems.
Chapter 13: I/O Systems.
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
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Chapter 13: I/O Systems Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating Systems (CS 340 D)
Operating System I/O System Monday, August 11, 2008.
CS703 - Advanced Operating Systems
Chapter 13: I/O Systems.
CSCI 315 Operating Systems Design
I/O Systems.
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
Selecting a Disk-Scheduling Algorithm
CS703 - Advanced Operating Systems
Chapter 13: I/O Systems.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems.
Chapter 12: I/O Systems.
Chapter 13: I/O Systems.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating Systems I/O System Alok Kumar Jagadev.
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3

Overview Management of I/O devices forms a major component of operating system design and operation. Some of the challenges in designing the I/O subsystem are I/O devices vary greatly and as a result various methods are needed to control them With advancement in technology, new types of devices are frequent. These challenges are met by a combination of hardware and software techniques. Kernel uses device drivers to encapsulate device details. Device drivers - are modules that can be plugged into an OS to handle a particular device or category of similar devices

I/O Hardware I/O devices can broadly be categorized as storage, communications, user-interface, and other Devices communicate with the computer: Via signals sent over wires or through the air. And through a connection point for the device called the - Port A common set of wires connecting multiple devices is termed a bus. Different types of buses shown in next slide. Controller – collection of electronics that can operate port, bus, device. Device drivers communicate with controllers for I/O requests.

A Typical PC Bus Structure PCI bus - connects the processor–memory subsystem to fast devices Expansion bus  connects relatively slow devices, such as the keyboard and serial and USB ports SCSI bus connects a number of SCSI devices to a common SCSI controller. Daisy-chain bus (not shown), when a string of devices is connected to each other like beads on a chain, and only one of the devices is directly connected to the host.

I/O Hardware (Cont.) I/O instructions control devices. Devices have addresses. Device controllers have registers where device driver places commands, addresses, and data to write, or read data from registers after command execution. Common types of registers are: Data-in register, data-out register, status register, control register Typically 1-4 bytes, or FIFO buffer

Memory Mapped I/O Device controllers support Memory-mapped I/O Device-control registers are mapped into the address space of the processor. The CPU executes I/O requests using the standard data-transfer instructions to read and write the device-control registers at their mapped locations in physical memory. Memory-mapped I/O is suitable for devices which must move large quantities of data quickly, such as graphics cards.

Polling and Interrupts Polling is constantly testing a port to see if data is available.  Polling is efficient if device is fast. Polling inefficient if host rarely finds device ready for service. In which case interrupts are used. See Chapter 1 lecture notes for details on interrupts.

Direct Memory Access For devices that transfer large quantities of data ( such as disk controllers ), it is wasteful to tie up the CPU, transferring data in and out of registers one byte at a time. Instead a special processor called (Direct Memory Access) DMA is used Bypasses CPU to transfer data directly between I/O device and memory

Application I/O Interface User application access to a wide variety of different devices This is accomplished through layering, and Through encapsulating all of the device-specific code into device drivers, While application layers are presented with a common interface for all ( or at least large general categories of ) devices

A Kernel I/O Structure

Characteristics of I/O Devices Devices differ on many different dimensions. They are broadly grouped by the OS into the following categories: Block Devices (e.g.: hard disks) Commands include read, write, seek Character Devices (e.g. keyboard) Commands include get(), put() Network Devices Linux, Unix, Windows and many others include socket interface Clocks and Timers Provide current time, elapsed time, timer

Non-blocking and Asynchronous I/O Blocking system call - process suspended until I/O completed Process moved from ready queue to waiting queue After the system call completes, the application is moved back to the run queue Non-blocking system call - I/O call returns as much as available User interface, data copy (buffered I/O) Implemented via multi-threading Asynchronous system call - process runs while I/O executes The completion of the I/O at some future time is communicated to the application Vectored I/O allows one system call to perform multiple I/O operations

Kernel I/O Subsystem Kernels provide many services related to I/O Scheduling - determine a good order of I/O requests for execution. asynchronous I/O – Kernel must be able to keep track of many I/O requests at the same time. To do this the OS might attach the wait queue to a device-status table Buffering - store data in memory while transferring between devices To cope with device speed mismatch To cope with device transfer size mismatch To maintain “copy semantics” Double buffering – two buffers to store data, to increase efficiency and throughput. This double buffering decouples the producer of data from the consumer, thus relaxing timing requirements between them.

Device-status Table

Kernel I/O Subsystem Caching - faster device holding copy of data Always just a copy Key to performance Sometimes combined with buffering Spooling – A spool is a buffer that holds output for a device that cannot accept interleaved data streams E.g.: Printer Device reservation - provides exclusive access to a device System calls for allocation and de-allocation Watch out for deadlock

Kernel I/O Subsystem Cont… Error Handling Operating systems can often compensate effectively for transient failures. Retry a read or write, for example Most system call return an error number or code when I/O request fails System error logs hold problem reports Protection User process may accidentally or purposefully attempt to disrupt normal operation via illegal I/O instructions All I/O instructions defined to be privileged I/O must be performed via system calls

Kernel I/O Subsystem Cont… Kernel Data Structures Kernel keeps state info for I/O components, including open file tables, network connections, character device state etc. Many, many complex data structures to track buffers, memory allocation, “dirty” blocks Some use object-oriented methods and message passing to implement I/O

I/O Requests to Hardware Operations Consider reading a file from disk for a process: Determine device holding file Translate name to device representation Physically read data from disk into buffer Make data available to requesting process Return control to process

Life Cycle of An I/O Request

End of Chapter 13