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.

Slides:



Advertisements
Similar presentations
Homework Reading Machine Projects Labs
Advertisements

Computer Architecture
I/O Organization popo.
Computer Architecture
Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
I/O Unit.
CSCI 4717/5717 Computer Architecture
CS-334: Computer Architecture
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
68HC11 Polling and Interrupts
Interfacing. This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
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.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 13 Direct Memory Access (DMA)
Chapter 7 Interupts DMA Channels Context Switching.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
CHAPTER 9: Input / Output
I/O Systems CSCI 444/544 Operating Systems Fall 2008.
1 COSC 3P92 Cosc 3P92 Week 11 Lecture slides Violence is the last refuge of the incompetent. Isaac Asimov, Salvor Hardin in "Foundation"
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
ITEC 1011 Introduction to Information Technologies 7. Input / Output Chapt. 8.
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:
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
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.
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.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
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.
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.
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
COMPUTER ORGANIZATIONS CSNB123 NSMS2013 Ver.1Systems and Networking1.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
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.
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.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
6-1 Infineon 167 Interrupts The C167CS provides 56 separate interrupt sources that may be assigned to 16 priority levels. The C167CS uses a vectored interrupt.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
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.
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.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Input / Output Chapter 9.
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
Computer Architecture
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
Computer System Overview
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Chapter 13: I/O Systems.
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:

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 CPU in performing actual transfer 1. Direct I/O 2. Polled/Programmed I/O 3. Interrupt Driven I/O 4. Direct Memory Access

6-2 Direct I/O Only suitable for some I/O devices Simple devices – LEDs, simple switches etc. Device always ready to transfer data No status checking required Example: Simple Port I/O for Microchip PIC PORTB = PORTB | 0x40; x = PORTA; PORTBBits.3 = 1;

6-3 Polled/Programmed I/O Device indicates readiness to transfer data. Typically the device has a status flag that can be interrogated by the CPU CPU, under program control, reads (polls) the status waiting for the device to indicate readiness to transfer data Wastes CPU cycles (busy-waiting) Simple to understand and implement. CPU in control and performs the actual transfer

6-4 Interrupt Driven I/O Device has an output signal that is connected to a special signal of the CPU The device asserts the signal when it is ready to transfer data (Interrupt request) The CPU may ignore the request – the interrupt is said to be masked) Some CPUs have a special interrupt that is non- maskable. For very important interrupts such as alarms, power failure etc.

6-5 Interrupt Driven I/O Interrupt processing is unique to each CPU. Typical features  Enabled interrupts checked after each machine instruction.  Interrupt requests are usually prioritised  Most CPUs use an interrupt vectoring system  Each possible interrupt source is allocated a particular vector number/address  The CPU vectors to the address in the table and continues executing instructions.  The CPU returns to executing the interrupted program on encountering the special machine instruction Return from Interrupt

6-6 Typical Interrupt Processing normal program execution ISR: store regs restore regs. Return from Interrupt Interrupt processing VECTOR TABLE # Address Instruction H H 2 etc CHJUMP ISR H Interrupt request Return to interrupted program NB Interrupting device allocated to vector # 35

6-7 Interrupt Processing (contd.) Program counter(PC) is automatically pushed on the stack – possibly other regs. The vector address is generated by the interrupt hardware. The interrupt service routine (ISR) should preserve any registers that are used in the ISR. A special return from interrupt instruction should restore the PC and normal program execution should resume. An ISR may be interrupt by a higher priority request. The interrupt request is usually cleared by the hardware when it generates the vector.

6-8 Interrupt Processing (contd.) Potential problems  Re-entrancy of functions  Sharing of variables – mutual exclusion Solutions  Keep interrupt processing code to a minimum  Do not call other functions in the ISR  For shared variables use a data type that is accessed with an indivisible instruction e.g. single bit  Disable interrupts during shared variable access.

6-9 Direct Memory Access (DMA) Requires a DMA controller Data transferred without CPU being involved CPU programs the DMA controller  set transfer direction – input or output  Start address in memory  Number of bytes to transfer  Can copy memory to memory DMA controller performs the transfer between the memory and the I/O device DMA controller interrupts CPU on completion

6-10 DMA (Contd.) DMA signals – bus request, bus grant Operation  DMA request asserted  CPU generates DMA bus grant  CPU bus accesses suspended (CPU tri-stated)  DMA controller performs a memory transfer  DMA request negated Two modes  Cycle stealing – DMA and CPU interleave accesses  Burst mode

6-11 Summary Direct I/O – limited usage Polled/Programmed I/O  CPU initiates transfer request and data transferred by CPU between memory and I/O device.  Simple but wastes CPU time  May miss input data if data rate is higher than input sampling frequency.  Good for well defined periodic slow devices  Poor for input devices and non-periodic device

6-12 Summary (Contd.) Interrupts  I/O device initiates transfer  CPU via software still performs the data transfer  Good for non-period, asynchronous devices  Every interrupt incurs a time overhead  Very high interrupt rates can overload the CPU  Requires extra programming to set up the interrupt and interrupt service routine.  Can be difficult to test & debug  Examples: Keyboard input.

6-13 Summary (Contd.) DMA  Requires additional hardware  Good for transferring large blocks of data  CPU not involved in transferring data  Good for high data rates  Examples: Hard Disks, Network card