ITEC 1011 Introduction to Information Technologies 7. Input / Output Chapt. 8.

Slides:



Advertisements
Similar presentations
I/O Organization popo.
Advertisements

CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
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.
DIRECT MEMORY ACCESS CS 147 Thursday July 5,2001 SEEMA RAI.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
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.
1 Computer System Overview OS-1 Course AA
Basic Input/Output Operations
CHAPTER 9: Input / Output
1 COSC 3P92 Cosc 3P92 Week 11 Lecture slides Violence is the last refuge of the incompetent. Isaac Asimov, Salvor Hardin in "Foundation"
6. The CPU and Memory Chapt. 7.
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
2. Methods for I/O Operations
INPUT-OUTPUT ORGANIZATION
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.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Input and Output Computer Organization and Assembly Language: Module 9.
CHAPTER 9: Input / Output
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.
1. Introduction 2. Methods for I/O Operations 3. Buses 4. Liquid Crystal Displays 5. Other Types of Displays 6. Graphics Adapters 7. Optical Discs 10/01/20151Input/Output.
© 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.
DMA Versus Polling or Interrupt Driven I/O
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.
COMPUTER ORGANIZATIONS CSNB123 NSMS2013 Ver.1Systems and Networking1.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
1 Lecture 9 Input/Output ITEC 1000 “Introduction to Information Technology”
COMPUTER ORGANIZATIONS CSNB123. COMPUTER ORGANIZATIONS CSNB123 Expected Course Outcome #Course OutcomeCoverage 1Explain the concepts that underlie modern.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Input-Output Organization
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
Modes of transfer in computer
7. Peripherals 7.1 Introduction of peripheral devices Computer Studies (AL)
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
Lecture 1: Review of Computer Organization
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
بسم الله الرحمن الرحيم 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.
Direct Memory Access (DMA) Department of Computer Engineering, M.S.P.V.L. Polytechnic College, Pavoorchatram. A Presentation On.
Practical Session 12 Input &Output (I/O). I/O Device Input / Output (I/O) devices Input / Output (I/O) devices provide the means to interact with the.
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.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
Input / Output Chapter 9.
CHAPTER 9: Input / Output
CHAPTER 9: Input / Output
CS 286 Computer Organization and Architecture
Computer Architecture
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

ITEC 1011 Introduction to Information Technologies 7. Input / Output Chapt. 8

ITEC 1011 Introduction to Information Technologies URL for the ITEC Student Club:

ITEC 1011 Introduction to Information Technologies Examples of I/O Devices DeviceInput/OutputDate Rate (Kbytes/s) KeyboardInput0.01 MouseInput0.02 Voice input (microphone)Input0.02 ScannerInput200 Voice output (speaker)Output0.5 Dot-matrix printerOutput1 Laser printerOutput100 Graphics displayOutput30,000 Local area networkInput/output200 – 20,000 Optical diskStorage (I/O)500 Magnetic tapeStorage (I/O)2,000 Magnetic diskStorage (I/O)2,000

ITEC 1011 Introduction to Information Technologies I/O Configurations (1 of 2) CPU I/O module I/O device Keyboard Mouse Voice input (microphone) Scanner Voice output (speaker) Dot-matrix printer Laser printer Graphics display Local area network Optical disk Magnetic tape Magnetic disk Can take many forms, e.g., Device controller Disk controller

ITEC 1011 Introduction to Information Technologies I/O Configurations (2 of 2) I/O device I/O module CPU I/O data I/O address I/O module I/O control

ITEC 1011 Introduction to Information Technologies Does this look familiar? I/O device I/O module CPU I/O data I/O address I/O module I/O control Data bus Address bus Control bus

ITEC 1011 Introduction to Information Technologies A Previous Question How is I/O differentiated from memory? Two possibilities Memory-mapped I/O I/O-mapped I/O

ITEC 1011 Introduction to Information Technologies Memory-Mapped I/O Memory and I/O… reside in the same “space” are accessed in the same manner Differentiated only by their addresses Example: STA address (store the contents of the accumulator at the specified address) STA 2000 might store A in memory STA 8000 might store A in an I/O device p. 236

ITEC 1011 Introduction to Information Technologies Memory Map FFFF 0000 Memory I/O

ITEC 1011 Introduction to Information Technologies A Previous Question How is I/O differentiated from memory? Two possibilities Memory-mapped I/O I/O-mapped I/O

ITEC 1011 Introduction to Information Technologies I/O-Mapped I/O Memory and I/O… Occupy different “spaces” Are accessed by unique instructions Differentiated by instructions Memory instructions Most instructions reference memory I/O instructions (see p. 361) move data to/from a specified I/O address (“port”) and a CPU register (e.g., the accumulator) IN port – inputs data from a device OUT port – outputs data to a device

