Avishai Wool lecture 8 - 1 Introduction to Systems Programming Lecture 8 Input-Output.

Slides:



Advertisements
Similar presentations
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Advertisements

Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
CS-334: Computer Architecture
Part 5 (Stallings) Input/Output 5.1 Principles of I/O hardware
1 Input/Output Chapter Principles of I/O hardware 5.2 Principles of I/O software 5.3 I/O software layers 5.4 Disks 5.5 Clocks 5.6 Character-oriented.
EEE 435 Principles of Operating Systems Principles and Structure of I/O Software (Modern Operating Systems 5.2 & 5.3) 5/22/20151Dr Alain Beaulieu.
Lecture 7b I/O. I/O devices  Device (mechanical hardware)  Device controller (electrical hardware)  Device driver (software)
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Paging Design Input-Output.
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.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
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.
Chapter 5 Input/Output I/O Hardware I/O Software Software Layers Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights.
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
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Input / Output CS 537 – Introduction to Operating Systems.
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.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
1 I/O and Filesystems. 2 How to provide interfaces Rough reading guide (no exam guarantee): Tanenbaum Ch. 5.1 – 5.5 & Silberschatz Ch. 13 & ,
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Sistem Operasi IKH311 Masukan Luaran (Input/Output)
I/O Systems I/O Hardware Application I/O Interface
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.
CSC 322 Operating Systems Concepts Lecture - 23: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
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.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
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.
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 5 Input/Output 5.1 Principles of I/O hardware
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.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 2 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
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
بسم الله الرحمن الرحيم MEMORY AND I/O.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Practical Session 12 Input &Output (I/O). I/O Device Input / Output (I/O) devices Input / Output (I/O) devices provide the means to interact with the.
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.
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 Management.
Multiple Platters.
Operating Systems (CS 340 D)
CS 286 Computer Organization and Architecture
CS703 - Advanced Operating Systems
CSCI 315 Operating Systems Design
© CHAROTAR INSTITUTE OF TECHNOLOGY, CHANGA
I/O Systems I/O Hardware Application I/O Interface
Operating Systems Chapter 5: Input/Output Management
CS703 - Advanced Operating Systems
Chapter 5: I/O Systems.
Chapter 13: I/O Systems.
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Presentation transcript:

Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output

Avishai Wool lecture Devices, Controllers, and I/O Architectures

Avishai Wool lecture I/O Device Types Block Devices –block size of bytes –block can be read/written individually –typical: disks / floppy / CD Character Devices –delivers / accepts a sequential stream of characters –non-addressable –typical: keyboard, mouse, printer, network Other: Monitor, Clock

Avishai Wool lecture Typical Data Rates

Avishai Wool lecture Device Controllers I/O devices have components: –mechanical component –electronic component The electronic component is the device controller –may be able to handle multiple devices Controller's tasks –convert serial bit stream to block of bytes –perform error correction as necessary –make available to main memory

Avishai Wool lecture Communicating with Controllers Controllers have registers to deliver data, accept data, etc. Option 1: special I/O commands, I/O ports in r0, 4 “4” is not memory address 4, it is I/O port 4 Option 2: I/O registers mapped to memory addresses

Avishai Wool lecture Memory-Mapped Registers Controller connected to the bus Has a physical “memory address” like B When this address appears on the bus, the controller responds (read/write to its I/O register) RAM configured to ignore controller’s address

Avishai Wool lecture Possible I/O Register Mappings Separate I/O and memory space (IBM 360) Memory-mapped I/O (PDP-11) Hybrid (Pentium, 640K-1M are for I/O)

Avishai Wool lecture Advantages of Memory Mapped I/O No special instructions, can be written in C. Protection by not putting I/O memory in user virtual address space. All machine instructions can access I/O: LOOP: test *b // check if port_4 is 0 beq READY branch LOOP READY:...

Avishai Wool lecture Disadvantages of Memory Mapped I/O Memory and I/O controllers have to be on the same bus: –modern architectures have separate memory bus! –Pentium has 3 buses: memory, PCI, ISA

Avishai Wool lecture Bus Architectures (a) A single-bus architecture (b) A dual-bus memory architecture

Avishai Wool lecture Memory Mapped with Separate Bus I/O Controllers do not see memory bus. Option 1: all addresses to memory bus. No response  I/O bus Option 2: Snooping device between buses –speed difference is a problem Option 3 (Pentium): filter addresses in PCI bridge

Avishai Wool lecture Structure of a large Pentium system

Avishai Wool lecture Principles of I/O Software

Avishai Wool lecture Goals of I/O Software Device independence –programs can access any I/O device –without specifying device in advance ·(floppy, hard drive, or CD-ROM) Uniform naming –name of a file or device a string or an integer –not depending on which machine Error handling –handle as close to the hardware as possible

Avishai Wool lecture Goals of I/O Software (2) Synchronous vs. asynchronous transfers –blocked transfers vs. interrupt-driven Buffering –data coming off a device cannot be stored in final destination Sharable vs. dedicated devices –disks are sharable –tape drives would not be

Avishai Wool lecture How is I/O Programmed Programmed I/O Interrupt-driven I/O DMA (Direct Memory Access)

Avishai Wool lecture Programmed I/O Steps in printing a string

Avishai Wool lecture Polling Busy-waiting until device can accept another character Example assumes memory- mapped registers

Avishai Wool lecture Properties of Programmed I/O Simple to program Ties up CPU, especially if device is slow

Avishai Wool lecture Interrupts Revisited bus

Avishai Wool lecture Interrupt-Driven I/O Code executed when print system call is made Interrupt service procedure

Avishai Wool lecture Properties of Interrupt-Driven I/O Interrupt every character or word. Interrupt handling takes time. Makes sense for slow devices (keyboard, mouse) For fast device: use dedicated DMA controller –usually for disk and network.

Avishai Wool lecture Direct Memory Access (DMA) DMA controller has access to bus. Registers: –memory address to write/read from –byte count –I/O port or mapped-memory address to use –direction (read from / write to device) –transfer unit (byte or word)

Avishai Wool lecture Operation of a DMA transfer

Avishai Wool lecture I/O Using DMA code executed when the print system call is made interrupt service procedure

Avishai Wool lecture DMA with Virtual Memory Most DMA controllers use physical addresses What if memory of buffer is paged out during DMA transfer? Force the page to not page out (“pinning”)

Avishai Wool lecture Burst or Cycle-stealing DMA controller grabs bus for one word at a time, it competes with CPU bus access. This is called “cycle-stealing”. In “burst” mode the DMA controller acquires the bus (exclusively), issues several transfers, and releases. –More efficient –May block CPU and other devices

Avishai Wool lecture Concepts for review TLB Local/Global page replacement Demand paging Page-fault-frequency monitor I/O device controller in/out commands Memory-mapped registers PCI Bridge Programmed I/O (Polling) Interrupt-driven I/O I/O using DMA Page pinning DMA cycle-stealing DMA burst mode