Interrupts By Ryan Morris. Overview ● I/O Paradigm ● Synchronization ● Polling ● Control and Status Registers ● Interrupt Driven I/O ● Importance of Interrupts.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Computer Architecture
I/O Unit.
CS-334: Computer Architecture
Chapter 4 Conventional Computer Hardware Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
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.
CHAPTER 9: Input / Output
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
1 CSC 2405: Computer Systems II Spring 2012 Dr. Tom Way.
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.
Processor Structure & Operations of an Accumulator Machine
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
I/O Sub-System CT101 – Computing Systems.
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.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
CHAPTER 9: Input / Output
MICROPROCESSOR INPUT/OUTPUT
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
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.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do Computer-System.
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.
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.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
EECB 473 Data Network Architecture and Electronics Lecture 1 Conventional Computer Hardware Architecture
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
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.
Lecture on Central Process Unit (CPU)
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Review of Computer System Organization. Computer Startup For a computer to start running when it is first powered up, it needs to execute an initial program.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
I/O Organization Competency – C6. Important facts to remember when I/O devices are to be connected to CPU There is a vast variety of I/O devices. Some.
بسم الله الرحمن الرحيم 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.
Chapter 11 System Performance Enhancement. Basic Operation of a Computer l Program is loaded into memory l Instruction is fetched from memory l Operands.
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.
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
CS703 - Advanced Operating Systems
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
Computer Architecture
BIC 10503: COMPUTER ARCHITECTURE
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
Module 2: Computer-System Structures
Chapter 8 I/O.
Module 2: Computer-System Structures
Module 2: Computer-System Structures
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:

Interrupts By Ryan Morris

Overview ● I/O Paradigm ● Synchronization ● Polling ● Control and Status Registers ● Interrupt Driven I/O ● Importance of Interrupts

I/O Paradigm ● All I/O devices connect to a bus ● Processor Accesses I/O through fetch/store – All I/O devices are assigned a bus address

Synchronization ● Problems: – Devices cannot remember a list of commands, circuits execute commands as they are given – Processors are much faster than I/O devices, therefor the CPU must wait for one instruction to be executed before issuing the following command

Polling ● Most common way for older software to instruct the processor handle I/O devices. – CD/DVD, Keyboard, Mouse, Printer, etc. ● In essence the processor repeatedly asks devices if they are ready for the next instruction.

How to use polling ● Polling uses Fetch portion of fetch-store paradigm ● Because I/O uses a bus for access, pointers can be used to reference the memory area for a specific I/O device. On x86 System, memory address 0xb8000 is the start of the video ram. This address begins in the upper left corner, the following code will print “Hi” on the screen if compiled and linked as an x86 bootsector: void _start() {... } int main() { char *video = (char *) 0xb8000; video[0] = “H”; video[1] = 0x7; video[2] = “i”; video[3] = 0x7; while(1); }

How to use polling ● The following example demonstrates how to use polling via fetch-store to determine if a device is ready. Suppose the on a particular device on a fictitious machine which requires bus addresses 0x x130000, the address 0x is 0 when the device is busy and non-zero when it is available. The address 0x causes the device to perform some arbitrary function when set to 1. The following code would issue a command to the device, then wait for it to become available, then execute the command again. void test() { int *exec; int *wait; exec = 0x130000; wait = 0x120000; *exec = 1; while(*wait != 0); *exec = 1; }

Control and Status Registers ● Control Register – contiguous set of addresses that respond to store operation ● Status Register – contiguous set of addresses that respond to fetch operation

Main disadvantages of polling ● Requires lots of while() loops ● While circuits are non-complex and cheap, they are substantially slower than modern CPUs ● Adversely effect the systems performance

Interrupt Driven I/O ● Main differences: – Device tells CPU when it is done – Allows hardware to run independently of system – Requires 2-way bus to inform CPU upon completion of operation – Processors are required to have a method to stop current process to handle device – Different methods of programming (Polling vs Interrupt)

How interrupts work ● They don't actually “interrupt” anything ● They are simply realized between the execution of two instructions in the CPU's fetch-execute cycle. Repeat Forever { Test: any device interrupts? Fetch: access next step at IP Execute: perform next instruction }

Interrupt vector ● Essential for the interrupt process ● Each device is assigned a unique number in an array. These numbers act as an index to a pointer to the code in memory for that device. ● When an interrupt is triggered, the CPU asks which device activated the interrupt, the device responds with its unique number and the processor accesses that code in memory.

Interrupts ● When a computer starts up, generally interrupts are not checked for by the CPU until the OS turns interrupts on. ● Further more, most architectures disable interrupts while handling others.

Interrupt priority ● Problems can arise when a device that does not need to be serviced immediately, but takes a long time to service, interrupts the same time a device which needs service immediately. ● Processors usually have 7-15 levels of priority – This assures that hard drives get read/written before a printer head is moved.

Interrupt Priority ● Manual Assignment – User configures both hardware and software to the correct interrupt priority ● Automatic Assignment – Computer starts, CPU uses bus to automatically assign priority.

Direct Memory Access ● Important aspect of high speed I/O ● Allows I/O devices to transfer data directly into memory without the intervention of the CPU – Allows the CPU to keep processing without having to read from the I/O device and then write to memory

Buffer Chaining ● Allows data coming from I/O devices to be stored in memory as a link list so it can be dealt with when the CPU is ready. ● Directly derived from DMA

Buffer Chaining ● Scatter Read – dividing large block of incoming data into multiple small buffers ● Gather Write – combining data from multiple small buffers into a single output block

Operation Chaining ● Generally a linked list in memory containing nodes with an operation and operand(s) ● The devices uses DMA to access the linked list and carries out the specified command with the operands provided, without the involvement of the CPU.

Importance of Interrupts ● Allows the processor to be free of controlling devices directly ● Allows for DMA and high speed I/O ● Opened doors for USB

Conclusion ● I/O Paradigm ● Synchronization ● Polling ● Control and Status Registers ● Interrupt Driven I/O ● Importance of Interrupts

Questions? ● Any Questions?