CS 286 Computer Organization and Architecture

Slides:



Advertisements
Similar presentations
CS-334: Computer Architecture
Advertisements

FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
Input-output and Communication Prof. Sin-Min Lee Department of Computer Science.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Input / Output CS 537 – Introduction to Operating Systems.
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
Cpr E 308 Input/Output Recall: OS must abstract out all the details of specific I/O devices Today –Block and Character Devices –Hardware Issues – Programmed.
© 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.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
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.
Organisasi Sistem Komputer Materi VIII (Input Output)
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
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.
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.
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
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
بسم الله الرحمن الرحيم 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.
Computer Organization and Architecture + Networks Lecture 6 Input/Output.
Input/Output (I/O) Important OS function – control I/O
Input / Output Chapter 9.
William Stallings Computer Organization and Architecture 6th Edition
Department of Computer Science and Engineering
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Operating Systems (CS 340 D)
Input/Output.
CHAPTER 4 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
I/O system.
Chapter 3 Top Level View of Computer Function and Interconnection
CS703 - Advanced Operating Systems
IRQ, DMA and I/O Ports - Introduction -
CS 286 Computer Organization and Architecture
Computer Architecture
CSCI 315 Operating Systems Design
ECEG-3202 Computer Architecture and Organization
Operating Systems Chapter 5: Input/Output Management
Direct Memory Access Disk and Network transfers: awkward timing:
Chapter 5: I/O Systems.
Created by Vivi Sahfitri
CS 286 Computer Organization and Architecture
CS 286 Computer Organization and Architecture
Department of Computer Science
Department of Computer Science
Chapter 13: I/O Systems.
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
I/O subsystem Overview Peripheral Devices and IO Modules
Presentation transcript:

CS 286 Computer Organization and Architecture Input/Output and Bus Department of Computer Science Southern Illinois University Edwardsville Fall, 2017 Dr. Hiroshi Fujinoki E-mail: hfujino@siue.edu I/O_1/001

CS 286 Computer Organization and Architecture Methods to communicate I/O devices I/O devices Hardware sub-components in a computer system Devices a CPU can send/receive data to/from Connected to a CPU by bus (shared wires) Each device is assigned a unique ID (I/O port address) CPU  HDD Memory FDD Monitor   Bus (shared wires) Modem Printer Keyboard Mouse  I/O_1/002

CS 286 Computer Organization and Architecture FROM Memory I/O Device TO  Interrupt Memory I/O Device  Polling N.A.  Centralized DMA  ON-Card DMA (“move” instruction)  DMA  Programmed I/O  DMA  Centralized DMA  ON-Card DMA  DMA = “Direct Memory Access” I/O_1/003

CS 286 Computer Organization and Architecture Methods to communicate I/O devices Methods Direction Who do it?  I/O device  Memory The main processor  Interrupt  Memory  I/O device The main processor  Programmed-I/O  Polling  I/O device  Memory The main processor  Centralized-DMA  I/O device  Memory  Memory  I/O device The shared central DMA (on the motherboard)  On-Card DMA  I/O device  Memory  Memory  I/O device On-card DMA “DMA” = “Direct Memory Access” I/O_1/004

CS 286 Computer Organization and Architecture Data Transmission for I/O devices Interrupt: A mechanism that notifies unpredictable I/O events to a processor (1) Data transfer by interrupt = hardware interrupt + data transfer by CPU  = Hardware Interrupt for each byte received + = By CPU CPU BUS Memory  interrupt signal  Device Read  Data transfer to memory To Network Network Interface Card Buffer I/O_1/005

repeated multiple times CS 286 Computer Organization and Architecture Interrupt These steps will be repeated multiple times Procedures   a packet arrives  NIC generates interrupt signal and send it to the CPU  NIC CPU Memory  CPU makes a context switch    CPU reads data  CPU starts processing the packet   CPU writes data to memory  I/O_1/006

CS 286 Computer Organization and Architecture (1) Data transfer by interrupt (from an I/O device to MEMORY)  A NIC receives one byte from network  A NIC generates an interrupt signal to CPU  CPU jumps to interrupt service routine (device driver) of this NIC  CPU reads the received byte from the buffer of this NIC  CPU writes this byte to the memory  Repeats  through  as many as bytes in a packet I/O_1/007

CS 286 Computer Organization and Architecture Data Transmission for I/O devices Programmed I/O: A mechanism for a processor to send out-going data to I/O devices (1) Data transfer by programmed I/O for each byte  = Data read from memory by CPU  = Data sent to an I/O device by a CPU CPU Memory  Data transfer to I/O device  Data transfer to CPU BUS Network Interface Card To Network I/O_1/008

