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

Similar documents
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

Module 12: I/O Systems

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

Chapter 13: I/O Systems

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

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

Chapter 13: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

Chapter 13: I/O Systems

Chapter 13: I/O Systems

Silberschatz and Galvin Chapter 12

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition

Chapter 13: I/O Systems

Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial)

I/O Systems. 04/16/2007 CSCI 315 Operating Systems Design 1

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

Device-Functionality Progression

Chapter 12: I/O Systems. I/O Hardware

Module 12: I/O Systems

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

Chapter 13: I/O Systems

Module 11: I/O Systems

I/O Management and Disk Scheduling. Chapter 11

The control of I/O devices is a major concern for OS designers

Chapter 13: I/O Systems

[08] IO SUBSYSTEM 1. 1

I/O AND DEVICE HANDLING Operating Systems Design Euiseong Seo

Input Output (IO) Management

Operating System 1 (ECS-501)

Operating Systems. V. Input / Output

Operating Systems. V. Input / Output. Eurecom

CSE 4/521 Introduction to Operating Systems. Lecture 24 I/O Systems (Overview, Application I/O Interface, Kernel I/O Subsystem) Summer 2018

Input/Output Systems

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

Lecture 15: I/O Devices & Drivers

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Operating Systems 2010/2011

CS420: Operating Systems. Mass Storage Structure

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

操作系统概念 13. I/O Systems

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

Lecture 9. I/O Management and Disk Scheduling Algorithms

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

Operating Systems. Steven Hand. Michaelmas / Lent Term 2008/ lectures for CST IA. Handout 4. Operating Systems

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

or edit a file, our immediate interest is to read or enter some information, not to compute an answer.

Principles of Operating Systems CS 446/646

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

Chapter 11. I/O Management and Disk Scheduling

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

NWI-IBC019: Operating systems

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

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

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

COT 4600 Operating Systems Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM

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.

Chapter 7: Mass-storage structure & I/O systems. Operating System Concepts 8 th Edition,

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

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

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. Sunu Wibirama

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

CSE 153 Design of Operating Systems Fall 2018

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

Lecture 21 Disk Devices and Timers

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

Chapter 11 I/O Management and Disk Scheduling

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

I/O Systems and Storage Devices

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

CSE506: Operating Systems CSE 506: Operating Systems

Disk Scheduling. Based on the slides supporting the text

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

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

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

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

CSE 380 Computer Operating Systems

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

Input/Output Management

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

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

Free Space Management

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

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

UNIT-7. Overview of Mass Storage Structure

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

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

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

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

Bus Architecture Example

CSE 153 Design of Operating Systems

Hard Disk Drives (HDDs)

OPERATING SYSTEMS CS136

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

Transcription:

Outline Diversity of I/O devices block and character devices Organization of I/O subsystem of kernel device drivers Common hardware characteristics of device I/O subsystem tasks Operating Systems: Devices and I/O p. 1/18

I/O subsystem Section 12.1 Lowest layer of the OS that separates rest of kernel from complexity of managing I/O devices storage transmission (nic/modem) interface (kbd, mouse, screen, printer) special purpose devices Operating Systems: Devices and I/O p. 2/18

Diversity of devices Section 12.3 Operating Systems: Devices and I/O p. 3/18

Organization Section 12.1,12.3 I/O devices are grouped into some conventional types each group is accessed via a standardized interface (set of functions) I/O subsystem of kernel uses device drivers to manage individual devices in each group Device driver routines: handle hardware-specific details of operation of devices present uniform interface through which devices are accessed ioctl(fd, OPCODE, buf) general I/O control system call enables any application to access any functionality implemented by any device driver NOTE: hardware manufacturers design devices to be compatible with existing controller interface, or write drivers to provide required interface to the OS. Operating Systems: Devices and I/O p. 4/18

Organization Operating Systems: Devices and I/O p. 5/18

Block and character devices Section 12.3.1 Block devices: Unit of data transfer: a block of bytes Example: disk drives Operations: read, write, seek Usually accessed via a filesystem interface raw I/O: OS, DBMS may directly access device as a linear array of blocks Character devices: Unit of data transfer: one byte Example: keyboard, terminal, mouse, modem, printers Operations: getting / putting one character line-at-a-time access with buffering and editing services Operating Systems: Devices and I/O p. 6/18

Network devices Section 12.3.2 Use a socket interface Operations: connecting to a remote socket accepting connections to a local socket sending / receiving packets select from a set of sockets Operating Systems: Devices and I/O p. 7/18

Clocks and timers Section 12.3.3 Operations: give current time, give elapsed time, set timers / alarms Hardware support: clock may send interrupt at every tick (coarse) clock may be high-frequency counter (high resolution) value of counter may be read from device register Uses of programmable interval timer: time-slicing periodic flushing of buffers to disk network timeouts Operating Systems: Devices and I/O p. 8/18

