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

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

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

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

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

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

Hard Disk Drives (HDDs)

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

CSE 380 Computer Operating Systems

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

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

CSE380 - Operating Systems. Communicating with Devices

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

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

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

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

Chapter 5 Input/Output

Input Output (IO) Management

Input/Output Management

UNIT 4 Device Management

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Operating Systems 2010/2011

Operating Systems. V. Input / Output

Operating Systems. V. Input / Output. Eurecom

Lecture 21 Disk Devices and Timers

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)

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

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

CSE 153 Design of Operating Systems Fall 2018

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

Chapter 11. I/O Management and Disk Scheduling

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.

I/O Management and Disk Scheduling. Chapter 11

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

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

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

OPERATING SYSTEMS CS136

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

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

I/O CANNOT BE IGNORED

CS 537 Fall 2017 Review Session

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)

Chapter 10: Mass-Storage Systems

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

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

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

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

Disk Scheduling. Based on the slides supporting the text

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

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

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

I/O Systems and Storage Devices

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.

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

Chapter 13: Mass-Storage Systems. Disk Structure

Operating Systems. Mass-Storage Structure Based on Ch of OS Concepts by SGG

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

CS510 Operating System Foundations. Jonathan Walpole

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

Operating Systems, Fall

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

Chapter 11 I/O Management and Disk Scheduling

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

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

[537] I/O Devices/Disks. Tyler Harter

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

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

Chapter 10: Mass-Storage Systems

Disk Scheduling COMPSCI 386

CS3600 SYSTEMS AND NETWORKS

I/O CANNOT BE IGNORED

Storage Systems. Storage Systems

QUESTION BANK UNIT I

CSE 153 Design of Operating Systems

Chapter 12: Mass-Storage

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

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

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

CSE 451: Operating Systems Winter I/O System. Gary Kimura

Computer Science 4500 Operating Systems

Computer Science 4500 Operating Systems

Chapter 5 - Input / Output

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

Hard Disk Drives. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

CS 554: Advanced Database System

b. How many bits are there in the physical address?

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

CSE506: Operating Systems CSE 506: Operating Systems

COMPUTER SCIENCE 4500 OPERATING SYSTEMS

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?

I/O and Device Drivers

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

Operating Systems. Operating Systems Professor Sina Meraji U of T

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

COS 318: Operating Systems. Storage Devices. Jaswinder Pal Singh Computer Science Department Princeton University

Transcription:

Introduction Operating Systems Input/Output Devices (Ch 13.3, 13.5; 14.1-14.3) 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 Device controllers Types of I/O devices Direct Memory Access (DMA) 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 I/O Device Types block - access is independent ex-disk character - access is serial ex- printer, network other ex- clocks (just generate interrupts) 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 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 Split into two pieces First part does minimal amount of work defer rest until later in the rest of the device driver Windows: deferred procedure call (DPC) Linux: top-half handler Second part does most of work 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 Setup device registers; check status Wakeup driver when I/O completed Perform I/O operation Controller often on disk Cache to speed access Hard Disk Drives (HDD) 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 (take 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 avg seek time than SSF But avoids more fair, avoids starvation C-SCAN has less variance Note, seek getting faster, rotational not Someday, change algorithms Redundant Array of Inexpensive Disks (RAID) For speed Pull data in parallel For fault-tolerance Example: 38 disks, form 32 bit word, 6 check bits Example: 2 disks, have exact copy on one disk 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 Uses 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