ITEC 1011 Introduction to Information Technologies Memory Maps FFFF 0000 Memory I/O FFFF 0000

ITEC 1011 Introduction to Information Technologies Implementation of I/O-Mapped I/O Typically, access to memory and I/O uses the same address bus and data bus A dedicated control bus signal differentiates a “memory cycle” from an “I/O cycle” On Intel’s Pentium CPU, this control bus signal is named M/IO M/IO = 0  memory cycle M/IO = 1  input/output cycle

ITEC 1011 Introduction to Information Technologies One of the control bus signals is named M/IO M/IO I/O device CPU I/O data I/O address I/O module I/O control Data bus Address bus Control bus Memory

ITEC 1011 Introduction to Information Technologies Types of I/O Programmed I/O Interrupt-driven I/O Direct memory access (DMA)

ITEC 1011 Introduction to Information Technologies Programmed I/O I/O operations are under direct control of software (program) Software initiates the I/O operation Disadvantage: Slow Uses a lot of CPU resources Advantage: Simple p. 209

ITEC 1011 Introduction to Information Technologies Polling A form of programmed I/O, wherein device “status” is checked to determine if an I/O operation is needed E.g., A keyboard can be polled to determine if a key has been struck and a code is waiting to be read Useful when there are a lot of similar devices connected to one system (e.g., hundreds of terminals)

ITEC 1011 Introduction to Information Technologies Checking Device Status The I/O module has registers for data transfers (of course), plus it also has… Control/command registers To configure and control a device Status registers To check the status of a device These registers are read/written using Memory instructions (memory-mapped I/O) IN/OUT instructions (I/O-mapped I/O)

ITEC 1011 Introduction to Information Technologies Types of I/O Programmed I/O Interrupt-driven I/O Direct memory access (DMA)

ITEC 1011 Introduction to Information Technologies Interrupt-driven I/O I/O operations are initiated by the device The device, or its I/O module, includes a signal to interrupt the CPU These signals are called interrupt lines A typical CPU supports 8 to 16 interrupt inputs Typical names: IRQ1, IRQ2, IRQ3, etc. p. 211

ITEC 1011 Introduction to Information Technologies Servicing an Interrupt When an interrupt occurs (and is accepted), the execution of the current program is suspended A special routine executes to service the interrupt Then, the interrupted program resumes The service routine is called an interrupt handler or interrupt service routine (ISR)

ITEC 1011 Introduction to Information Technologies Saving Registers For the interrupted program to resume, the CPU status and data registers must be saved (because they will change during the ISR) They are saved before the ISR executes They are restored after the ISR executes They are saved either On the stack (a special area of memory to temporarily hold information), or In a process control block (PCB)

ITEC 1011 Introduction to Information Technologies Use of Interrupts As an external event notifier As a completion signal As a means of allocating CPU time As an abnormal event indicator

ITEC 1011 Introduction to Information Technologies Interrupts for External Events An interrupt signal occurs when an “event” occurs in a device – an event that requires the CPU’s attention E.g., Keyboard: a key has been hit (the ISR reads the code for the key) Notebook computer cover: the cover is closed (the ISR puts the computer in standby mode) p. 214

ITEC 1011 Introduction to Information Technologies Use of Interrupts As an external event notifier As a completion signal As a means of allocating CPU time As an abnormal event indicator

ITEC 1011 Introduction to Information Technologies Interrupts for Completion Signals An interrupt signal occurs when a device has completed an operation – and the CPU should know about it E.g., Printer: the output buffer is empty (the CPU can send more data) Scanner: a data transfer is complete (the CPU/application can proceed to process the image data) p. 215

ITEC 1011 Introduction to Information Technologies Use of Interrupts As an external event notifier As a completion signal As a means of allocating CPU time As an abnormal event indicator

ITEC 1011 Introduction to Information Technologies Interrupts for Allocating CPU Time Useful on multi-tasking systems – systems that can execute more than one program at a time E.g., A timer is programmed to interrupt the CPU every 100 µs (for example) The ISR is a “dispatcher program” Execution switches to another program (for 100 µs), etc. p. 216

ITEC 1011 Introduction to Information Technologies Use of Interrupts As an external event notifier As a completion signal As a means of allocating CPU time As an abnormal event indicator

ITEC 1011 Introduction to Information Technologies Interrupts for Abnormal Events An interrupt signal occurs when an abnormal event occurs that needs immediate system attention E.g., A heat sensor near the CPU chip – if the temperature is too high, an interrupt is generated, the ISR activates the fan near the CPU chip p. 216

