Principles of I/O Hardware and Software

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

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

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

Introduction to I/O and Disk Management

Devices and Device Controllers

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Robert Wagner

1. Computer System Structure and Components

Communicating with devices

Chapter 9: Peripheral Devices: Magnetic Disks

11: I/O Device Management

Chapter 11 I/O Management and Disk Scheduling

I/O Device and Drivers

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

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

Data Storage - I: Memory Hierarchies & Disks

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

Computer Organization & Architecture Lecture #19

COS 318: Operating Systems. Storage Devices. Kai Li Computer Science Department Princeton University. (

Quiz for Chapter 6 Storage and Other I/O Topics 3.10

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

University of Dublin Trinity College. Storage Hardware.

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

COS 318: Operating Systems. Storage Devices. Kai Li and Andy Bavier Computer Science Department Princeton University

MC514 Sistemas Operacionais: Teoria e Prática 1s2006. Gerenciamento de Entrada e Saída

INPUT/OUTPUT ORGANIZATION

William Stallings Computer Organization and Architecture 7 th Edition. Chapter 6 External Memory

Introduction. What is an Operating System?

Price/performance Modern Memory Hierarchy

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

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

Computer Systems Structure Input/Output

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

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

lesson 1 An Overview of the Computer System

PC Boot Considerations for Devices >8GB

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

Operating Systems 4 th Class

Operating System Structures

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

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Operating system Dr. Shroouq J.

Input/output (I/O) I/O devices. Performance aspects. CS/COE1541: Intro. to Computer Architecture. Input/output subsystem.

CSCA0102 IT & Business Applications. Foundation in Business Information Technology School of Engineering & Computing Sciences FTMS College Global

Sistemas Operativos: Input/Output Disks

Computer Peripherals

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

1 Storage Devices Summary

CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen

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

File System Management

Chapter 8 Objectives. Chapter 8 Operating Systems and Utility Programs. Operating Systems. Operating Systems. Operating Systems.

Input / Ouput devices. I/O Chapter 8. Goals & Constraints. Measures of Performance. Anatomy of a Disk Drive. Introduction - 8.1

Chapter 8: Installing Linux The Complete Guide To Linux System Administration Modified by M. L. Malone, 11/05

Computer-System Architecture

Lecture 16: Storage Devices

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

System Architecture. CS143: Disks and Files. Magnetic disk vs SSD. Structure of a Platter CPU. Disk Controller...

TEST CHAPTERS 1 & 2 OPERATING SYSTEMS

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

What is involved in input/output? How does the operating system manage I/O?

CSC 2405: Computer Systems II

Optimizing LTO Backup Performance

Chapter Introduction. Storage and Other I/O Topics. p. 570( 頁 585) Fig I/O devices can be characterized by. I/O bus connections

Chapter 1 Computer System Overview

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

Outline. CS 245: Database System Principles. Notes 02: Hardware. Hardware DBMS Data Storage

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

Storage in Database Systems. CMPSCI 445 Fall 2010

Network Attached Storage. Jinfeng Yang Oct/19/2015

Operating System Concepts. Operating System 資 訊 工 程 學 系 袁 賢 銘 老 師

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

OPERATING SYSTEMS STRUCTURES

Computer Architecture Prof. Mainak Chaudhuri Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

Architecture of Hitachi SR-8000

1 File Management. 1.1 Naming. COMP 242 Class Notes Section 6: File Management

Disk Geometry: How Data is Organized on a Hard Disk Drive

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

User Manual. 2 ) PNY Flash drive 2.0 Series Specification Page 3

Outline. Principles of Database Management Systems. Memory Hierarchy: Capacities and access times. CPU vs. Disk Speed

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

Chapter 3: Computer Hardware Components: CPU, Memory, and I/O

Primary Memory. Input Units CPU (Central Processing Unit)

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

Operating Systems. Design and Implementation. Andrew S. Tanenbaum Melanie Rieback Arno Bakker. Vrije Universiteit Amsterdam

Outline. Operating Systems Design and Implementation. Chap 1 - Overview. What is an OS? 28/10/2014. Introduction

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System

Disks and RAID. Profs. Bracy and Van Renesse. based on slides by Prof. Sirer

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

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

Big Picture. IC220 Set #11: Storage and I/O I/O. Outline. Important but neglected

Lecture 9: Memory and Storage Technologies

Obj: Sec 1.0, to describe the relationship between hardware and software HW: Read p.2 9. Do Now: Name 3 parts of the computer.

Click to view Web Link, click Chapter 8, Click Web Link from left navigation, then click BIOS below Chapter 8 p. 395 Fig. 8-4.

Storage and File Systems. Chester Rebeiro IIT Madras

New Mexico Broadband Program. Basic Computer Skills. Module 1 Types of Personal Computers Computer Hardware and Software

Outline: Operating Systems

Solid State Drive Architecture

Transcription:

