© 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.
Disks Disk Hardware (1) Disk parameters for the original IBM PC floppy disk and a Western Digital WD hard disk.
I/O Management and Disk Scheduling
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.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
Input/Output Management and Disk Scheduling
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.
I/O Devices and Drivers
5 Device Management.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
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.
© 2009, D. J. Foreman 1 Computer Organization. © 2009, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
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: )
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
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.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Disk and I/O Management
Copyright ©: Nahrstedt, Angrave, Abdelzaher
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.
1 File System Implementation Operating Systems Hebrew University Spring 2010.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
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.
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.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
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.
© 2005 Pearson Addison-Wesley. All rights reserved Figure 2.1 This chapter focuses on key hardware layer components.
© 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.
CS552 Overview © 2009, D. J. Foreman1. Generalized O/S structure Basic interrupt handler – Determines cause – Uses branch table to specific handler I/O.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
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.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
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
Sarah Diesburg Operating Systems CS 3430
Input/Output Devices ENCE 360
Lecture 45 Syed Mansoor Sarwar
Computer Architecture
Operating Systems Chapter 5: Input/Output Management
Computer Organization
Outline Device Management Device Manager Design Buffering
Secondary Storage Management Hank Levy
Device Mgmt © 2004, D. J. Foreman.
Device Mgmt © 2004, D. J. Foreman.
Andy Wang Operating Systems COP 4610 / CGS 5765
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 operations ■ read, write, seek, control  Direct vs Sequential ■ Disks vs tapes, printers, etc  Block vs Character ■ Disk vs keyboard  Blocking vs Non-blocking

© 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 a wait  Devices are independent  Multitasking (or threading) is possible  Why not overlap I/O with CPU  Threads can decide when to wait  Non-thread programs can also decide  System throughput is increased

© 2004, D. J. Foreman 7 Driver/Kernel Interface  Drivers 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 ■ no devices get started until time-slice used up ■ Only one process/thread gets service  I/O bound processes ■ CPU under-utilized  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

© 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 MS-bootable disk layout 0x00-0x02 jump inst to 0x1e 0x03-0x0aPC manufacturer name 0x0b-0x0csectors/cluster 0x0d-0x0freserved for boot record 0x10-0x10# of FAT's 0x11-0x12# root directory entries 0x13-0x14# logical sectors 0x15-0x15media descriptor 0x16-0x17sectors/FAT 0x18-0x19sectors/track 0x1a-0x10b # surfaces (heads) 0x1c-0x1d# hidden sectors 0x1e-…boot program

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

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