Operating Systems Input/Output Devices (Ch12.1 - 12.3, 12.7; 13.1-13.3, 13.7)

Slides:



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

Chapter 5 Input/Output 5.1 Principles of I/O hardware
Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
Part 5 (Stallings) Input/Output 5.1 Principles of I/O hardware
EEE 435 Principles of Operating Systems Principles and Structure of I/O Software (Modern Operating Systems 5.2 & 5.3) 5/22/20151Dr Alain Beaulieu.
Input/Output Management and Disk Scheduling
04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Based on the slides supporting the text
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.
Ceng Operating Systems 5-1 Chapter 5 : Input & Output I/O hardware (classification, device drivers) I/O techniques (programmed, interrupt driven,
Operating Systems Operating System Support for Continuous Media.
Avishai Wool lecture Introduction to Systems Programming Lecture 9 Input-Output Devices.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 3 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
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.
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.
Operating Systems COMP 4850/CISG 5550 Disks, Part II Dr. James Money.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
Chapter 5 : Input & Output
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.
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.
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.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Sistem Operasi IKH311 Masukan Luaran (Input/Output)
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
Device Drivers CPU I/O Interface Device Driver DEVICECONTROL OPERATIONSDATA TRANSFER OPERATIONS Disk Seek to Sector, Track, Cyl. Seek Home Position.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
I/O Devices. Characteristics of I/O Devices  Block Devices  Information are stored and accessed in fixed-size blocks  Addressable, can have sequential.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
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.
Input/Output Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
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.
I/O Software CS 537 – Introduction to Operating Systems.
Part IVI/O Systems Chapter 13: I/O Systems. I/O Hardware a typical PCI bus structure 2.
Magnetic Disks Have cylinders, sectors platters, tracks, heads virtual and real disk blocks (x cylinders, y heads, z sectors per track) Relatively slow,
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Introduction to Operating Systems Concepts
I/O Management.
Multiple Platters.
Input/Output Devices ENCE 360
Operating System I/O System Monday, August 11, 2008.
Computer-System Architecture
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
CS703 - Advanced Operating Systems
Module 2: Computer-System Structures
CSE451 File System Introduction and Disk Drivers Autumn 2002
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Presentation transcript:

Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)

Introduction F One OS function is to control devices –significant fraction of code (80-90% of Linux) F Want all devices to be simple to use –convenient –ex: stdin/stdout, pipe, re-direct F Want to optimize access to device –efficient –devices have very different needs

Outline F Introduction  F Hardware  F Software F Specific Devices –Hard disk drives –Clocks –Terminals

Hardware F Types of I/O devices F Device controllers F Direct Memory Access (DMA)

I/O Device Types F block - access is independent –ex- disk F character - access is serial –ex- printer, network F other –ex- clocks (just generate interrupts)

Device Controllers F Mechanical and electronic component CPUMemory Disk Controller Printer Controller System bus The quick brown fox jumped over the lazy dogs. The quick brown fox... F OS deals with electronic –device controller Mechanical Electronic

Direct Memory Access (DMA) F Very Old –Controller reads from device –OS polls controller for data F Old –Controller reads from device –Controller interrupts OS –OS copies data to memory F DMA –Controller reads from device –Controller copies data to memory –Controller interrupts OS

Outline F Introduction  F Hardware  F Software  F Specific Devices –Hard disk drives –Clocks –Terminals

I/O Software Structure F Layered User Level Software Device Independent Software Device Drivers Interrupt Handlers Hardware (Talk from bottom up)

Interrupt Handlers CPU 1) Device driver initiates I/O (CPU executing, checking for interrupts between instructions) 3) Receives interrupt, transfer to handler 4) Handler processes (Resume processing) I/O Controller 1) Initiates I/O (I/O device processing request) 2) I/O complete. Generate interrupt.

Interrupt Handler F Make interrupt handler as small as possible –interrupts disabled F Do minimal amount of work –defer rest until later in the rest of the device driver –deferred procedure call F Implementation specific –3rd party vendors

Device Drivers F Device dependent code –includes interrupt handler F Accept abstract requests –ex: “read block n ” F See that they are executed by device hardware –registers –hardware commands F After error check –pass data to device-independent software

Device-Independent I/O Software F Much driver code independent of device F Exact boundary is system-dependent –sometimes inside for efficiency F Perform I/O functions common to all devices F Examples: –naming protection block size –buffering storage allocation error reporting

User-Space I/O Software  Ex: count = write(fd, buffer, bytes); F Put parameters in place for system call F Can do more: formatting –printf(), gets() F Spooling –spool directory, daemon –ex: printing, USENET

I/O System Summary User Processes Device Independent Software Device Drivers Interrupt Handlers Hardware I/O Request I/O Reply Make I/O call; Format I/O; Spooling Naming, protection, blocking, buffering, allocation Setup device registers; check status Wakeup driver when I/O completed Perform I/O operation

Outline F Introduction  F Hardware  F Software  F Specific Devices  –Hard disk drives –Clocks –Terminals

Hard Disk Drives (HDD) F Controller often on disk F Cache to speed access

HDD - Zoom –Platters u ,000 RPM (floppy 360 RPM) –Tracks –Cylinders –Sectors Ex: hdb: Conner Peripherals 540MB CFS540A, 516MB w/64kB Cache, CHS=1050/16/63 –1050 cylinders (tracks), 16 heads (8 platters), 63 sectors per track F Disk Arms all move together F If multiple drives –overlapping seeks but one read/write at a time

Disk Arm Scheduling F Read time: –seek time (arm to cylinder) –rotational delay (time for sector under head) –transfer time (takes bits off disk) F Seek time dominates F How does disk arm scheduling affect seek?

First-Come First-Served (FCFS) F =53 F Service requests in order that they arrive F Little can be done to optimize F What if many requests? x xx x x x x Time

Shortest Seek First (SSF) F = 23 F Suppose many requests? –Stay in middle –Starvation! x xx x x x x Time

Elevator (SCAN) F = 31 F Usually, a little worse than SSF F C-SCAN has less variance F Note, seek getting faster, rotational not –Someday, change algorithms x xx x x x x Time

Redundant Array of Inexpensive Disks (RAID) F Pull data in parallel F For speed F For fault-tolerance –Example: 38 disks –Form 32 bit word, 6 check bits CPU

Error Handling F Common errors: –programming error (non-existent sector) –transient checksum error (dust on head) –permanent checksum error (bad block) –seek error (arm went to wrong cylinder) –controller error (controller refuses command)

Clock Hardware F Time of day to time quantum Crystal Oscillator Pulse from 5 to 300 MHz Decrement counter when == 0 - generate interrupt Holding register to load counter Can control clock ticks

Clock Software F Clock driver uses hardware for OS –time of day u 64-bit, in seconds, or relative to boot –interrupt after quantum –accounting of CPU usage u separate timer or pointer to PCB –alarm() system calls u separate clock or linked list of alarms with ticks