© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.

Slides:



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

Chapter 6 I/O Systems.
I/O Management and Disk Scheduling
I/O and Networking Fred Kuhns
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Input/Output Management and Disk Scheduling
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.
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
University of Pennsylvania 10/24/00CSE 3801 Disk Scheduling CSE 380 Lecture Note 11a Insup Lee.
04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.
5 Device Management.
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.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
Device Management.
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.
Operating Systems Input/Output Devices (Ch 5: )
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Device Management. Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
Cpr E 308 Input/Output Recall: OS must abstract out all the details of specific I/O devices Today –Block and Character Devices –Hardware Issues – Programmed.
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.
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.
1 Comp 104: Operating Systems Concepts Devices. 2 Today Devices –Introduction –Handling I/O Device handling Buffering and caching.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
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.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
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.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 13: I/O Systems.
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.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
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.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
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.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Introduction to Operating Systems Concepts
Input/Output (I/O) Important OS function – control I/O
Module 12: I/O Systems I/O hardware Application I/O Interface
Sarah Diesburg Operating Systems CS 3430
Input/Output Devices ENCE 360
Computer Architecture
I/O Systems I/O Hardware Application I/O Interface
Operating Systems Chapter 5: Input/Output Management
Operating System Concepts
Chapter 5: I/O Systems.
Computer Organization
CSE 451: Operating Systems Spring 2007 Module 15 I/O
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Outline Device Management Device Manager Design Buffering
Device Mgmt © 2004, D. J. Foreman.
Device Mgmt © 2004, D. J. Foreman.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Andy Wang Operating Systems COP 4610 / CGS 5765
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:

© 2004, D. J. Foreman 1 Device Mgmt

© 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver ■ Controller ■ Device  Tradeoffs of layering ■ Loss of efficiency ■ Increased generalization and flexibility ■ Reduced cost of maintenance and development for all (driver writers, O/S writers, app writers and users)

© 2004, D. J. Foreman 3 Device Management Organization-2 O/S API Applications Controller Firmware Devices Device Driver Device independent Device dependent read, write

© 2004, D. J. Foreman 4 The API  Simple set of abstract I/O operations ■ read, write, seek, control  Direct vs Sequential ■ Disks vs tapes, printers, etc  Block vs Character ■ Disk vs keyboard  Blocking vs Non-blocking ■ Synchronous - request I/O & wait for it ■ Asynchronous - request I/O & continue to run

© 2004, D. J. Foreman 5 Handling I/O  Polling ■ Program loops until device signals completion ■ No other program can run ■ CPU runs, but no work gets done!  Interrupt driven ■ Program starts I/O ■ Program decides to wait or not ■ O/S switches to another thread or process

© 2004, D. J. Foreman 6 Key concepts  CPU cycles are wasted during an I/O wait  Devices are independent of CPU  Why not overlap I/O with CPU? ■ Program can decide when to wait ■ System throughput can be increased

© 2004, D. J. Foreman 7 Driver/Kernel Interface  Drivers may be merged with kernel  Kernel makes function calls to drivers  Kernel functions used by drivers: ■ Device allocation ■ Resource (e.g., memory) allocation ■ Scheduling ■ Others: depends on O/S

© 2004, D. J. Foreman 8 System bottlenecks  Compute bound processes ■ very little I/O activity ■ nothing else runs until time-slice used up  I/O bound processes ■ very little CPU activity  Solution: ■ "Good" mix of applications ■ Pre-emptive scheduling (more later)

© 2004, D. J. Foreman 9 Overlapped I/O Apps t1t1 t2t2 t3t3 t4t4 t5t5 t6t6 t7t7 t8t8 t9t9 Device th1 Blockin g I/O Non- Blockin g I/O th2 P1 P2 th0 th1's time slice ends th1 & th2 overlapping

© 2004, D. J. Foreman 10 Buffering  Provides a means for speed-matching  Many methods ■ Lists 1 way, 2 way, circular ■ Arrays Fixed size Variable size Circular  Problems ■ Overflow ■ Protected access ■ Synchronization – more in another chapter

© 2004, D. J. Foreman 11 Example of using buffers Water CompanyCustomer Office Water Consumers Water Producer Delivering Water Returning the Empties Production qty? Consumption qty? Inventory Classic "Producer-Consumer"

© 2004, D. J. Foreman 12 Hardware Buffering  In the Device controller  In the Device itself = "double-buffering"  Reduces system overhead from: ■ Buffer mgmt ■ Buffer content ■ Synchronizing

© 2004, D. J. Foreman 13 Disk I/O  Goal – minimize access time ■ Mixed solution: h/w & s/w = (X + Y*K) + latency + transfer  Seek time: head movement delay ■ for 1 cylinder (X) ≈ 10 ms(device dependent) ■ For Y cylinders = Y * K (K is device dependent)  Latency: rotational delay ■ 5400R/M*1M/60s= 90R/s .01 s/R = 10ms/R ■ 7200 R/M*1M/60s=120R/s .008 s/R= 8ms/R  Transfer time: delay between disk and RAM ■ Bus speed (currently) 400 Mhz or 800 Mhz  Access Time = seek + latency + transfer

© 2004, D. J. Foreman 14 Access Algorithms  FCFS ■ No optimization  SSTF – min seek from current position ■ Starvation can occur (from local minimization)  Scan/Look ■ No starvation ■ Requests may wait a full scan (0-n-0)  Circular Scan/Look ■ No starvation ■ Requires fast-reposition to 0

© 2004, D. J. Foreman 15 Serial I/O  Must convert ■ Parallel (bytes) to serial (bit-by-bit) ■ Digital (1/0) to analog (+/- voltages)  And back again at the other end  Protocol: RS-232

© 2004, D. J. Foreman 16 Mainframe Device Mgmt CPU Channel Controller Hardware Devices

© 2004, D. J. Foreman 17 Channel programming SIOdevaddr Channel Address Word Channel Program Seek Search Read/write Device