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

Similar documents
Input/Output Systems

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

Operating Systems. V. Input / Output

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

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

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

Operating Systems. V. Input / Output. Eurecom

Devices. Today. Comp 104: Operating Systems Concepts. Operating System An Abstract View 05/01/2017. Devices. Devices

I/O Management and Disk Scheduling. Chapter 11

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

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

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

UNIT 4 Device Management

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

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

I/O Systems. Jo, Heeseung

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

Chapter 5 Input/Output. I/O Devices

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

Principles of Operating Systems CS 446/646

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

CSE 380 Computer Operating Systems

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

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

Input Output (IO) Management

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Module 13: Secondary-Storage Structure

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.

CS 537 Fall 2017 Review Session

Operating Systems 2010/2011

CS420: Operating Systems. Mass Storage Structure

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Spring 2018

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

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Chapter 14: Mass-Storage Systems. Disk Structure

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Fall 2017

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers

Bus Architecture Example

CSE325 Principles of Operating Systems. Mass-Storage Systems. David P. Duggan. April 19, 2011

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

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

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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?

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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

bytes per disk block (a block is usually called sector in the disk drive literature), sectors in each track, read/write heads, and cylinders (tracks).

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

QUESTION BANK UNIT I

Operating Systems Design Exam 2 Review: Spring 2011

Chapter 10: Mass-Storage Systems

CS 416: Opera-ng Systems Design March 23, 2012

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

Input/Output Systems

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

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

Input/Output. 198:231 Introduction to Computer Organization Lecture 15. Instructor: Nicole Hynes

Input/Output Management

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers

OPERATING SYSTEMS CS136

Chapter 12: Mass-Storage

Today: I/O Systems. Architecture of I/O Systems

Tape pictures. CSE 30341: Operating Systems Principles

V. Mass Storage Systems

I/O Systems and Storage Devices

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

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

Chapter 13: I/O Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

CS370 Operating Systems

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

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

Chapter 13: Mass-Storage Systems. Disk Structure

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

CS 111. Operating Systems Peter Reiher

Disks and I/O Hakan Uraz - File Organization 1

CS370 Operating Systems

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

Lecture 13 Input/Output (I/O) Systems (chapter 13)

CS370 Operating Systems

Chapter 11 I/O Management and Disk Scheduling

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

Lecture 15: I/O Devices & Drivers

Disk Scheduling. Based on the slides supporting the text

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

Chapter 13: I/O Systems

UNIT-7. Overview of Mass Storage Structure

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Hard Disk Drives (HDDs)

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

Operating Systems 2010/2011

Answer to exercises chap 13.2

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Lecture 9. I/O Management and Disk Scheduling Algorithms

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

Chapter 13: I/O Systems

CS3600 SYSTEMS AND NETWORKS

Department of Computer Engineering University of California at Santa Cruz. File Systems. Hai Tao

Secondary Storage (Chp. 5.4 disk hardware, Chp. 6 File Systems, Tanenbaum)

Transcription:

Input/Output s Slide 5-1 The Driver Interface Slide 5-2 write(); Interface Output Terminal Terminal Printer Printer Disk Disk Input or Terminal Terminal Printer Printer Disk Disk Management Organization Slide 5-3 System Call Interface Slide 5-4 File Manager Command Application -Independent -Dependent Status Functions available to application programs Mostly resemble reading/writing files. Abstract all devices (and files) to a few interfaces Make interfaces as similar as possible Block vs character Sequential vs direct access 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 Slide 5-5 Overlapping the Operation of a and the CPU read(dev_i, %d, x); y = f(x) on device startread(dev_i, %d, x); while(stillreading()) ; y = f(x) Variable x Register Slide 5-6 dev_i Memory CPU

