1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.

Slides:



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

I/O Management and Disk Scheduling
Chapter 6 I/O Systems.
I/O Management and Disk Scheduling
I/O Management and Disk Scheduling
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.
Input/Output Management and Disk Scheduling
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
Operating Systems 1 K. Salah Module 5.0: I/O and Disks I/O hardware Polling and Interrupt-driven I/O DMA Bock and character devices Blocking and nonblocking.
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.
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)
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
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.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
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.
Device Management.
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
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Device Management. Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
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
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.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
1 Comp 104: Operating Systems Concepts Devices. 2 Today Devices –Introduction –Handling I/O Device handling Buffering and caching.
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.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
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.
O VERVIEW OF M ASS S TORAGE S TRUCTURE Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 250 times per second.
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.
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.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 13: I/O Systems.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems Overview I/O Hardware Application.
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.
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.
Device Management Mark Stanovich Operating Systems COP 4610.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
Chapter 9 I/O System. 2 Input/Output System I/O Major objectives are: Take an application I/O request and send it to the physical device. Then, take whatever.
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.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
10/15: Lecture Topics Input/Output –Types of I/O Devices –How devices communicate with the rest of the system communicating with the processor communicating.
1 Input / Output. Today: I/O Systems How does I/O hardware influence the OS? What I/O services does the OS provide? How does the OS implement those services?
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Module 12: I/O Systems I/O hardware Application I/O Interface
I/O System Chapter 5 Designed by .VAS.
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

1 Today I/O Systems Storage

2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers

3 Connection to CPU Devices connect to ports or system bus: Allows devices to communicate w/CPU Controller: electronics to operate a port, bus or device Communication between controller & CPU: Ports (programmed I/O) Direct-Memory Access (DMA)

4 Ports (a.k.a. Programmed I/O) CPU gives command/data to controller through registers 4 registers Status indicates device busy, data ready, error Control indicates command to perform Data-in read by CPU to get input from device Data-out written by CPU to device Handshaking between CPU & controller Controller: clear busy bit (status) for new command CPU: set command-ready bit (command)

5 Polling: An Example CPU wants to write a byte to a device CPU: Busy-wait until status = idle Set command-ready bit, write to data-out register Controller: Reads command register set status = busy Read from data-out register, does I/O to device Change status to idle or error

6 Interrupts Avoids busy waiting Device interrupts CPU when I/O operation is complete CPU detects interrupt (sense interrupt-request line) after each instruction On interrupt: Determine which device caused interrupt Interrupt vector to dispatch interrupt to correct handler

7 Interrupt-driven I/O Cycle

8 DMA Ports (“programmed I/O”) Fine for small amounts of data, low-speed Too expensive for large data transfers! Solution: Direct Memory Access (DMA) Offload CPU large data transfers by a special- purpose processor (DMA handler) DMA interrupts CPU when entire transfer complete

9 Steps in DMA Transfer CPU writes a DMA command block into memory Pointer to source, destination, # of bytes for the transfer CPU writes address of command block to DMA controller DMA controller directly performs transfer without help from CPU Handshaking between DMA controller & device controller DMA interrupts CPU when entire transfer complete

10 I/O – Outline I/O Systems I/O hardware basics I/O Services Buffering & Caching

11 Low-Level Device Characteristics Transfer unit: character, block Access method: sequential, random Sharing: dedicated, sharable (by multiple threads/processes) Speed: a few bytes to gigabytes per second I/O direction: read-only, write-only, read-write Examples: terminal, CD-ROM, modem, keyboard, tape, graphics controller

12 Application I/O Interface High-level abstractions to hide device details Block devices (read, write, seek) Also memory-mapped File abstraction Character-stream devices (get, put) Keyboard, printers, etc. Network devices (socket connections) Blocking & non-blocking Blocking: wait until operation completes Non-blocking: returns immediately (or after timeout) with whatever data is available (none, some, all)

13 I/O – Outline I/O Systems I/O hardware basics Services provided by OS Buffering & Caching

14 I/O Buffering Buffer = memory area to store data temporarily Disk buffer: stores block when read from disk DMA: transferred over bus by DMA controller into buffer in physical memory

15 Why Buffering? Speed mismatches between device, CPU Compute contents of display in buffer (slow), send buffer to screen (fast) Different data transfer sizes ftp brings file over network one packet at a time, stores to disk one block at a time Minimizes time user process blocks on write Copy data to kernel buffer, return to user Kernel: writes from buffer to disk at later time

16 Caching Cache: region of fast memory that holds copy of data Example: CPU cache, TLB Cache write policies Write-through Write to memory & disk (high reliability) Write-back Write only to memory (committing later) Trade-off between speed & reliability

17 I/O Summary I/O expensive for several reasons: Slow devices & slow communication links Contention from multiple processes Approaches to improving performance: Caching – reduces data copying Reduce interrupt frequency via large data transfers DMA controllers – offload computation from CPU

18 Storage Goal: Improve performance of storage systems (i.e., the disk) Disk Head Scheduling

19 Disk Operations Disks are SLOW! 1 disk seek = 40,000,000 cycles Latency: Seek – position head over track/cylinder Rotational delay – time for sector to rotate underneath head Bandwidth: Transfer time – move bytes from disk to memory

20 Calculating Disk Operations Time Read/write n bytes: Can’t reduce transfer time Can we reduce latency? I/O time = seek + rotational delay + transfer(n)

21 Reducing Latency Minimize seek time & rotational latency: Smaller disks Faster disks Sector size tradeoff Scheduling

22 Disk Head Scheduling Schedule order of disk accesses Reduce length & number of seeks Algorithms FCFS SSTF SCAN, C-SCAN LOOK, C-LOOK

23 FCFS First-come, first-serve Example: disk tracks – (65, 40, 18, 78) assume head at track 50 Total seek time? = disk I/O time = seek + rotational delay + transfer(n)

24 SSTF Shortest-seek-time first (like SJF) Example: disk tracks – (65, 40, 18, 78) assume head at track 50 Total seek time? = 92 Is this optimal? disk I/O time = seek + rotational delay + transfer(n)

25 SCAN Always move back and forth across disk a.k.a. elevator Example: disk tracks – (65, 40, 18, 78) assume head at track 50, moving forwards, total 100 cylinders Total seek time? =132 When is this good? disk I/O time = seek + rotational delay + transfer(n)

26 C-SCAN Circular SCAN: Go back to start of disk after reaching end Example: disk tracks – (65, 40, 18, 78) assume head at track 50, moving forwards, total 100 cylinders Total seek time? =190 Can be expensive, but more fair disk I/O time = seek + rotational delay + transfer(n)

27 LOOK variants Instead of going to end of disk, go to last request in each direction SCAN, C-SCAN → LOOK, C-LOOK

28 Exercises 200 cylinders, currently at 140, moving forwards (5, 15, 90, 180, 80, 10 ) FCFS SSTF SCAN LOOK C-SCAN C-LOOK Find sequence & total seek time First = 0, last = 200

29 Solutions