Blocking / nonblocking I/O Section 12.3.4 Blocking I/O: calling process suspended till I/O completes Non-blocking I/O: process gets whatever input is available + status code Asynchronous I/O: I/O request is scheduled, process returns immediately completion of I/O communicated via setting a variable calling a callback procedure sending a signal Operating Systems: Devices and I/O p. 9/18

Hardware components Section 12.2 Port: connection point between device and computer (host) Bus: set of wires connecting device(s) to host communication between host and device (for control instructions / data) uses well-defined protocol arrangment: daisy chain or shared direct access Controller: circuit that operates a port / bus / device Examples: serial port controller controls signals on serial port wires SCSI bus controller circuit that controls SCSI bus contains processor, microcode, private memory to handle SCSI protocol usually implemented on a separate circuit board Disk controller circuit that implements the disk side of the protocol for the connection type (IDE, SCSI, etc.) contains processor, microcode to handle prefetching, buffering, caching, etc. Operating Systems: Devices and I/O p. 10/18

Controllers Contain registers for data / control signals processor communicates with controller by writing / reading bit patterns into / from these registers data-in, data-out read/written to get / send data 1 4 bytes long control commands status whether current command has completed, whether a byte is available for reading, error conditions, etc. May contain FIFO chips extension of data register can hold several bytes of input / output data until device / host is able to receive the data Operating Systems: Devices and I/O p. 11/18

Controllers Communication methods: using special I/O instructions triggers bus lines to select proper device and move bits into/ out of DRs using memory mapped I/O DRs are mapped into CPU s address space standard LOAD, STORE instructions used to read / write DRs combination of I/O instructions + memory-mapped I/O Example: some graphics controllers I/O ports used for basic control operations large memory-mapped region used to hold screen contents (processor sends I/O to screen by writing data into memory-mapped region) Operating Systems: Devices and I/O p. 12/18

I/O subsystem tasks: scheduling Section 12.4 Aim: to determine a good order of execution for a set of I/O requests improve overall system performance reduce average waiting time for I/O completion ensure better service to higher priority / delay-sensitive requests (e.g. from virtual memory sub-system) ensure fairness (?) Operating Systems: Devices and I/O p. 13/18

I/O subsystem tasks: buffering/caching Aim: to cope with speed mismatch between producer and consumer of data (i) data arriving from slow device is accumulated in a buffer until full (ii) full buffer written to fast device in single operation (iii) 2nd buffer used while 1st buffer is being written to disk to adapt between devices with different data transfer sizes (e.g.network packet fragmentation and reassembly) to support copy semantics for I/O write operations write single version of data (no mixing of old and new data can happen) Same space may be used for both caching and buffering NOTE: Buffer may hold only existing copy of data (e.g. network I/O buffer) Cache necessarily holds a copy of a data item that is originally stored elsewhere. Operating Systems: Devices and I/O p. 14/18

I/O subsystem tasks: spooling Spool: buffer that holds output for a device that cannot accept interleaved data streams from multiple concurrent applications (e.g. printer, tape drive) I/O subsystem serializes concurrent output from multiple processes Implementation: (i) output from separate processes is spooled to separate files (ii) spooling system queues spool files for output to device Spooling system interface typically provides control interface for viewing, pausing, removing jobs Operating Systems: Devices and I/O p. 15/18

I/O subsystem tasks: error handling Transient failures handled by kernel e.g. disk-read / network-send failure automatic retry SCSI devices error reporting sense key: specifies general nature of failure (e.g. h/w error, illegal request, etc.) additional sense code: category of failure (e.g. bad command parameter, self-test failure, etc.) additional sense code qualifier: more detailed information (e.g. which command parameter, which subsystem failed, etc.) Operating Systems: Devices and I/O p. 16/18

Disk structure Section 13.1 Sector 0: 1st sector of 1st track of outermost cylinder Sectors numbered sequentially by sector, track, cylinder (outer inner) Zones: groups of cylinders for which # sectors per track is constant (outer zones have 40% more sectors per track than innermost zones) # sectors/track: 100; # cylinders/disk: 10 3 I/O time: seek time + rotational latency + transfer time Operating Systems: Devices and I/O p. 17/18

Disk scheduling Section 13.2 FCFS fair algorithm (no starvation) poor performance Shortest seek-time first: choose pending request that is closest to current head position starvation possible better than FCFS, but non-optimal SCAN/Elevator: disk arm moves from one end to the other and back, servicing requests C-SCAN: no requests serviced on return trip more uniform wait time LOOK, C-LOOK: disk arm moves till farthest request in each direction (instead of end of disk) OS issues: Physical layout of directories and files Scheduling algorithms may be implemented in hardware / software Operating Systems: Devices and I/O p. 18/18