Slide 1. Slide 2. Slide 3. Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware

Similar documents
Have both hardware and software. Want to hide the details from the programmer (user).

1. Computer System Structure and Components

Operating Systems 4 th Class

I/O Device and Drivers

Chapter 11 I/O Management and Disk Scheduling

Chapter 2: OS Overview

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

COS 318: Operating Systems. I/O Device and Drivers. Input and Output. Definitions and General Method. Revisit Hardware

Devices and Device Controllers

How To Understand And Understand An Operating System In C Programming

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

I/O. Input/Output. Types of devices. Interface. Computer hardware

Input / Output and I/O Strategies

CSC 2405: Computer Systems II

Introduction. What is an Operating System?

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Computer Organization & Architecture Lecture #19

Computer Systems Structure Input/Output

Operating System Structures

Operating system Dr. Shroouq J.

Operating Systems. Lecture 03. February 11, 2013

Device Management Functions

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

Intel DPDK Boosts Server Appliance Performance White Paper

Chapter 11: Input/Output Organisation. Lesson 06: Programmed IO

Lecture 6: Interrupts. CSC 469H1F Fall 2006 Angela Demke Brown

Linux Driver Devices. Why, When, Which, How?

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Chapter 11 I/O Management and Disk Scheduling

Storage. The text highlighted in green in these slides contain external hyperlinks. 1 / 14

Chapter 13 Embedded Operating Systems

Linux Kernel Architecture

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Computer-System Architecture

CS161: Operating Systems

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Operating System Tutorial

Chapter 1 Computer System Overview

REAL TIME OPERATING SYSTEMS. Lesson-10:

SYSTEM ecos Embedded Configurable Operating System

I/O Management. General Computer Architecture. Goals for I/O. Levels of I/O. Naming. I/O Management. COMP755 Advanced Operating Systems 1

INPUT/OUTPUT ORGANIZATION

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Embedded Systems. 6. Real-Time Operating Systems

This tutorial will take you through step by step approach while learning Operating System concepts.

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Operating System Software

Computer Science 4302 Operating Systems. Student Learning Outcomes

Operating Systems Introduction

Operating System Components

Operating System: Scheduling

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

OpenSPARC T1 Processor

Security Overview of the Integrity Virtual Machines Architecture

First-class User Level Threads

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Operating System Overview. Otto J. Anshus

Real Time Programming: Concepts

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Chapter 11: File System Implementation. Operating System Concepts with Java 8 th Edition

CHAPTER 15: Operating Systems: An Overview

Lecture 1 Operating System Overview

Chapter 6, The Operating System Machine Level

Lecture 25 Symbian OS

Chapter 3 Operating-System Structures

Frequently Asked Questions: EMC UnityVSA

Microprocessor & Assembly Language

Hello, and welcome to this presentation of the STM32 SDMMC controller module. It covers the main features of the controller which is used to connect

Presentation of Diagnosing performance overheads in the Xen virtual machine environment

Read this before starting!

sndio OpenBSD audio & MIDI framework for music and desktop applications

OPERATING SYSTEMS STRUCTURES

The Real-Time Operating System ucos-ii

Architecture of Hitachi SR-8000

REAL TIME OPERATING SYSTEM PROGRAMMING-II: II: Windows CE, OSEK and Real time Linux. Lesson-12: Real Time Linux

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Network Scanning: A New Feature for Digital Copiers

A Comparative Study on Vega-HTTP & Popular Open-source Web-servers

Web Server Architectures

Serial Communications

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 5 - DBMS Architecture

Question: 3 When using Application Intelligence, Server Time may be defined as.

Operating Systems Prof. Ashok K Agrawala

ELEC 377. Operating Systems. Week 1 Class 3

TCP Servers: Offloading TCP Processing in Internet Servers. Design, Implementation, and Performance

The Big Picture: Where are We Now? I/O Devices and Drivers. Content. What is I/O? The Five Classic Components of a Computer

Scaling Networking Applications to Multiple Cores

Overview of Operating Systems Instructor: Dr. Tongping Liu

What is a bus? A Bus is: Advantages of Buses. Disadvantage of Buses. Master versus Slave. The General Organization of a Bus

How to design and implement firmware for embedded systems

Operating Systems Design 16. Networking: Sockets

Interprocess Communication Message Passing

Remote Copy Technology of ETERNUS6000 and ETERNUS3000 Disk Arrays

Chapter 1: Introduction. Chapter 1: Introduction. Operating System Concepts, 7th Edition. Objectives

Transcription:

Slide 1 Chapter 13: I/O Systems Slide 2 I/O Hardware Chapter 13: I/O Systems Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin and Gagne 2005 Slide 3 Objectives Explore the structure of an operating system s I/O subsystem Discuss the principles of I/O hardware and its complexity Provide details of the performance aspects of I/O hardware and software 13.3 Silberschatz, Galvin and Gagne 2005

Slide 4 Incredible variety of I/O devices Common concepts Port I/O Hardware Bus (daisy chain or shared direct access) Controller (host adapter) I/O instructions control devices Devices have addresses, used by Direct I/O instructions Memory-mapped I/O 13.4 Silberschatz, Galvin and Gagne 2005 Slide 5 A Typical PC Bus Structure 13.5 Silberschatz, Galvin and Gagne 2005 Slide 6 Device I/O Port Locations on PCs (partial) 13.6 Silberschatz, Galvin and Gagne 2005

