1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.

Slides:



Advertisements
Similar presentations
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Advertisements

Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
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.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
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
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
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 I/O Management in Representative Operating Systems.
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 Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
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 5 I/O PRINCIPLE Understand the principles of System Bus
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
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.
COMP 3438 – Part I - Lecture 4 Introduction to Device Drivers Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
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.
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.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
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.
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.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
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.
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:
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
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.
Device Driver Concepts Digital UNIX Internals II Device Driver Concepts Chapter 13.
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  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.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Part IVI/O Systems Chapter 13: I/O Systems. I/O Hardware a typical PCI bus structure 2.
Amdahl’s Law & I/O Control Method 1. Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System.
Chapter 7 Input/Output and Storage Systems. 2 Chapter 7 Objectives Understand how I/O systems work, including I/O methods and architectures. Become familiar.
Introduction to Operating Systems Concepts
Input/Output (I/O) Important OS function – control I/O
Chapter 13: I/O Systems.
I/O Management.
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.
CS703 - Advanced Operating 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 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:

1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams

2 I/O hardware n bus - a set of wires and a protocol that defines the messages that can be set over the wires n controller - a collection of electronics that can operate a device (a port, a bus, a hard disk) n if controller is complex it can be implemented as a separate circuit board called adapter n note that the controllers are located on both “sides” of the bus: device controller - bus - host controller

3 (Unix) I/O Structure n To decrease complexity of I/O design Unix I/O management is layered n user applications communicate with peripheral devices via the kernel through system calls n I/O subsystem handles the I/O requests and uses the device driver interface to communicate with the devices n device driver is an independent part of the kernel that contains a collection of data structures and functions that controls one or more devices and interacts with the kernel through a well defined interface

4 Communication with controllers n Controller has a set of control and status registers (CSR) n CSRs are device-dependent n driver writes to CSRs to issue commands and reads them to obtain completion status and error information n two ways of I/O space configuration: u separate I/O space - separate (CPU) instructions are needed to move data to and from controllers u memory-mapped device I/O - CSRs are assigned regular memory addresses and data in CSRs can be manipulated by regular memory operations (like store and load); examples - video memory in PCs n two ways of transferring data between kernel and device: u programmed I/O (PIO) - data has to be written to the device byte by byte. Whenever the device is ready for the next byte it issues an interrupt; examples - printers, modems, mice, keyboards u direct memory access (DMA) – CPU just gives the description of the data to be transferred (location, size, etc.) and the DMA controller does the rest communicating with memory independently of CPU F variant - direct virtual memory access (DVMA) – controller copies data between two memory-mapped devices

5 Polling and device interrupts n The kernel communicates with devices by: u polling - CPU regularly polls CSRs of a device to check if the I/O operation has completed u interrupts - a device raises an interrupt to alert the CPU that I/O operation has completed n interrupt handler - a short self-contained routine that responds to an interrupt n interrupts can be: u polled - there is one interrupt handler that upon startup checks all the devices to see which of them needs attention u vectored - the device is assigned to a specific interrupt handler and a interrupt vector table is kept. The vector contains the addresses of interrupt handlers by the interrupts. When an interrupt is raised the vector is consulted by hardware (rather than CPU) and the corresponding interrupt handler is started

6 Interrupt flowchart

7 (Unix) device drivers n there is a variety of external devices and ways of communicating with them, to simplify programming – use device drivers u device driver – kernel module that is coded to communicate with a particular device n from the I/O subsystem’s perspective the device driver is “black box” that supports a standard set of operations (each device may implement these operations differently) n Unix supports two device types u block - stores data and performs I/O in fixed-size, randomly accessible blocks; examples - hard disks, floppy drives, CD-ROMs; due to the structured nature of the I/O operations on block devices efficient cache/buffering algorithms can be used; u character - can store and transfer arbitrary sized data. May transfer one byte at a time (generating an interrupt after every byte) or perform some internal buffering; examples - keyboard, mouse, clock, modem

8 Why STREAMS? n Kernel interacts with drivers at a very high level leaving the device driver to do most of I/O processing. It provides flexibility of the design, yet only part of the work of the driver is hardware dependent; the other part - high-level I/O processing: queue management, buffering, caching, etc. Every vendor writes their own device drivers u code duplication F large kernel F greater risk of conflict u complex drivers n This problem is especially apparent in network driver design: network protocols are complex and designed in (interchangeable layers); this suggests a modular approach to driver design

9 STREAMS n STREAMS - a full- duplex (bidirectional) data transfer path between a driver and a user application n Consists: u module - consists of a pair of queues: F read - pass data (in the form of messages) upstream - to application F write - pass messages downstream - to device u stream head - handles system calls, may block u driver end - handles interrupts, communicates to actual device n except for stream head the modules communicate asynchronously: module code may be executed in the context of different process

10 Reusing modules n TCP/IP protocol stack consists of a layers of protocols where an entity on one layer communicates with a peer entity on the same layer and provides services to the upper layer protocol and utilizes services of the lower layer without concern to its internal structure n using streams modules can be assembled to fit the network configuration: note how IP module is reused

11 I/O request flowchart and hierarchy