CS420: Operating Systems. Kernel I/O Subsystem

Similar documents
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. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial)

Chapter 13: I/O Systems

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

CSC Operating Systems Spring Lecture - XIX Storage and I/O - II. Tevfik Koşar. Louisiana State University.

RAID Structure. RAID Levels. RAID (cont) RAID (0 + 1) and (1 + 0) Tevfik Koşar. Hierarchical Storage Management (HSM)

Module 12: I/O Systems

Module 12: I/O Systems

Device-Functionality Progression

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

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

Chapter 13: I/O Systems

Chapter 13: I/O Systems

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

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

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

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

I/O SYSTEMS. Sunu Wibirama

Chapter 13: I/O Systems

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

Silberschatz and Galvin Chapter 12

Input/Output Systems

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

Operating Systems 2010/2011

操作系统概念 13. I/O 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

Lecture 15: I/O Devices & Drivers

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

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

I/O AND DEVICE HANDLING Operating Systems Design Euiseong Seo

CS420: Operating Systems

CS420: Operating Systems

Chapter 7: Deadlocks. Operating System Concepts 9 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,

CS420: Operating Systems. Paging and Page Tables

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

[08] IO SUBSYSTEM 1. 1

Input/Output Systems

Operating Systems. Lecture 09: Input/Output Management. Elvis C. Foster

Module 11: I/O Systems

Principles of Operating Systems CS 446/646

Chapter 1: Introduction. Operating System Concepts 8 th Edition,

NWI-IBC019: Operating systems

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

CS420: Operating Systems

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

UNIT-7. Overview of Mass Storage Structure

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

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

CS420: Operating Systems. Deadlocks & Deadlock Prevention

5.b Principles of I/O Hardware CPU-I/O communication

CS420: Operating Systems

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

Page Replacement Algorithms

CS370 Operating Systems

Chapter 1: Introduction

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

OPERATING SYSTEM OVERVIEW

CS420: Operating Systems

SAZ4B/SAE5A Operating System Unit : I - V

Chapter 1: Introduction

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

Chapter 4: Threads. Operating System Concepts 8 th Edition,

Four Components of a Computer System. Operating System Concepts 7 th Edition, Jan 12, 2005

CS420: Operating Systems

CS370 Operating Systems

QUESTION BANK UNIT I

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

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

Chapter 1: Introduction. Chapter 1: Introduction

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

Today: Protection! Protection!

CS370 Operating Systems

More on Synchronization and Deadlock

Input Output (IO) Management

Readings and References. Deadlock. Deadlock. Simple Traffic Gridlock Example. Reading. CSE Computer Systems November 30, 2001.

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS420: Operating Systems. OS Services & System Calls

CS420: Operating Systems. Process Synchronization

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne

Today: Protection. Sermons in Computer Science. Domain Structure. Protection

Chapter 3: Processes. Operating System Concepts 8 th Edition,

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies

CSE 4/521 Introduction to Operating Systems. Lecture 12 Main Memory I (Background, Swapping) Summer 2018

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

Semaphore. Originally called P() and V() wait (S) { while S <= 0 ; // no-op S--; } signal (S) { S++; }

Chapter 8: Main Memory

Deadlock. Readings and References. Simple Traffic Gridlock Example. Deadlock. Reading. Other References. CSE 410, Spring 2006 Computer Systems

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

Transcription:

Kernel I/O Subsystem James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne

A Kernel I/O Structure 2

Kernel I/O Subsystem The kernel provides many services related to I/O - Scheduling - Buffering - Caching - Spooling - Device reservation - Error handling 3

Kernel I/O Subsystem Scheduling - Some I/O request ordering via per-device queue Attempt to use devices optimally while still providing priority - Some implement Quality of Service (i.e. IPQOS)! Buffering - store data in memory while transferring between devices - Helps cope with device speed mismatch - Helps cope with device transfer size mismatch - To maintain copy semantics Data is first copied from user application memory into kernel memory Data from kernel memory is then written to device Prevents application from changing contents of a buffer before it is done being written 4

Kernel I/O Subsystem Caching - possible to reuse buffers in main memory for caching - Cache files that are read/written frequently - Increases performance! Spooling - a buffer that holds output for a device that cannot accept interleaved data streams - If device can serve only one request at a time - Allows a user to see individual data streams and remove streams if desired - i.e., Printing! Device reservation - provides exclusive access to a device - System calls for allocation and de-allocation - Watch out for deadlock 5

Error Handling OS can recover from disk read, device unavailable, transient write failures - Retry a read or write, for example - Some systems more advanced Solaris FMA, AIX Track error frequencies, stop using device with increasing frequency of retryable errors Most operating systems return an error number or code when I/O request fails - errno in UNIX/Linux environments System error logs hold problem reports 6

I/O Protection User process may accidentally or purposefully attempt to disrupt normal operation via illegal I/O instructions - All I/O instructions defined to be privileged (i.e. kernel must perform I/O) - I/O must be performed via system calls Memory-mapped and I/O port memory locations must be protected too 7

Kernel Data Structures Kernel keeps state info for I/O components, including open file tables, network connections, etc.! Many complex data structures to track buffers, memory allocation, dirty blocks! Some operating systems use object-oriented methods and message passing to implement I/O - Windows uses message passing Message with I/O information passed from user mode into kernel Message modified as it flows through to device driver and back to process 8

UNIX I/O Kernel Structure 9

I/O Requests to Hardware Operations Consider reading a file from disk for a process: - Determine device holding file - Translate name to device representation - Physically read data from disk into buffer - Make data available to requesting process - Return control to process 10

Life Cycle of An I/O Request In buffer cache? 11

Performance I/O a major factor in system performance: - Demands CPU to execute device driver, kernel I/O code - Context switches due to interrupts - Data copying - Network traffic especially stressful 12

Intercomputer Communications 13

Methods to Improve System Performance Reduce number of context switches Reduce data copying when passing data between device and application Reduce frequency of interrupts by using large transfers, smart controllers, polling Use DMA controllers to offload simple data copying from the CPU Use smarter hardware devices that can do more of the work Move user-mode processes / daemons to kernel threads 14

Device-Functionality Progression 15