Overlapping CPU- Operations in a Slide 5-7 Overlapping ing and I/O Slide 5-8 App I/O Ctlr App 1 App 2 I/O Ctlr t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 1 t 2 t 3 t 4 Polling I/O Read Operation Slide 5-9 Interrupt-driven I/O Operation Slide 5-10 1 2 3 4 read(device, ); read function write function 5 1 read driver 2 write driver 3 read(device, ); Status Table 4 7 5 9 Handler Handler Interrupt Handler Handler 8b 6 8a Command Command Status Status Command Command Status Status Independent Function Call Trap Table Slide 5-11 Driver-Kernel Interface Slide 5-12 func i () dev_func_i(devid, ) { // ing common to all devices switch(devid) { case dev0: dev0_func_i(); case dev1: dev1_func_i(); case devm: devm_func_i(); ; // ing common to all devices Drivers are distinct from main part of kernel Kernel makes calls on specific functions, drivers implement them Drivers use kernel functions for: allocation Resource (e.g., memory) allocation Scheduling etc. (varies from OS to OS)

Reconfigurable Drivers Slide 5-13 Handling Interrupts Slide 5-14 System call interface open(){ driver J int read() { // Prepare for I/O save_state(j); out dev# // Done (no return) status table J interrupt handler J void dev_handler() { get_state(j); //Cleanup after op signal(dev[j]); return_from_sys_call(); read(){ etc. Driver for j Entry Points for j Other Kernel services Interrupt Handler driver J Handling Interrupts(2) int read() { out dev# // Return after interrupt wait(dev[j); return_from_sys_call(); Interrupt Handler interrupt handler J void dev_handler() { //Cleanup after op signal(dev[j]); Slide 5-15 The Pure Cycle Water Company Customer Office Water Company Returning the Empties Water Producer Water Consumers Delivering Water Slide 5-16 Hardware Buffering Slide 5-17 Double Buffering in the Driver Slide 5-18 Unbuffered A B reads b i-1 reads b i A B reads b i reads b i+1 Hardware Driver

Circular Buffering Slide 5-19 A Generic Communications Slide 5-20 To data consumer Bus Buffer j Buffer i Generic Local Communications Cabling connecting the controller to the device From data producer Printer Modem Network Rotating Media Slide 5-21 Driver API Storage Slide 5-22 Track (Cylinder) Cylinder (set of tracks) Driver Get disk description Set SCSI parms read/write ops Interrupt hander (a) Multi-surface Disk (b) Disk Surface (b) Cylinders Sector SCSI API commands bits per byte etc. Magnetic Disk (SCSI) Compute vs I/O Bound Slide 5-23 Disk Optimizations Slide 5-24 Compute-bound I/O-bound Time 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 Slide 5-25 Optimizing Seek Time (cont) Slide 5-26 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: 52+ 64 + 51 + 57 + 27 = 251 steps Requests = 23, 87, 36, 93, 66 SSTF: (75), 66, 87, 93, 36, 23 9 + 21 + 6 + 57 + 13 = 106 steps Scan: (75), 87, 93, 99, 66, 36, 23 12 + 6 + 6 + 33 + 30 + 13 = 100 steps Look: (75), 87, 93, 66, 36, 23 12 + 6 + 27 + 30 + 13 = 87 steps Optimizing Seek Time (cont) Slide 5-27 Networks Slide 5-33 Requests = 23, 87, 36, 93, 66 Circular Scan: (75), 87, 93, 99, 23, 36, 66 12 + 6 + 6 + home + 23 + 13 + 30 = 90 + home Circular Look: (75), 87, 93, 23, 36, 66 12 + 6 + home + 23 + 13 + 30 = 84 + home Technology focus includes protocols and software (more on this later Chapter 15 and beyond...) CPU CPU Memory Memory Network Logical Communication Network Network CPU CPU Memory Memory Network MS Disk Description Slide 5-34 0x00 0x02 <a jump instruction to 0x1e> 0x03 0x0a Computer manufacturer name 0x0b 0x0c Sectors per cluster (MS-DOS reads/writes a cluster of sectors) 0x0d 0x0f Reserved sectors for the boot record 0x10 0x10 Number of FATs 0x11 0x12 Number of root directory entries 0x13 0x14 Number of logical sectors 0x15 0x15 Medium descriptor byte (used only on old versions of MS-DOS) 0x16 0x17 Sectors per FAT 0x18 0x19 Sectors per track 0x1a 0x1b Number of surfaces (heads) 0x1c 0x1d Number of hidden sectors 0x1e Bootstrap program