CS 286 Computer Organization and Architecture Data Transmission for I/O devices (2) Data transfer by Direct Memory Access (DMA) (A) By DMA controller on the system-board (“Centralized DMA”) CPU DMA Controller Memory  Read status  interrupt signal  Command BUS To Network Network Interface Card Buffer Cycle Stealing I/O_1/009

CS 286 Computer Organization and Architecture Data Transmission for I/O devices (B) By DMA controller on a device controller board (“On-Card DMA”) CPU DMA Controller Memory Signal the CPU when done BUS Network Interface Card Buffer DMA Controller To Network Burst mode I/O_1/010

CS 286 Computer Organization and Architecture (A) By DMA controller on the system-board (“Centralized DMA”) (from an I/O device to MEMORY)  A NIC receives one packet (not bytes) from network  A NIC generates an interrupt signal to CPU  CPU jumps to interrupt service routine (device driver) of this NIC  CPU reads the information of this packet from this NIC register  CPU sets DMA command, # of bytes received and memory address  DMA controller starts transferring byte by byte from NIC buffer to memory (cycle stealing) I/O_1/011

CS 286 Computer Organization and Architecture (B) By DMA controller on a device controller board (“On-Card DMA”) (from an I/O device to MEMORY)  A NIC receives one packet (not bytes) from network  DMA controller on the NIC starts transferring byte by byte from the buffer in the NIC to memory I/O_1/012

CS 286 Computer Organization and Architecture DMA Procedures   A packet arrives  NIC sends interrupt signal to CPU  NIC CPU Memory  NIC transfer data to memory (after all data arrives)   Context switch    CPU starts processing the packet in main memory I/O_1/013

CS 286 Computer Organization and Architecture

CS 286 Computer Organization and Architecture Polling Procedures   a packet arrives  CPU makes a context switch   CPU checks a register in NIC  NIC CPU Memory   CPU reads data   CPU starts processing the packet  CPU writes data to memory  I/O_1/015

CS 286 Computer Organization and Architecture Performance Analysis Interrupt Polling DMA Response Time Response Time = Waiting time after a packet arrives CPU Utilization CPU Utilization = Number of machine cycles Buffer Size Buffer Size = Size of buffer on a NIC Cost Cost = Cost of a NIC I/O_1/016

CS 286 Computer Organization and Architecture Data Transmission for I/O devices OUTPUT: Memory I/O Device (2) Data transfer by Direct Memory Access (DMA) (A) By DMA controller on the system-board (“Centralized DMA”) CPU DMA Controller Memory  Data transfer to I/O device  Command  Data read from memory BUS To Network Network Interface Card Buffer I/O_1/017

CS 286 Computer Organization and Architecture Data Transmission for I/O devices OUTPUT: Memory I/O Device (B) By DMA controller on a device controller board (“On-Card DMA”) Memory CPU  Command  Data transfer to I/O device BUS Network Interface Card Buffer DMA Controller To Network Burst mode I/O_1/018

