Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.

Slides:



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

Chapter 6 I/O Systems.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2003 Chapter 11 Ethernet Evolution: Fast and Gigabit Ethernet.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
FIGURE 3.1 System for illustrating Boolean applications to control.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
Chapter 5 Input/Output 5.1 Principles of I/O hardware
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Figure 12–1 Basic computer block diagram.
Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.
I/O Management and Disk Scheduling
Mehdi Naghavi Spring 1386 Operating Systems Mehdi Naghavi Spring 1386.
Disk Scheduling Because Disk I/O is so important, it is worth our time to Investigate some of the issues involved in disk I/O. One of the biggest issues.
Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook.
CT213 – Computing system Organization
Operating systems Disk Management.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
I/O and Networking Fred Kuhns
CSI 400/500 Operating Systems Spring 2009 Lecture #14 – Device Management and Drivers Monday, March 23 rd, 2009.
Device Management.
I/O Systems.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
IP Multicast Information management 2 Groep T Leuven – Information department 2/14 Agenda •Why IP Multicast ? •Multicast fundamentals •Intradomain.
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
© 2012 National Heart Foundation of Australia. Slide 2.
I/O Management and Disk Scheduling
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 2 Networking Fundamentals.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Processes Management.
Designing Embedded Hardware 01. Introduction of Computer Architecture Yonam Institute of Digital Technology.
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2001 Chapter 16 Integrated Services Digital Network (ISDN)
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
Compiler Construction
5 Device Management.
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.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Device Management. Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.
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.
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.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
© 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.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Outline Device Management Device Manager Design Buffering
Device Mgmt © 2004, D. J. Foreman.
Device Mgmt © 2004, D. J. Foreman.
Presentation transcript:

Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management

Slide 5-2 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 The Device Driver Interface Device Interface … write(…); … Terminal Driver Terminal Driver Printer Driver Printer Driver Disk Driver Disk Driver Terminal Controller Terminal Controller Printer Controller Printer Controller Disk Controller Disk Controller

Slide 5-3 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Device Management Organization Application Process Application Process File Manager File Manager Device Controller Command Status Data Hardware Interface System Interface Device-Independent Device-Dependent

Slide 5-4 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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)

Slide 5-5 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-6 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Overlapping the Operation of a Device and the CPU 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)...

Slide 5-7 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Overlapping CPU-Controller Operations in a Process App I/O Ctlr t1t1 t2t2 t3t3 t4t4 t5t5 t6t6 t7t7 t8t8 t9t9

Slide 5-8 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Overlapping Processing and I/O App 1 App 2 I/O Ctlr t1t1 t2t2 t3t3 t4t4

Slide 5-9 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Polling I/O Read Operation read(device, …); Data Device Controller Command Status Data read function write function Hardware Interface System Interface

Slide 5-10 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Interrupt-driven I/O Operation 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

Slide 5-11 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Device Independent Function Call func i (…) Trap Table dev_func_i(devID, …) { // Processing common to all devices … switch(devID) { case dev0:dev0_func_i(…); break; case dev1:dev1_func_i(…); break; … case devM:devM_func_i(…); break; }; // Processing common to all devices … }

Slide 5-12 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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)

Slide 5-13 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Reconfigurable Device Drivers Other Kernel services Other Kernel services Entry Points for Device j open(){…} read(){…} etc. System call interface Driver for Device j

Slide 5-14 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Handling Interrupts int read(…) { // Prepare for I/O save_state(J); outdev# // Done (no return) } Device driver J Device Controller Interrupt Handler void dev_handler(…) { get_state(J); //Cleanup after op signal(dev[j]); return_from_sys_call(); } Device interrupt handler J J Device status table

Slide 5-15 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Handling Interrupts(2) int read(…) { … outdev# // Return after interrupt wait(dev[J}); return_from_sys_call(); } Device driver J Device Controller Interrupt Handler void dev_handler(…) { //Cleanup after op signal(dev[j]); } Device interrupt handler J

Slide 5-16 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-17 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Double Buffering in the Driver Process Controller B Device A Process Controller B Device A BABA Hardware Driver

Slide 5-18 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Circular Buffering From data producer To data consumer Buffer i Buffer j

Slide 5-19 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 A Generic Communications Device Generic Controller Generic Controller Local Device Local Device Communications Controller Communications Controller Device Cabling connecting the controller to the device Printer Modem Network Bus

Slide 5-20 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Rotating Media Track (Cylinder) Sector (a) Multi-surface Disk(b) Disk Surface(b) Cylinders Cylinder (set of tracks)

Slide 5-21 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-22 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-23 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-24 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-25 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-26 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.

Slide 5-27 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-28 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-29 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-30 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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

Slide 5-31 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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...)

Slide 5-32 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 MS Disk Description

Slide 5-33 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 NT Driver Organization

Slide 5-34 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 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