CS61C L13 I/O © UC Regents 1 CS 161 Chapter 8 - I/O Lecture 17.

Slides:



Advertisements
Similar presentations
Chapter 6 I/O Systems.
Advertisements

So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
CPS216: Data-Intensive Computing Systems Data Access from Disks Shivnath Babu.
Chapter 8 Interfacing Processors and Peripherals.
1 Lecture 22: I/O, Disk Systems Todays topics: I/O overview Disk basics RAID Reminder: Assignment 8 due Tue 11/21.
I/O InterfaceCS510 Computer ArchitecturesLecture Lecture 17 I/O Interfaces and I/O Busses.
IT253: Computer Organization
CS61C L16 Disks © UC Regents 1 CS161 Lecture 25 - Disks Laxmi Bhuyan
Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
Secondary Storage Devices: Magnetic Disks
I/O Chapter 8. Outline Introduction Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6.
External Memory.
Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.
Chapter 5 Computing Components. 2 Chapter Goals Read an ad for a computer and understand the jargon List the components and their function in a von Neumann.
1 L14 Guilin Wang School of Computer Science The University of Birmingham [adapted from Ata Kaban] Memories, I/O devices and Networks.
Hard Disk Drives Chapter 7.
CSE431 Chapter 6A.1Irwin, PSU, 2008 Chapter 6A: Disk Systems Mary Jane Irwin ( ) [Adapted from Computer Organization.
Section 6.2. Record data by magnetizing the binary code on the surface of a disk. Data area is reusable Allows for both sequential and direct access file.
Chapter 5 Computing Components. 5-2 Chapter Goals Read an ad for a computer and understand the jargon List the components and their function in a von.
Device Management Ankur Saggar Nitin Golait Jason Foos Adam Estabrook.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
Lecture 21Comp. Arch. Fall 2006 Chapter 8: I/O Systems Adapted from Mary Jane Irwin at Penn State University for Computer Organization and Design, Patterson.
CMPT 300 Introduction to Operating Systems
COMP3221 lec29-io-examples-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 29: I/O Interfacing Examples - I
I/O Management and Disk Scheduling
CS1104 – Computer Organization
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
I/O Devices Connected to the Backplane bus Hard disk controllers
CS 430 – Computer Architecture Disks
Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
CS61C L16 Disks © UC Regents 1 CS61C - Machine Structures Lecture 16 - Disks October 20, 2000 David Patterson
CS 61C L40 I/O Networks (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
04/18/2007CSCI 315 Operating Systems Design1 Mass Storage Structure Notice: The slides for this lecture have been largely based on those accompanying the.
1  1998 Morgan Kaufmann Publishers Chapter 8 Storage, Networks and Other Peripherals.
Processor Design 5Z0321 Processor Design 5Z032 Chapter 8 Interfacing Processors and Peripherals Henk Corporaal.
11/18/2004Comp 120 Fall November 3 classes to go No class on Tuesday 23 November Last 2 classes will be survey and exam review Interconnect and.
1  1998 Morgan Kaufmann Publishers Chapter 8 Interfacing Processors and Peripherals.
CS 61C L26 Disks & Networks (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #26: Disks & Networks.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 22 - Input/Output.
Disk Technologies. Magnetic Disks Purpose: – Long-term, nonvolatile, inexpensive storage for files – Large, inexpensive, slow level in the memory hierarchy.
COMP381 by M. Hamdi 1 Input/Output Systems. COMP381 by M. Hamdi 2 Motivation: Who Cares About I/O? CPU Performance: 60% per year I/O system performance.
12/3/2004EE 42 fall 2004 lecture 391 Lecture #39: Magnetic memory storage Last lecture: –Dynamic Ram –E 2 memory This lecture: –Future memory technologies.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
Device Management. Serial Port Serial Device Serial Device Memory CPU Printer Terminal Modem Mouse etc.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Storage & Peripherals Disks, Networks, and Other Devices.
 Design model for a computer  Named after John von Neuman  Instructions that tell the computer what to do are stored in memory  Stored program Memory.
Topic 6: Further System Fundamentals. Fetch-Execute Cycle Review Computer programs are instructions stored in RAM Processor fetches instructions and executes.
August 1, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 9: I/O Devices and Communication Buses * Jeremy R. Johnson Wednesday,
© 2005 Pearson Addison-Wesley. All rights reserved Figure 2.1 This chapter focuses on key hardware layer components.
Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Csci 136 Computer Architecture II – IO and Storage Systems Xiuzhen Cheng
Five Components of Computers Input Output Memory Control Datapath Processor.
Adapted from Computer Organization and Design, Patterson & Hennessy ECE232: Hardware Organization and Design Part 17: Input/Output Chapter 6
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
1 Ó1998 Morgan Kaufmann Publishers Chapter 8 I/O Systems.
Device Management Mark Stanovich Operating Systems COP 4610.
10/15: Lecture Topics Input/Output –Types of I/O Devices –How devices communicate with the rest of the system communicating with the processor communicating.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 25 I/O Systems May 2,
Sarah Diesburg Operating Systems CS 3430
Introduction to I/O Where does the data for our CPU and memory come from or go to? Computers communicate with the outside world via I/O devices. Input.
CSE 153 Design of Operating Systems Winter 2018
Input-output I/O is very much architecture/system dependent
Persistence: hard disk drive
Persistence: I/O devices
Presentation transcript:

CS61C L13 I/O © UC Regents 1 CS 161 Chapter 8 - I/O Lecture 17

CS61C L13 I/O © UC Regents 2 Anatomy: 5 components of any Computer Processor (active) Computer Control (“brain”) Datapath (“brawn”) Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Display, Printer Disk (where programs, data live when not running)

CS61C L13 I/O © UC Regents 3 I/O Device Examples and Speeds °I/O Speed: bytes transferred per second (from mouse to display: million-to-1) °DeviceBehaviorPartner Data Rate (Mbit/sec) KeyboardInputHuman MouseInputHuman Laser PrinterOutput Human Magnetic DiskStorageMachine Modem I or O Machine Network-LANI or OMachine Graphics DisplayOutputHuman See Fig. 8.2 Text

CS61C L13 I/O © UC Regents 4 Buses in a PC: connect a few devices CPU Memory bus Memory SCSI: External I/O bus (1 to 15 disks) SCSI Interface Ethernet Interface Ethernet Local Area Network °Data rates Memory: 133 MHz, 8 bytes  1064 MB/s (peak) PCI: 33 MHz, 8 bytes wide  264 MB/s (peak) SCSI: “Ultra3” (80 MHz), “Wide” (2 bytes)  160 MB/s (peak) Ethernet: 12.5 MB/s (peak) PCI Interface PCI: Internal (Backplane) I/O bus

CS61C L13 I/O © UC Regents 5

6 Disk Device Terminology °Several platters, with information recorded magnetically on both surfaces (usually) °Actuator moves head (end of arm,1/surface) over track (“seek”), select surface, wait for sector rotate under head, then read or write “Cylinder”: all tracks under heads °Bits recorded in tracks, which in turn divided into sectors (e.g., 512 Bytes) Platter Outer Track Inner Track Sector Actuator HeadArm

CS61C L13 I/O © UC Regents 7 Disk Device Performance Platter Arm Actuator HeadSector Inner Track Outer Track °Disk Latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead °Seek Time? depends no. tracks move arm, seek speed of disk °Rotation Time? depends on speed disk rotates, how far sector is from head °Transfer Time? depends on data rate (bandwidth) of disk (bit density), size of request Controller Spindle

CS61C L13 I/O © UC Regents 8 Disk Device Performance °Average distance sector from head? °1/2 time of a rotation 7200 Revolutions Per Minute  120 Rev/sec 1 revolution = 1/120 sec  8.33 milliseconds 1/2 rotation (revolution)  4.16 ms °Average no. tracks move arm? Sum all possible seek distances from all possible tracks / # possible -Assumes average seek distance is random Disk industry standard benchmark

CS61C L13 I/O © UC Regents 9 Disk Performance Model /Trends ° Capacity + 100%/year (2X / 1.0 yrs) °Transfer rate (BW) + 40%/year (2X / 2.0 yrs) °Rotation + Seek time – 8%/ year (1/2 in 10 yrs) °MB/$ > 100%/year (2X / <1.5 yrs) Fewer chips + areal density

CS61C L13 I/O © UC Regents 10

CS61C L13 I/O © UC Regents 11 Disk Performance °Calculate time to read 1 sector (512B) for UltraStar 72 using advertised performance; sector is on outer track Disk latency = average seek time + average rotational delay + transfer time + controller overhead = 5.3 ms * 1/(10000 RPM) KB / (50 MB/s) ms = 5.3 ms /(10000 RPM/(60000ms/M)) KB / (50 KB/ms) ms = ms = 8.55 ms

CS61C L13 I/O © UC Regents 12 Instruction Set Architecture for I/O °Some machines have special input and output instructions °Alternative model (used by MIPS): Input: ~ reads a sequence of bytes Output: ~ writes a sequence of bytes °Memory also a sequence of bytes, so use loads for input, stores for output Called “Memory Mapped Input/Output” A portion of the address space dedicated to communication paths to Input or Output devices (no memory there)

CS61C L13 I/O © UC Regents 13 Memory Mapped I/O °Certain addresses are not regular memory °Instead, they correspond to registers in I/O devices 0 0xFFFFFFFF 0xFFFF0000 cmd reg. data reg. address

CS61C L13 I/O © UC Regents 14 Processor-I/O Speed Mismatch °500 MHz microprocessor can execute 500 million load or store instructions per second, or 2,000,000 KB/s data rate I/O devices from 0.01 KB/s to 30,000 KB/s °Input: device may not be ready to send data as fast as the processor loads it Also, might be waiting for human to act °Output: device may not be ready to accept data as fast as processor stores it °What to do?

CS61C L13 I/O © UC Regents 15 Processor Checks Status before Acting: Polling °Path to device generally has 2 registers: 1 register says it’s OK to read/write (I/O ready), often called Control Register 1 register that contains data, often called Data Register °Processor reads from Control Register in loop, waiting for device to set Ready bit in Control reg to say its OK (0  1) °Processor then loads from (input) or writes to (output) data register Load from device/Store into Data Register resets Ready bit (1  0) of Control Register

CS61C L13 I/O © UC Regents 16 Cost of Polling? °Assume for a processor with a 500-MHz clock it takes 400 clock cycles for a polling operation (call polling routine, accessing the device, and returning). Determine % of processor time for polling Mouse: polled 30 times/sec so as not to miss user movement Floppy disk: transfers data in 2-byte units and has a data rate of 50 KB/second. No data transfer can be missed. Hard disk: transfers data in 16-byte chunks and can transfer at 8 MB/second. Again, no transfer can be missed.

CS61C L13 I/O © UC Regents 17 % Processor time to poll mouse, floppy °Mouse Polling Clocks/sec = 30 * 400 = clocks/sec % Processor for polling = 12*10 3 /500*10 6 = 0.002%  Polling mouse little impact on processor °Times Polling Floppy/sec = 50 KB/s /2B = 25K polls/sec Floppy Polling Clocks/sec = 25K * 400 = 10,000,000 clocks/sec % Processor for polling = 10*10 6 /500*10 6 = 2%  OK if not too many I/O devices

CS61C L13 I/O © UC Regents 18 % Processor time to hard disk °Times Polling Disk/sec = 8 MB/s /16B = 500K polls/sec Disk Polling Clocks/sec = 500K * 400 = 200,000,000 clocks/sec % Processor for polling: 200*10 6 /500*10 6 = 40%  Unacceptable

CS61C L13 I/O © UC Regents 19 What is the alternative to polling? Interrupt °Wasteful to have processor spend most of its time “spin-waiting” for I/O to be ready °Wish we could have an unplanned procedure call that would be invoked only when I/O device is ready °Solution: use exception mechanism to help I/O. Interrupt program when I/O ready, return when done with data transfer

CS61C L13 I/O © UC Regents 20 Interrupt Driven Data Transfer (1) I/O interrupt (2) save PC (3) interrupt service addr Memory add sub and or user program read store... jr interrupt service routine (4) (5)

CS61C L13 I/O © UC Regents 21 Benefit of Interrupt-Driven I/O °500 clock cycle overhead for each transfer, including interrupt. Find the % of processor consumed if the hard disk is only active 5% of the time. °Interrupt rate = polling rate Disk Interrupts/sec = 8 MB/s /16B = 500K interrupts/sec Disk Polling Clocks/sec = 500K * 500 = 250,000,000 clocks/sec % Processor for during transfer: 250*10 6 /500*10 6 = 50% °Disk active 5%  5% * 50%  2.5% busy

CS61C L13 I/O © UC Regents 22 4 Responsibilities leading to OS °The I/O system is shared by multiple programs using the processor °Low-level control of I/O device is complex because requires managing a set of concurrent events and because requirements for correct device control are often very detailed °I/O systems often use interrupts to communicate information about I/O operations °Would like I/O services for all user programs under safe control

CS61C L13 I/O © UC Regents 23 Direct Memory Access (DMA) °How to transfer data between a Device and Memory? Wastage of CPU cycles if done through CPU. °Let the device controller transfer data directly to and from memory => DMA °The CPU sets up the DMA transfer by supplying the type of operation, memory address and number of bytes to be transferred. °The DMA controller contacts the bus directly, provides memory address and transfers the data °Once the DMA transfer is complete, the controller interrupts the CPU to inform completion. °Cycle Stealing – Bus gives priority to DMA controller thus stealing cycles from the CPU

CS61C L13 I/O © UC Regents 24 Why Networks? °Originally sharing I/O devices between computers (e.g., printers) °Then Communicating between computers (e.g, file transfer protocol) °Then Communicating between people (e.g., ) °Then Communicating between networks of computers  Internet, WWW

CS61C L13 I/O © UC Regents 25 What makes networks work? °links connecting switches to each other and to computers or devices Computer network interface switch °ability to name the components and to route packets of information - messages - from a source to a destination °Layering, protocols, and encapsulation as means of abstraction

CS61C L13 I/O © UC Regents 26 Typical Types of Networks °Local Area Network (Ethernet) Inside a building: Up to 1 km (peak) Data Rate: 10 Mbits/sec, 100 Mbits /sec,1000 Mbits/sec (1.25, 12.5, 125 MBytes/s) Run, installed by network administrators °Wide Area Network Across a continent (10km to km) (peak) Data Rate: 1.5 Mbits/sec to 2500 Mbits/sec Run, installed by telephone companies °Wireless Networks,...

CS61C L13 I/O © UC Regents 27 ABCs: many computers °switches and routers interpret the header in order to deliver the packet °source encodes and destination decodes content of the payload network interface device OS appln OS appln