Slide 7 Determines state of device command-ready busy Error Polling Busy-wait cycle to wait for I/O from device 13.7 Silberschatz, Galvin and Gagne 2005 Slide 8 Interrupts CPU Interrupt-request line triggered by I/O device Interrupt handler receives interrupts Maskable to ignore or delay some interrupts Interrupt vector to dispatch interrupt to correct handler Based on priority Some nonmaskable Interrupt mechanism also used for exceptions 13.8 Silberschatz, Galvin and Gagne 2005 Slide 9 Interrupt-Driven I/O Cycle 13.9 Silberschatz, Galvin and Gagne 2005

Slide 10 Intel Pentium Processor Event-Vector Table 13.10 Silberschatz, Galvin and Gagne 2005 Slide 11 Direct Memory Access Used to avoid programmed I/O for large data movement Requires DMA controller Bypasses CPU to transfer data directly between I/O device and memory 13.11 Silberschatz, Galvin and Gagne 2005 Slide 12 Six Step Process to Perform DMA Transfer 13.12 Silberschatz, Galvin and Gagne 2005

Slide 13 Application I/O Interface I/O system calls encapsulate device behaviors in generic classes Device-driver layer hides differences among I/O controllers from kernel Devices vary in many dimensions Character-stream or block Sequential or random-access Sharable or dedicated Speed of operation read-write, read only, or write only 13.13 Silberschatz, Galvin and Gagne 2005 Slide 14 A Kernel I/O Structure 13.14 Silberschatz, Galvin and Gagne 2005 Slide 15 Characteristics of I/O Devices 13.15 Silberschatz, Galvin and Gagne 2005

Slide 16 Block and Character Devices Block devices include disk drives Commands include read, write, seek Raw I/O or file-system access Memory-mapped file access possible Character devices include keyboards, mice, serial ports Commands include get, put Libraries layered on top allow line editing 13.16 Silberschatz, Galvin and Gagne 2005 Slide 17 Network Devices Varying enough from block and character to have own interface Unix and Windows NT/9x/2000 include socket interface Separates network protocol from network operation Includes select functionality Approaches vary widely (pipes, FIFOs, streams, queues, mailboxes) 13.17 Silberschatz, Galvin and Gagne 2005 Slide 18 Clocks and Timers Provide current time, elapsed time, timer Programmable interval timer used for timings, periodic interrupts ioctl (on UNIX) covers odd aspects of I/O such as clocks and timers 13.18 Silberschatz, Galvin and Gagne 2005

Slide 19 Blocking and Nonblocking I/O Blocking - process suspended until I/O completed Easy to use and understand Insufficient for some needs Nonblocking - I/O call returns as much as available User interface, data copy (buffered I/O) Implemented via multi-threading Returns quickly with count of bytes read or written Asynchronous - process runs while I/O executes Difficult to use I/O subsystem signals process when I/O completed 13.19 Silberschatz, Galvin and Gagne 2005 Slide 20 Two I/O Methods Synchronous Asynchronous 13.20 Silberschatz, Galvin and Gagne 2005 Slide 21 Scheduling Kernel I/O Subsystem Some I/O request ordering via per-device queue Some OSs try fairness Buffering - store data in memory while transferring between devices To cope with device speed mismatch To cope with device transfer size mismatch To maintain copy semantics 13.21 Silberschatz, Galvin and Gagne 2005

Slide 22 Device-status Table 13.22 Silberschatz, Galvin and Gagne 2005 Slide 23 Sun Enterprise 6000 Device-Transfer Rates 13.23 Silberschatz, Galvin and Gagne 2005 Slide 24 Kernel I/O Subsystem Caching - fast memory holding copy of data Always just a copy Key to performance Spooling - hold output for a device If device can serve only one request at a time i.e., Printing Device reservation - provides exclusive access to a device System calls for allocation and deallocation Watch out for deadlock 13.24 Silberschatz, Galvin and Gagne 2005

Slide 25 Error Handling OS can recover from disk read, device unavailable, transient write failures Most return an error number or code when I/O request fails System error logs hold problem reports 13.25 Silberschatz, Galvin and Gagne 2005 Slide 26 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/O must be performed via system calls Memory-mapped and I/O port memory locations must be protected too 13.26 Silberschatz, Galvin and Gagne 2005 Slide 27 Use of a System Call to Perform I/O 13.27 Silberschatz, Galvin and Gagne 2005

Slide 28 Kernel Data Structures Kernel keeps state info for I/O components, including open file tables, network connections, character device state Many, many complex data structures to track buffers, memory allocation, dirty blocks Some use object-oriented methods and message passing to implement I/O 13.28 Silberschatz, Galvin and Gagne 2005 Slide 29 UNIX I/O Kernel Structure 13.29 Silberschatz, Galvin and Gagne 2005 Slide 30 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 13.30 Silberschatz, Galvin and Gagne 2005

Slide 31 Life Cycle of An I/O Request 13.31 Silberschatz, Galvin and Gagne 2005 Slide 32 STREAMS STREAM a full-duplex communication channel between a userlevel process and a device in Unix System V and beyond A STREAM consists of: - STREAM head interfaces with the user process - driver end interfaces with the device - zero or more STREAM modules between them. Each module contains a read queue and a write queue Message passing is used to communicate between queues 13.32 Silberschatz, Galvin and Gagne 2005 Slide 33 The STREAMS Structure 13.33 Silberschatz, Galvin and Gagne 2005

Slide 34 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 13.34 Silberschatz, Galvin and Gagne 2005 Slide 35 Intercomputer Communications 13.35 Silberschatz, Galvin and Gagne 2005 Slide 36 Improving Performance Reduce number of context switches Reduce data copying Reduce interrupts by using large transfers, smart controllers, polling Use DMA Balance CPU, memory, bus, and I/O performance for highest throughput 13.36 Silberschatz, Galvin and Gagne 2005

Slide 37 Device-Functionality Progression 13.37 Silberschatz, Galvin and Gagne 2005 Slide 38 End of Chapter 13