Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Similar documents
Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. (done)

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

I/O Hardwares. Some typical device, network, and data base rates

CSE 380 Computer Operating Systems

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

CSCI-GA Operating Systems. I/O : Disk Scheduling and RAID. Hubertus Franke

CSE380 - Operating Systems. Communicating with Devices

Chapter 5 Input/Output

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Hard Disk Drives (HDDs)

Input Output (IO) Management

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Outline. Operating Systems: Devices and I/O p. 1/18

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College

Operating Systems. V. Input / Output

UNIT 4 Device Management

Operating Systems. V. Input / Output. Eurecom

2. Which of the following resources is not one which can result in deadlocking processes? a. a disk file b. a semaphore c. the central processor (CPU)

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

Operating Systems 2010/2011

Input/Output Management

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices.

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

OPERATING SYSTEMS CS136

Lecture 21 Disk Devices and Timers

I/O Devices. Chapter 5 Input/Output. Memory-Mapped I/O (2) Memory-Mapped I/O (1) Interrupts Revisited. Direct Memory Access (DMA) 11/26/2013

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

CSE 120. Operating Systems. March 27, 2014 Lecture 17. Mass Storage. Instructor: Neil Rhodes. Wednesday, March 26, 14

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition,

CSE 153 Design of Operating Systems Fall 2018

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

I/O Management and Disk Scheduling. Chapter 11

Disk Scheduling. Based on the slides supporting the text

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

Lecture 23: Storage Systems. Topics: disk access, bus design, evaluation metrics, RAID (Sections )

CHAPTER 12: MASS-STORAGE SYSTEMS (A) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

CS 537 Fall 2017 Review Session

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Chapter 13: Mass-Storage Systems. Disk Scheduling. Disk Scheduling (Cont.) Disk Structure FCFS. Moving-Head Disk Mechanism

Chapter 13: Mass-Storage Systems. Disk Structure

CHAPTER 12 AND 13 - MASS-STORAGE STRUCTURE & I/O- SYSTEMS

Module 2: Computer-System Structures. Computer-System Architecture

Anatomy of a disk. Stack of magnetic platters. Disk arm assembly

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

CS3600 SYSTEMS AND NETWORKS

Chapter 10: Mass-Storage Systems

QUESTION BANK UNIT I

Chapter 11. I/O Management and Disk Scheduling

I/O Systems and Storage Devices

I/O CANNOT BE IGNORED

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University

CS 554: Advanced Database System

CS510 Operating System Foundations. Jonathan Walpole

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

Operating Systems, Fall

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CS330: Operating System and Lab. (Spring 2006) I/O Systems

COMPUTER SCIENCE 4500 OPERATING SYSTEMS

Major Device Number specifies the device class, floppy disk, hard disk, terminal (selects device driver)

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

Announcement. Computer Architecture (CSC-3501) Lecture 23 (17 April 2008) Chapter 7 Objectives. 7.1 Introduction. 7.2 I/O and Performance

Chapter 11 I/O Management and Disk Scheduling

Chapter 12: Mass-Storage

Operating Systems. Operating Systems Professor Sina Meraji U of T

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

Computer Science 4500 Operating Systems

Computer Science 4500 Operating Systems

The Device Driver Interface. Input/Output Devices. System Call Interface. Device Management Organization

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Secondary storage. File systems

CSE 153 Design of Operating Systems

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

I/O CANNOT BE IGNORED

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

I/O & Storage. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

Chapter 5 - Input / Output

Lecture 25: Interconnection Networks, Disks. Topics: flow control, router microarchitecture, RAID

Chap. 3. Input/Output

Section I Section Real Time Systems. Processes. 1.6 Input/Output Management. (Textbook: A. S. Tanenbaum Modern OS - ch. 5)

Secondary Storage Management Rab Nawaz Jadoon

CSE 451: Operating Systems Winter Lecture 12 Secondary Storage. Steve Gribble 323B Sieg Hall.

Operating Systems Peter Pietzuch

Chapter 8. A Typical collection of I/O devices. Interrupts. Processor. Cache. Memory I/O bus. I/O controller I/O I/O. Main memory.

V. Mass Storage Systems

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

Chapter 5 Input/Output. I/O Devices

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

Disk Scheduling COMPSCI 386

Comp 204: Computer Systems and Their Implementation. Lecture 18: Devices

I/O and Device Drivers

Transcription:

Introduction Operating Systems Input/Output Devices (Ch12.1-12.3, 12.7; 13.1-13.3, 13.7) One OS function is to control devices significant fraction of code (80-90% of Linux) Want all devices to be simple to use convenient ex: stdin/stdout, pipe, re-direct Want to optimize access to device efficient devices have very different needs Software Specific Devices Types of I/O devices Device controllers Direct Memory Access (DMA) I/O Device Types block - access is independent ex- disk character - access is serial ex- printer, network other ex- clocks (just generate interrupts) Device Controllers Mechanical and electronic component Mechanical Electronic Memory System bus Disk Controller The quick brown fox jumped over the lazy dogs. The quick brown fox... Printer Controller OS deals with electronic device controller 1

Direct Memory Access (DMA) Very Old OS polls controller for data Old Controller interrupts OS OS copies data to memory DMA Controller copies data to memory Controller interrupts OS Software Specific Devices Layered I/O Software Structure User Level Software Device Independent Software (Talk from bottom up) 1) Device driver initiates I/O ( 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 Make interrupt handler as small as possible interrupts disabled Do minimal amount of work defer rest until later in the rest of the device driver deferred procedure call Implementation specific 3rd party vendors Device dependent code includes interrupt handler Accept abstract requests ex: read block n See that they are executed by device hardware registers hardware commands After error check pass data to device-independent software 2

Device-Independent I/O Software Much driver code independent of device Exact boundary is system-dependent sometimes inside for efficiency Perform I/O functions common to all devices Examples: naming protection block size buffering storage allocation error reporting User-Space I/O Software Ex: count = write(fd, buffer, bytes); Put parameters in place for system call Can do more: formatting printf(), gets() Spooling spool directory, daemon ex: printing, USENET I/O Reply I/O System Summary I/O Request User Processes Device Independent Software Make I/O call; Format I/O; Spooling Naming, protection, blocking, buffering, allocation Software Setup device registers; check status Wakeup driver when I/O completed Specific Devices Perform I/O operation Hard Disk Drives (HDD) Controller often on disk Cache to speed access HDD - Zoom Platters 3000-10,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 Disk Arms all move together If multiple drives overlapping seeks but one read/write at a time 3

Disk Arm Scheduling Read time: seek time (arm to cylinder) rotational delay (time for sector under head) transfer time (takes bits off disk) Seek time dominates How does disk arm scheduling affect seek? First-Come First-Served (FCFS) 14+13+2+6+3+12+3=53 Service requests in order that they arrive Little can be done to optimize What if many requests? Shortest Seek First (SSF) Elevator (SCAN) 1+2+6+9+3+2 = 23 Suppose many requests? Stay in middle Starvation! 1+2+6+3+2+17 = 31 Usually, a little worse than SSF C-SCAN has less variance Note, seek getting faster, rotational not Someday, change algorithms Redundant Array of Inexpensive Disks (RAID) Pull data in parallel For speed For fault-tolerance Example: 38 disks Form 32 bit word, 6 check bits Error Handling 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) 4

Clock 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 Clock driver uses hardware for OS time of day 64-bit, in seconds, or relative to boot interrupt after quantum accounting of usage separate timer or pointer to PCB alarm() system calls separate clock or linked list of alarms with ticks 5