ITEC 1011 Introduction to Information Technologies Types of I/O Programmed I/O Interrupt-driven I/O Direct memory access (DMA)

ITEC 1011 Introduction to Information Technologies Why DMA? Used for high-speed block transfers between a device and memory During the transfer, the CPU is not involved Typical DMA devices: Disk drives, tape drives Remember (1 st slide) Keyboard data rate  0.01 KB/s (1 byte every 100 ms) Disk drive data rate  2,000 KB/s (1 byte every 0.5 µs) Transfer rate is too high to be controlled by software executing on the CPU p. 223

ITEC 1011 Introduction to Information Technologies How The CPU “prepares” the DMA operation by transferring information to a DMA controller (DMAC): Location of the data on the device Location of the data in memory Size of the block to transfer Direction of the transfer Mode of transfer (burst, cycle steal) When the device is ready to transfer data, the DMAC takes control of the system buses (next few slides)

ITEC 1011 Introduction to Information Technologies “Taking Control” (1 of 2) CPUDMAC BR BG BGACK BR BG BGACK BR = Bus request (DMAC: May I take control of the system buses?) BG = Bus grant (CPU: Yes, here you go.) BGACK = BG acknowledge (DMAC: Thanks, I’ve got control.) Control Bus signals

ITEC 1011 Introduction to Information Technologies DMAC issues a BR (“bus request”) signal CPU halts (perhaps in the middle of an instruction!) and issues a BG (“bus grant”) signal DMAC issues BGACK (“bus grant acknowledge”) and releases BR DMAC has control of the system buses DMAC “acts like the CPU” and generates the bus signals (e.g., address, control) for one transfer to take place Then… “Taking Control” (2 of 2)

ITEC 1011 Introduction to Information Technologies DMA Transfers (2 of 2) Burst mode This transfer is repeated until complete DMAC relinquishes control of the system buses by releasing BGACK Cycle steal mode DMAC relinquishes control of the system buses by releasing BGACK A BR-BG-BGACK sequence occurs for every transfer, until the block is completely transferred DMAC interrupts the CPU when the transfer is complete This is an example of a “completion signal” interrupt

ITEC 1011 Introduction to Information Technologies BR-BG-BGACK Timing BR BG BGACK CPU cycles CPU cycles DMA cycles time

ITEC 1011 Introduction to Information Technologies Burst Mode vs. Cycle Steal Mode Burst mode: Cycle steal mode: Legend: CPU cycle DMA cycle BR/BG/BGACK sequence time

ITEC 1011 Introduction to Information Technologies DMA includes all three types of I/O. Let’s see… Types of I/O Programmed I/O Interrupt-driven I/O Direct memory access (DMA)

ITEC 1011 Introduction to Information Technologies Program-Controlled I/O (in DMA) Data bus Address bus Control bus Memory DMAC CPU Disk The CPU “prepares” the DMAC

ITEC 1011 Introduction to Information Technologies DMA Data bus Address bus Control bus Memory DMAC CPU Disk The transfer takes place

ITEC 1011 Introduction to Information Technologies Interrupt-driven I/O (in DMA) Data bus Address bus Control bus Memory DMAC CPU Disk The DMAC interrupts the CPU when the transfer is complete IRQ

ITEC 1011 Introduction to Information Technologies I/O System Architectures Bus architecture Channel architecture

ITEC 1011 Introduction to Information Technologies Bus Architecture Used in (pretty well all) PCs, workstations, and some mainframe computers We have already met the data, address, and control buses that connect a CPU to memory and I/O modules Collectively, these are the “CPU bus”or “system bus” Between the I/O modules and I/O devices, an “I/O bus” is required A “bus interface” connects one bus to another Let’s have another look… p. 228

ITEC 1011 Introduction to Information Technologies “I/O bus” “Bus interface” “CPU bus” or “System bus” CPU-Memory-I/O Architecture CPU I/O module Memory I/O device

ITEC 1011 Introduction to Information Technologies I/O System Architectures Bus architecture Channel architecture

ITEC 1011 Introduction to Information Technologies Channel Architecture An alternative I/O architecture Used by IBM in their 370/XA and ESA/370 mainframe computers I/O occurs through an “I/O processor” – the “channel subsystem” Frees the CPU for other tasks Has its own instruction set – “channel control words” Channel control words stored as “programs”, just like other CPU instructions Channel programs transfer data between I/O devices and memory via DMA p. 236

ITEC 1011 Introduction to Information Technologies CPUMemory Channel subsystem Control unit Device Channel paths Device I/O Channel Architecture

ITEC 1011 Introduction to Information Technologies Thank you