CS 286 Computer Organization and Architecture (A) By DMA controller on the system-board (“Centralized DMA”) (from MEMORY to an I/O device)  CPU sends a DMA command (for data Tx to I/O device) to the DMA controller - Destination device address (I/O port #) - Number of bytes to be transferred - Beginning memory address  The DMA controller reads one byte from memory  The DMA controller sends the one byte data to the I/O device  The above two steps ( and ) are repeated as many bytes as in a packet  Once all the bytes in a packet are copied to the buffer, OS can issue a command “Disk Write” I/O_1/019

CS 286 Computer Organization and Architecture (1) Data transfer by Programmed I/O (from MEMORY to an I/O device)  CPU reads data from memory  CPU sends the data to the buffer in NIC  The above two steps are repeated as many bytes as in a packet  Once all the bytes in a packet are copied to the buffer, OS can issue a command “Disk Write” I/O_1/020

CS 286 Computer Organization and Architecture (B) By DMA controller on a device controller board (“On-Card DMA”) (from MEMORY to an I/O device)  CPU sends a DMA command (for data Tx to I/O device) to the DMA controller on the device controller for the NIC  The DMA controller reads one byte from memory  The DMA controller sends the one byte data to the I/O device  The above two steps ( and ) are repeated as many bytes as in a packet  Once all the bytes in a packet are copied to the buffer, OS can issue a command “Disk Write” I/O_1/021

The three methods for the OS to receive arriving packets from a NIC To a network NIC CPU How can the OS Copy a packet from NIC to its main memory? ? Memory Buffer Memory End System 1. Receiving packets by interrupt 2. Receiving packets by device polling 3. Receiving packets by DMA I/O_1/000

data transfer is required Data Transmission for I/O devices Most of data from I/O devices First go (save) to memory Then CPU uses the data from memory I/O device-to-memory data transfer is required Methods for I/O device to memory data transfer Input (receive data) from devices Output (send data) to devices  By interrupt  By programmed I/O  By device polling  By Direct Memory Transfer (DMA)  By Direct Memory Transfer (DMA) I/O_1/000

Methods to communicate I/O devices  Separate I/O address space CPU Memory Memory Addressing Wires (Ax) Bus Data Wires (Dx) I/O Devices Addressing Wires (1) Specify memory address using “memory addressing wires” (2) Send/receive data to/from the memory address (using “data wires”) I/O_1/000

Methods to communicate I/O devices  Separate I/O address space  Memory-Mapped I/O Memory address space and I/O address space are separated Memory addressing wires an I/O addressing wires are separated Different data access instructions for memory and I/O devices A parts of memory address space are used for I/O address space (no separation for memory and I/O addresses) The same wires are used as addressing wires for both memory and I/O devices Same data access instructions for memory and I/O devices I/O_1/000

Methods to communicate I/O devices  Separate I/O address space CPU Memory Memory Addressing Wires Data Wires HDD Keyboard Monitor I/O Devices Addressing Wires (1) Specify I/O device (port) address using “I/O addressing wires” (2) Send/receive data to/from the specified I/O device using “data wires” I/O_1/000

Methods to communicate I/O devices  Memory-Mapped I/O CPU Memory Memory Addressing Wires HDD Keyboard Monitor Data Wires I/O devices are also addressed by memory address wires (1) Specify memory address using “memory addressing wires” (2) Send/receive data to/from the memory address I/O_1/000

Methods to communicate I/O devices  Memory-Mapped I/O CPU Memory Memory Addressing Wires HDD Keyboard Monitor Data Wires (1) Specify I/O device address using “memory addressing wires” (2) Send/receive data using the data wires I/O_1/000

Methods to communicate I/O devices  Separate I/O address space  Memory-Mapped I/O Memory Address Space Load/Save Load/Save Memory Address Space CPU CPU I/O Device Address Space I/O Device Address Space HDD HDD Keyboard IN/OUT Keyboard I/O_1/000

System Clock Architecture (i8080) ISA Bridge HDD Modem Sound Memory CPU Core CPU Clock (8 MHz) Only one clock cycle rate All components running at the same clock rate I/O_1/000

System Clock Architecture (i286, i386) CPU Clock (25, 33 MHz) ISA Bus Clock (8 MHz) ISA Bridge L2 HDD Modem Sound Memory CPU Core L1 Cache Slow and fast components now separated Two different clock cycle rates in a system I/O_1/000

System Clock Architecture (i486) Bridge L2 Memory CPU Core L1 Cache Modem HDD Local Bus ISA Sound Printer CPU Clock (33, 40, 50 MHz) PCI Bus Clock (33 MHz) ISA Bus Clock (8 MHz) Disk I/O and memory systems are now separated Three clock rates in a system Two bridges (North and South) I/O_1/000

System Clock Architecture (i486, Pentium) Bridge L2 Memory CPU Core L1 Cache Modem HDD Local Bus ISA Sound Printer CPU Clock (200 MHz) System Bus Clock (33 MHz) ISA Bus Clock (8 MHz) Front Bus Clock (66 MHz) CPU clock is now separated Four different clock rates in a system I/O_1/000

System Clock Architecture (Pentium II and after) Bridge L2 Memory CPU Core L1 Cache Modem HDD Local Bus ISA Sound Printer L1 Clock (200 MHz) System Bus Clock (33 MHz) ISA Bus Clock (8 MHz) Front Bus Clock (66 MHz) CPU Clock (400 MHz) CPU core is now separated from L1 cache unit Five different clock rates in a system I/O_1/000

User-Level I/O software I/O Software Layers User-Level I/O software Device-independent OS software Device Drivers Interrupt Handler Hardware (Device) I/O_1/000

Details of I/O device access Command registers Device registers Details of I/O device access Command registers Parameter registers Status registers CPU Data Wires Device Controller Command register Device registers Buffer Parameter register Example Disk write Status register Success/Failure Disk-Drive Unit (Device) I/O_1/000