CS2100 Computer Organisation Input/Output (AY2010/2011) Semester 2 Adapted from.

Slides:



Advertisements
Similar presentations
I/O InterfaceCS510 Computer ArchitecturesLecture Lecture 17 I/O Interfaces and I/O Busses.
Advertisements

IT253: Computer Organization
I/O Organization popo.
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.
CS1104 – Computer Organization
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
CPE 442 io.1 Introduction To Computer Architecture CpE 442 I/O Systems.
CSCE 212 Chapter 8 Storage, Networks, and Other Peripherals Instructor: Jason D. Bakos.
IOSystems.1 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output  Important metrics for an I/O system l Performance.
EE30332 Ch8 DP – 1 Ch 8 Interfacing Processors and Peripherals Buses °Fundamental tool for designing and building computer systems divide the problem into.
Lecture 25 Buses and I/O (2)
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
Interrupts (contd..) Multiple I/O devices may be connected to the processor and the memory via a bus. Some or all of these devices may be capable of generating.
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.
1 CSE SUNY New Paltz Chapters 8 Interfacing Processors and Peripherals.
1  2004 Morgan Kaufmann Publishers Chapters 8 & 9 (partial coverage)
1 Interfacing Processors and Peripherals I/O Design affected by many factors (expandability, resilience) Performance: — access latency — throughput — connection.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 22 - Input/Output.
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.
I/0 devices.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Storage & Peripherals Disks, Networks, and Other Devices.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
CPU BASICS, THE BUS, CLOCKS, I/O SUBSYSTEM Philip Chan.
1chapter 8 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output Important metrics for an I/O system –Performance.
The Big Picture: Where are We Now?
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
MICROPROCESSOR INPUT/OUTPUT
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Storage Systems CS465 Lecture 12 CS465.
2.1 Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General.
Lecture 35: Chapter 6 Today’s topic –I/O Overview 1.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
August 1, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 9: I/O Devices and Communication Buses * Jeremy R. Johnson Wednesday,
CSIE30300 Computer Architecture Unit 11: Bus and I/O Systems Hsin-Chou Chi [Adapted from material by and
MBG 1 CIS501, Fall 99 Lecture 18: Input/Output (I/O): Buses and Peripherals Michael B. Greenwald Computer Architecture CIS 501 Fall 1999.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
Csci 136 Computer Architecture II – Buses and IO
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
Adapted from Computer Organization and Design, Patterson & Hennessy ECE232: Hardware Organization and Design Part 17: Input/Output Chapter 6
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Chapter 6 Storage and Other I/O Topics. Chapter 6 — Storage and Other I/O Topics — 2 Introduction I/O devices can be characterized by Behaviour: input,
IT3002 Computer Architecture
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.
1 Lecture 14 Buses and I/O Data Transfer Peng Liu
بسم الله الرحمن الرحيم MEMORY AND I/O.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 26 Bus Interconnect May 7,
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
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.
1  2004 Morgan Kaufmann Publishers Page Tables. 2  2004 Morgan Kaufmann Publishers Page Tables.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 25 I/O Systems May 2,
Computer Organization & Design 计算机组成与设计 Weidong Wang ( 王维东 ) College of Information Science & Electronic Engineering 信息与通信工程研究所 Zhejiang.
CMSC 611: Advanced Computer Architecture I/O & Storage Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
CSCE 385: Computer Architecture Spring 2014 Dr. Mike Turi I/O.
Lecture 2. A Computer System for Labs
Chapter 2: Computer-System Structures
Computer Architecture
Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: illusion of having more physical memory program relocation protection.
Input-output I/O is very much architecture/system dependent
Presentation transcript:

CS2100 Computer Organisation Input/Output (AY2010/2011) Semester 2 Adapted from David Patternson’s lecture slides:

CS2100 Input/Output 2 THE BIG PICTURE Control Datapath Memory Processor Input Output Control Datapath Memory Processor Input Output Network

CS2100 Input/Output 3 INPUT/OUTPUT DEVICES

CS2100 Input/Output 4 WHY I/O MATTERS? CPU performance increase ~ 60% per year I/O performance increase < 10% per year  Limited by mechanical delays Amdahl’s Law: system speedup is limited by the slowest part Example:  Suppose 1 sec I/O + 4 sec CPU => 5 seconds  Increase CPU performance by 100% => 3 seconds  We only get 66% speedup => I/O bottleneck “I think Silicon Valley was misnamed. If you look back at the dollars shipped in products in the last decade, there has been more revenue from magnetic disks than from silicon. They ought to rename the place Iron Oxide Valley.” -- Al Hoagland, one of the pioneers of magnetic disks, 1982

CS2100 Input/Output 5 TYPES AND CHARACTERISTICS OF I/O DEVICES Behavior  Input: read once  Output: write only, cannot be read  Storage: can be reread and usually rewritten Partner  What’s on the other end? Human or machine Data Rate  Peek rate of transfer between I/O and memory/CPU

CS2100 Input/Output 6 I/O DEVICE EXAMPLES DeviceBehaviorPartnerData Rate (BB/sec) KeyboardInputHuman0.01 MouseInputHuman0.02 Line PrinterOutputHuman1.00 Floppy diskStorageMachine50.00 Laser PrinterOutputHuman Optical DiskStorageMachine Magnetic DiskStorageMachine5, Network-LANInput or outputMachine20 – 1, Graphics Display OutputHuman30,000.00

CS2100 Input/Output 7 MOUSE Invented by Douglas C. Engelbart (jointly with Bill English) in 1970 “SRI patented the mouse, but they really had no idea of its value. Some years later I learned that they had licensed it to Apple for something like $40,000.” -- Douglas C. Engelbart Douglas was as a pioneer of human-computer interaction whose team developed hypertext, networked computers, and precursors to GUIs Mouse uses optimal or mechanical means to determine the X-Y coordinates Bandwidth requirement limited by human hand coordination  We are too slow relative to the rate of reading mouse status First computer mouse

CS2100 Input/Output 8 MAGNETIC DISK Purpose:  Long term, nonvolatile storage  Large, inexpensive, and slow  Lowest level in the memory hierarchy Basic Idea:  Rely on a rotating platter coated with a magnetic surface  Use a moveable read/write head to access the disk Registers Cache Memory Disk

CS2100 Input/Output 9 MAGNETIC DISK HISTORY Al Hoagland stands with the RAMAC he helped create five decades ago. A 2.5-inch laptop drive with the cover removed, a standard size in most laptops today, shown in the center of a 14-inch magnetic oxide coated disk, which was the standard size in the 1960’s and 1970’s.

CS2100 Input/Output 10 HARD DISK DRIVE EVOLUTION

CS2100 Input/Output 11 MAGNETIC DISK Typical numbers (depending on the disk size):  500 to 2,000 tracks per surface  32 to 128 sectors per track A sector is the smallest unit that can be read or written Traditionally all tracks have the same number of sectors:  Constant bit density: record more sectors on the outer tracks  Recently relaxed: constant bit size, speed varies with track location Platters Track Sector

CS2100 Input/Output 12 MAGNETIC DISK CHARACTERISTIC Cylinder: all the tacks under the head at a given point on all surface Read/write data is a three-stage process:  Seek time: position the arm over the proper track  Rotational latency: wait for the desired sector to rotate under the read/write head  Transfer time: transfer a block of bits (sector) under the read-write head Average seek time as reported by the industry:  Typically in the range of 8 ms to 12 ms  (Sum of the time for all possible seek) / (total # of possible seeks) Due to locality of disk reference, actual average seek time may:  Only be 25% to 33% of the advertised number Sector Track Cylinder Head Platter

CS2100 Input/Output 13 MAGNETIC DISK: TYPICAL NUMBERS Rotational Latency:  Most disks rotate at 3,600 to 7200 RPM  Approximately 16 ms to 8 ms per revolution, respectively  An average latency to the desired information is halfway around the disk: 8 ms at 3600 RPM, 4 ms at 7200 RPM Transfer Time is a function of :  Transfer size (usually a sector): 1 KB / sector  Rotation speed: 3600 RPM to 7200 RPM  Recording density: bits per inch on a track  Diameter typical diameter ranges from 2.5 to 5.25 in  Typical values: 2 to 12 MB per second Sector Track Cylinder Head Platter

CS2100 Input/Output 14 NETWORKS Medium to communicate between computers Characteristics  Distance: 0.01 to 10,000 km  Speed: to 100 MB/sec  Topology: Bus, Ring, Star, Tree Examples  RS232 standard – star topology, slow  LAN – bus topology, 10 Mbit/sec

CS2100 Input/Output 15 I/O SYSTEM  Bus is the connection between Processor, Memory and I/O  Communication between Processor and devices is via bus protocols and interrupts Processor Cache Memory - I/O Bus Main Memory I/O Controller Disk I/O Controller I/O Controller Graphics Network interrupts

CS2100 Input/Output 16 BUSES Consists of control and data lines  Control lines: Signal requests and acknowledgments  Data lines: Carry information between the source and the destination Bus Transactions  Sending the address  Receiving or sending the data Advantages  Versatility: single connection scheme for easy add-ons  Low cost: single set of writes shared in multiple ways Disadvantages  Communication bottleneck: bandwidth limits the maximum I/O throughput  Devices will not be able to use the bus when they need to

CS2100 Input/Output 17 TYPES OF BUSES Processor-Memory Bus (design specific)  Short and high speed  Only need to match the memory system Maximize memory-to-processor bandwidth  Connects directly to the processor  Optimized for cache block transfers I/O Bus (industry standard)  Usually is lengthy and slower  Need to match a wide range of I/O devices  Connects to the processor-memory bus or backplane bus Backplane Bus (standard or proprietary)  Backplane: an interconnection structure within the chassis  Allow processors, memory, and I/O devices to coexist  Cost advantage: one bus for all components

CS2100 Input/Output 18 A THREE-BUS SYSTEM A small number of backplane buses tap into the processor- memory bus  Processor-memory bus is used for processor memory traffic  I/O buses are connected to the backplane bus Advantage: loading on the processor bus is greatly reduced ProcessorMemory Processor Memory Bus Bus Adaptor Bus Adaptor Bus Adaptor I/O Bus Backplane Bus I/O Bus

CS2100 Input/Output 19 EXAMPLE: PENTIUM SYSTEM ORGANISATION Processor/Memory Bus PCI Bus [Backplane] I/O Busses [IDE, SCSI]

CS2100 Input/Output 20 OBTAINING ACCESS TO BUS Bus Master – Processor  Controls access to bus  Must initiate and control all bus requests Slave  Responds to read and write requests Drawback of using single master  Processor is involved in all requests Alternative schemes  Multiple bus masters  Mechanism for arbitrating access to the bus needed

CS2100 Input/Output 21 BUS ARBITRATION Bus arbitration scheme:  A bus master wanting to use the bus asserts the bus request  A bus master cannot use the bus until its request is granted  A bus master must release the bus back to the arbiter after finishing the transaction Bus arbitration schemes usually try to balance two factors:  Bus priority: the highest priority device should be serviced first  Fairness: Even the lowest priority device should never be completely locked out from the bus

CS2100 Input/Output 22 GIVING COMMANDS TO I/O DEVICES Two methods are used to address the device:  Special I/O instructions  Memory-mapped I/O Special I/O instructions specify:  Both the device number and the command word Device number: the processor communicates this via a set of wires normally included as part of the I/O bus Command word: this is usually send on the bus’s data lines Memory-mapped I/O:  Portions of the address space are assigned to I/O device  Read and writes to those addresses are interpreted as commands to the I/O devices  User programs are prevented from issuing I/O operations directly: The I/O address space is protected by the address translation

CS2100 Input/Output 23 I/O DEVICE NOTIFYING THE OS The OS needs to know when:  The I/O device has completed an operation  The I/O operation has encountered an error This can be accomplished in two different ways:  Polling: The I/O device put information in a status register The OS periodically check the status register  I/O Interrupt: Whenever an I/O device needs attention from the processor, it interrupts the processor from what it is currently doing.

CS2100 Input/Output 24 POLLING: PROGRAMMED I/O Advantage:  Simple: the processor is totally in control and does all the work Disadvantage:  Polling overhead can consume a lot of CPU time CPU IOC device Memory busy wait loop not an efficient way to use the CPU unless the device is very fast! but checks for I/O completion can be dispersed among computation intensive code Is the data ready? read data store data yes no done? no yes

CS2100 Input/Output 25 INTERRUPT DRIVEN DATA TRANSFER Advantage:  User program progress is only halted during actual transfer Disadvantage, special hardware is needed to:  Cause an interrupt (I/O device)  Detect an interrupt (processor)  Save the proper states to resume after the interrupt (processor) CPU IOC device Memory add sub and or nop read store... rti memory user program (1) I/O interrupt (2) save PC (3) interrupt service addr interrupt service routine (4) :

CS2100 Input/Output 26 I/O INTERRUPT An I/O interrupt is asynchronous with respect to instruction execution:  I/O interrupt is not associated with any instruction  I/O interrupt does not prevent any instruction from completion You can pick your own convenient point to take an interrupt I/O interrupt is complicated:  Needs to convey the identity of the device generating the interrupt  Interrupt requests can have different urgencies: Interrupt request needs to be prioritized

CS2100 Input/Output 27 DELEGATING I/O RESPONSIBILITY FROM THE CPU: DMA Direct Memory Access (DMA):  External to the CPU  Act as a master on the bus  Transfer blocks of data to or from memory without CPU intervention CPU IOC device Memory DMAC CPU sends a starting address, direction, and length count to DMAC. Then issues “start”. DMAC provides handshake signals for Peripheral Controller, and Memory Addresses and handshake signals for Memory.

CS2100 Input/Output 28 SUMMARY I/O performance is limited by weakest link in chain between OS and device Wide range of devices Bus hierarchy and arbitration I/O device notifying the operating system:  Polling: it can waste a lot of processor time  I/O interrupt: similar to exception except it is asynchronous Delegating I/O responsibility from the CPU: DMA

CS2100 Input/Output 29 END