CSCE 351 Operating System Kernels Principles of I/O Hardware and Software Steve Goddard goddard@cse.unl.edu http://www.cse.unl.edu/~goddard/courses/csce351 1 I/O Hardware I/O Devices» Block Devices» Character Devices Device Controllers» Memory-mapped I/O» I/O Ports» Interrupt Request Line (IRQ) Direct Memory Access (DMA) I/O Controllers and DMA» Disk Interleaving 2

I/O Devices Block Devices» Information is stored and accessed in fixed-size blocks» Block addressable, not byte addressable» Common block sizes: 512 32,768 bytes» Examples? Character Devices» Send or receive streams of characters» NOT byte or block addressable» Examples? What about» Tape drives?» Clocks?» Memory-mapped screens?» Mice? 3 Device Controllers Most I/O devices are electro-mechanical. The electrical component that interfaces with the CPU (actually the OS) is called the device controller or adapter. The Controller is the go-between for the OS and the device Controllers for PCs and embedded devices are implemented as daughter cards and inserted into the backplane of the parentboard (or motherboard) 4

Interfacing with Controllers Memory-mapped I/O» Controller Registers are part of regular address space» Usually flags in special registers indicate that the memory access is for memory-mapped I/O» Used by Motorola 680x0 processors I/O Ports» Each controller is assigned a special address called a port. Interrupt Request Lines (IRQ)» Physical input to the interrupt controller chip» Signals when the device controller is ready to have its registers read/written via the I/O Ports (addresses) assigned that controller. 5 I/O Ports and IRQs Example: PC with MS-DOS I/O Controller Clock I/O address 040-043 Hardware IRQ 0 DOS Interrupt Vector 8 MINIX Interrupt Vector 40 Keyboard 060-063 1 9 41 Hard Disk 1F0-1F7 14 118 54 Printer 378-37F 7 15 47 6

Direct Memory Access (DMA) Used mainly for block devices 7 Anatomy of a Disk Basic components Track s 1 0 1 2 Block/Sector Head... Cylinder Surface Platter Spindle 8

Anatomy of a Disk Example: Seagate 9GB Fast/Wide/Differential SCSI disk Specs:» 12 platters» 22 heads» variable # of sectors/track» 7,200 RPM average latency: 4.2 ms.» Seek times track-to-track: 1 ms average: 7.9 ms» 40MB/s peak transfer rate» 11 arms» 4,735 tracks» 512 bytes/sector 9 Disk Operations Data transfer in units of sectors Random access devices with non-uniform access times Present disk with a sector address» DA = (drive, surface, track, sector) Head moved to appropriate track» seek time The appropriate head is enabled Wait for the sector to appear under the head» rotational latency Read/write the sector» transfer time 10

Disk Interleaving Blocks are often placed on the disk in nonsequential order to allow time for the DMA buffer to be transferred to main memory. No interleaving Single interleaving Double interleaving 11 I/O Software Goals of I/O Software Structured I/O Software» Interrupt Handlers» Device Drivers» Device-Independent I/O SW» User-Space I/O SW 12

Goals of I/O Software Device independence» Read and Write from Floppy, Disk, CD-ROM without modifying programs Uniform naming» Names are not dependent on the specific device Different devices of same type have similar name» In UNIX, all I/O is integrated with the file system Error handling done as close to HW as possible» Propagate errors up only when lower layer cannot handle it.» Hide errors as much as possible many HW errors are transient Synchronous read/write at application level» Most I/O hardware operates asynchronously» Synchronous (blocking) read/write easier to program 13 Structured I/O SW to meet Goals Structured I/O SW to meet these Goals User-level Software Device-Independent OS SW Device Drivers Interrupt Handlers 14

Interrupt Handlers Hidden from applications Used to bridge gap between asynchronous I/O hardware and synchronous read/write semantics Often implemented as top-half and bottom-half handlers» Top-half does as little as possible not scheduled» Bottom-half closely related to (if not exactly) the device driver scheduled 15 Device Drivers Device dependent code Each device driver handles (at most) one class of devices Device drivers communicate with the device controllers» Only part that knows the details of the device.» Hence, device dependent Translate device-independent (abstract) requests to device-specific commands 16

Device Driver Block to Sector Mappings Surface 0 n? Track Sector Device driver translates block requests into cylinder, track, and sector requests. p 1... 1 0 t 1... 1 0 s 1 0 1... 17 Device-Independent I/O Software Functions of device-independent I/O SW» Uniform interfacing for device drivers» Device naming Mnemonic names mapped to Major and Minor device numbers» Device protection» Providing a device-independent block size»buffering» Storage allocation on block devices» Allocation and releasing dedicated devices» Error Reporting In MINIX, most device-independent I/O SW is in the file system (layer 3). 18

User-Space I/O SW I/O Libraries (e.g., stdio) are in user-space to provide an interface to the OS resident device-independent I/O SW» These routines do the formatting for the user that is such a pain to do, but everyone wants it Simultaneous Peripheral Operations On-Line (Spooling)» A user-space print command puts a file in the spooling directory and then asks a daemon process to execute the I/O request» Printing is one use of spooling.» Others?» Why spool I/O? 19 Putting It All Together 20