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.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

I/O Organization popo.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
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.
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
I/O Unit.
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
Processor Design 5Z0321 Processor Design 5Z032 Chapter 8 Interfacing Processors and Peripherals Henk Corporaal.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
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 CSE SUNY New Paltz Chapters 8 Interfacing Processors and Peripherals.
1 Interfacing Processors and Peripherals I/O Design affected by many factors (expandability, resilience) Performance: — access latency — throughput — connection.
04/16/2010CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying an earlier edition.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
CPU BASICS, THE BUS, CLOCKS, I/O SUBSYSTEM Philip Chan.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
MICROPROCESSOR INPUT/OUTPUT
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Lecture 35: Chapter 6 Today’s topic –I/O Overview 1.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
Input/Output Computer component : Input/Output I/O Modules External Devices I/O Modules Function and Structure I/O Operation Techniques I/O Channels and.
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,
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
Computer Organization. This module surveys the physical resources of a computer system.  Basic components  CPU  Memory  Bus  I/O devices  CPU structure.
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
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.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 I/O through system calls Protection.
Copyright © 2007 by Curt Hill Interrupts How the system responds.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
1 COMP541 Interrupts, DMA, Serial I/O Montek Singh April 13, 2010.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Part IVI/O Systems Chapter 13: I/O Systems. I/O Hardware a typical PCI bus structure 2.
Amdahl’s Law & I/O Control Method 1. Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System.
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.
Computer Architecture
CS703 - Advanced Operating Systems
Computer Architecture
Chapter 13: I/O Systems.
Presentation transcript:

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 / RPM) — transfer: grab the data (one or more sectors) 2 to 15 MB/sec

How CPU talk to IO device? I/O hardware must contains some logical circuit to communicate with CPU Typically I/O hardware have some internal memory, called I/O registers –Those I/O registers can be accessed though some addresses “burned into” the device in prior. –CPU can read/write those addresses –CPU treat them as memory addresses I/O registers can be –Control register: when CPU write a particular value to this address, a particular I/O function will be done –Status register: CPU can read this address to see the current status of the device. –Data register: contain data CPU want from the I/O device.

A typical I/O procedure to read one byte from a I/O device CPU send a command to the control register of a I/O device CPU keep reading the status register until data is ready. CPU read the data register

How CPU Interact with I/O Dev For a read, CPU supplies address and transaction type (read) –Yes, each I/O device has an address, like memory slots. Device places data on data bus and indicates data ready (how?). Read serial port (RS- 232) outport(0x2fb, 1); While (1){ status = inport (0x2fc); if (status==1){ y = inport (0x2fd); break; }

Memory-Mapped I/O –Device is controlled by writing certain commands to the device controller’s register –The address for Device controller’s register overlapped with main memory MIPS I/O is done through lw and sw instruction. X86: The I/O instructions IN and OUT move data between I/O ports and CPU register Some CPUs only execute IO instructions in "supervisor mode". Internal register Main mem IO Dev 1 Internal register IO Dev 2

What is BUS A bus is a shared communication link Including data, address and control A bus transaction includes two parts: Sending the address and requested action Receiving or sending the data (blocks)

Bus Adapter The I/O code showed early is not efficient User bus adapter to relieve CPU from low IO operations. –Usually a simple chip that execute desired bus transaction Many bus adapter are connected to a common physical bus °the one start bus trans is called the bus master The one response to the bus req is called the bus slave Most IO controllers, your desktop motherboard contains many such chips, can act as both master and slave A bus transaction still must be kicked off by your program –Typically several IO instructions

Type of IO Bus Processor-Memory Bus, Connects directly to the processor –Short and high speed –Only need to match the memory system I/O Bus – Usually is lengthy and slower, –Need to match a wide range of I/O devices –Connects to the processor-memory bus – many subtypes: ISA, PCI, USB.. Differ in the number of data lines Backplane Bus: –Allow processors, memory, and I/O devices to coexist Arbitration: Support multiple device of same bus protocols E.g., if the system has two network interface cards, how to determine which one can use the shared bus?

Typical Desktop Bus

Support Efficient IO — polling always work, IO controller is the most simply — interrupts IO controller must be able to raise a line when data is ready — DMA Can initiate a bus transaction to transfer data between the device and other components (MEM or other IO device)

INTERRUPT I/O Steps involved in interrupt I/O The external device, when ready and needs CPU service gives an interrupt request signal to the CPU. The CPU completes the current instruction cycle and sends an interrupt acknowledgement signal back to the I/O device. The device provides an interrupt vector number to the CPU so that the processor generates the starting address of the ISR. The CPU saves PC, status register, and data registers on the stack and loads PC with the starting address of the ISR. The CPU completes the execution of the ISR, restores register values, and returns back to the main program

Steps involved in DMA The I/O device gives a DMA request to the CPU through the DMA controller. The CPU completes the current microinstruction cycle. The CPU loads the DMA controller with the starting address of the block of data that needs to be transferred, the size of the block, and the address of the device that has requested the transfer. The CPU then isolates from the system and sends a DMA acknowledge signal back to the DMA controller to let it know that the DMA controller can take control over the system buses. DMA I/O

Example: what happens when you fwrite(fd, buf, 4096k): Your code: call the driver and move on the disk driver (upon interrupt) Calculate the phy disk block Write disk block # to IDE controller Write buf addr to the IDE controller Write a start command to IDE controller IDE controller: read one block from memory and write to disk (DMA) When done, raise interrupt and trigger the disk driver