Device Management. Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.

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
Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook.
CT213 – Computing system Organization
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
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
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.
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 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.
I/O Systems CSCI 444/544 Operating Systems Fall 2008.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
INPUT-OUTPUT ORGANIZATION
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
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.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
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.
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
1 Comp 104: Operating Systems Concepts Devices. 2 Today Devices –Introduction –Handling I/O Device handling Buffering and caching.
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.
Device Drivers CPU I/O Interface Device Driver DEVICECONTROL OPERATIONSDATA TRANSFER OPERATIONS Disk Seek to Sector, Track, Cyl. Seek Home Position.
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.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
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.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Device Driver Concepts Digital UNIX Internals II Device Driver Concepts Chapter 13.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
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.
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.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Input/Output (I/O) Important OS function – control I/O
I/O techniques - Interfacing
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Sarah Diesburg Operating Systems CS 3430
Input/Output Devices ENCE 360
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
CS703 - Advanced Operating Systems
Outline Device Management Device Manager Design Buffering
Device Mgmt © 2004, D. J. Foreman.
Device Mgmt © 2004, D. J. Foreman.
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Device Management

Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.

Serial Port RS-232 Interface 9-pin connector 4-wires bit transmit/receive... Serial Device (UART) UART API parity bits per byte etc. Device Driver Set UART parms read/write ops Interrupt hander Software on the CPU Device Driver API Bus Interface

Adding a Modem Serial Device Serial Device Memory CPU Modem Phone Switched Telephone Network Dialing & connecting Convert analog voice to/from digital Convert bytes to/from bit streams Transmit/receive protocol

Serial Communication Modem RS-232 Serial Device Device Driver Set UART parms read/write ops Interrupt hander Driver-Modem Protocol Dialing & connecting Convert analog voice to/from digital Convert bytes to/from bit streams Transmit/receive protocol

Comm Device Comm Device Memory CPU Modem Phone Comm Device Comm Device Memory CPU Modem Phone Switched Telephone Network Exploiting the Phone Network Logical Communication

Data Networks Network Device Network Device Memory CPU Network Device Network Device Memory CPU Data Network Logical Communication Technology focus includes protocols and software (more on this later … Chapter 15 and beyond...)

Rotating Storage Track (Cylinder) Sector Top View of a Surface

MS Disk Description

Storage Device Magnetic Disk (SCSI) Controller Driver Get disk description Set SCSI parms read/write ops Interrupt hander SCSI API commands bits per byte etc. Device Driver API

Device Management Organization Application Process Application Process File Manager File Manager Device Driver Device Driver Device Controller Command Status Data Hardware Interface System Interface

System Call Interface Functions available to application programs Abstract all devices (and files) to a few interfaces Make interfaces as similar as possible –Block vs character –Sequential vs direct access Device driver implements functions (one entry point per API function)

Example: BSD UNIX Driver open Prepare dev for operation close No longer using the device ioctl Character dev specific info read Character dev input op write Character dev output op strategy Block dev input/output ops select Character dev check for data stop Discontinue a stream output op

Read with Polling read(device, …); Data Device Controller Command Status Data read function write function Hardware Interface System Interface

Read Using Interrupts read(device, …); Data Device Controller Command Status Data read driver write driver Hardware Interface System Interface Device Status Table Device Handler Device Handler Interrupt Handler Interrupt Handler 6 7 8a 8b 9

Driver-Kernel Interface Drivers are distinct from main part of kernel Kernel makes calls on specific functions, drivers implement them Drivers use kernel functions for: –Device allocation –Resource (e.g., memory) allocation –Scheduling –etc. (varies from OS to OS)

Reconfigurable Drivers Other Kernel services Other Kernel services Entry Points for Device j open(){…} read(){…} etc. System call interface Driver for Device j

NT Driver Organization

NT Device Drivers API model is the same as for a file Extend device management by adding modules to the stream Device driver is invoked via an Interrupt Request Packet (IRP) –IRP can come from another stream module –IRP can come from the OS –Driver must respond to minimum set of IRPs See Part I of notes

Memory Mapped I/O Primary Memory Device 0 Device 1 Device n-1 Primary Memory Device 0 Device 1 Device n-1 Device Addresses Memory Addresses

CPU-I/O Overlap Variable x Register Data on device... read(dev_I, “%d”, x); y = f(x)... Device dev_I Memory CPU... startRead(dev_I, “%d”, x);... While(stillReading()) ; y = f(x)...

I/O - CPU Overlap App 1 App 2 I/O Ctlr t1t1 t2t2 t3t3 t4t4 App I/O Ctlr t1t1 t2t2 t3t3 t4t4 t5t5 t6t6 t7t7 t8t8 t9t9 Overlapping App 1’s I/O with App 2 Overlapping App CPU with its own I/O

Direct Memory Access Primary Memory CPU Controller Device Primary Memory CPU Controller Device

Buffering Water CompanyCustomer Office Water Consumers Water Producer Delivering Water Returning the Empties Water bottles are buffers Office workers consume water from a buffer while water company fills other buffers

Hardware Buffering Process Controller Data Device Process Controller B Device A Unbuffered Process reads b i-1 Controller reads b i

Hardware Buffering Process Controller Data Device Process Controller B Device A Process Controller B Device A Unbuffered Process reads b i-1 Controller reads b i Process reads b i Controller reads b i+1

Buffering in the Driver Process Controller B Device A BA Hardware Driver

Buffering in the Driver Process Controller B Device A Process Controller B Device A BABA Hardware Driver

A Ring Buffer From data producer To data consumer Buffer i Buffer j

Compute vs I/O Bound Compute-bound I/O-bound Time

Disk Optimizations Transfer Time: Time to copy bits from disk surface to memory Disk latency time: Rotational delay waiting for proper sector to rotate under R/W head Disk seek time: Delay while R/W head moves to the destination track/cylinder Access Time = seek + latency + transfer

Optimizing Seek Time Multiprogramming on I/O-bound programs => set of processes waiting for disk Seek time dominates access time => minimize seek time across the set Tracks 0:99; Head at track 75, requests for 23, 87, 36, 93, 66 FCFS: = 251 steps

Optimizing Seek Time (cont) Requests = 23, 87, 36, 93, 66 SSTF: (75), 66, 87, 93, 36, 23 – = 107 steps Scan: (75), 87, 93, 99, 66, 36, 23 – = 100 steps Look: (75), 87, 93, 66, 36, 23 – = 87 steps

Optimizing Seek Time (cont) Requests = 23, 87, 36, 93, 66 Circular Scan: (75), 87, 93, 99, 23, 36, 66 – home = 90 + home Circular Look: (75), 87, 93, 23, 36, 66 – home = 84 + home