1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Chapter 8: Central Processing Unit
1 Exceptions, Interrupts & Traps Operating System Hebrew University Spring 2007.
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Processor System Architecture
CSCI 4717/5717 Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Chapter 6 Limited Direct Execution
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.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
LOGO Chapter 1 Interrupt handling. hardware interrupt Under x86, hardware interrupts are called IRQ's. When the CPU receives an interrupt, it stops whatever.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Spring’03 Introduction Operating Systems Spring 2003.
Chapter 7 Interupts DMA Channels Context Switching.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
Computer System Organization S H Srinivasan
A look at interrupts What are interrupts and why are they needed.
Hardware Support for Operating Systems Sunny Gleason Vivek Uppal COM S 414
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
OS Spring’04 Introduction Operating Systems Spring 2004.
Exceptions, Interrupts & Traps
Interrupt Mechanisms in the 74xx PowerPC Architecture Porting Plan 9 to the PowerPC Architecture Ajay Surie Adam Wolbach.
Midterm Wednesday 11/19 Overview: 25% First Midterm material - Number/character representation and conversion, number arithmetic - DeMorgan’s Law, Combinational.
COMPUTER SYSTEMS An Integrated Approach to Architecture and Operating Systems Chapter 4 Processor Implementation ©Copyright 2008 Umakishore Ramachandran.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
1 CSC 2405: Computer Systems II Spring 2012 Dr. Tom Way.
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:
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Introduction to Embedded Systems
COMP201 Computer Systems Exceptions and Interrupts.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
Input/ Output By Mohit Sehgal. What is Input/Output of a Computer? Connection with Machine Every machine has I/O (Like a function) In computing, 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.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Introduction to Embedded Systems Rabie A. Ramadan 6.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.
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.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Exceptional Control Flow Topics Exceptions except1.ppt CS 105 “Tour of the Black Holes of Computing”
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
Exceptions and Interrputs CS 321 – Introduction to Computer Architecture and Machine-Level Programming Barry Britt, Systems Analyst II Department of Computer.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
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.
بسم الله الرحمن الرحيم MEMORY AND I/O.
9/20/6Lecture 3 - Instruction Set - Al1 Exception Handling.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
Interrupts and exceptions
Interrupts and signals
Timer and Interrupts.
Computer System Overview
Exceptions Control Flow
Architectural Support for OS
Chapter 10 And, Finally... The Stack
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Computer System Overview
Architectural Support for OS
Presentation transcript:

1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions

2 Today’s Topics Exceptions –Reset –Interrupt –Exceptions

3 Terminology Exception –a condition causing the processor to escape from its normal control flow, to a pre-defined location (to deal with the condition) –Types Reset (external) Interrupt (external) Exception (internal) Software interrupt (internal)

4 Exception Types Reset –External (asynchronous to internal processing) –Puts the processor into a known, initial state –Jump to “reset vector” address Interrupt –External (asynchronous to internal processing) –Saves the current program counter and status register in special registers –Jump to “interrupt vector” address Exception –Internal (associated with some instruction; e.g., divide by 0) –Saves the current program counter and status register in special registers –Jump to “exception vector” address Software interrupt –Internal (associated with a special instruction called “software interrupt”) –Used to call system functions –Used to support debugging software/hardware

5 Interrupt & Reset PROCESSOR CORE RESET INTERRUPT CONTROLLER … Various Interrupt Sources

6 Interrupt Processing There are many interrupt sources –I/O devices Keyboards Mouse UART (Universal Asynchronous Receiver-Transmitter) (when character received, e.g.) Flash card controller (e.g., SmartMedia, memory stick, MMC, SD, CF, …) –DMA (Direct Memory Access) –Other peripheral devices Timers Watchdog timer –From outside the CPU These devices raise “interrupt” so that the CPU can stop what it has been doing and start paying attention to them –CPU saves the current PC and status automatically –Interrupt handler saves registers on stack –After interrupt is handled, interrupt handler restores the previous state and return to the previous job

7 Exception Processing Here, “exception” means an internally-generated interrupt condition –E.g., Divide-by-Zero, undefined instruction On detecting these events, the processor saves the current PC and the state, and jumps to an exception handler by jumping to a vector Exception handler –Saves registers –Figures out why exception occurred –Does some appropriate actions –Restores registers –Returns to execute the original instruction Software interrupt can be thought of as a type of exception –To implement some system call

8 Processor Support Refer to Chapter 5.6 Necessary functions –On detecting an interrupt or exception Processor saves the associated PC in a special register Processor saves the current state (status register) in a special register Processor jumps to a pre-defined vector address –Instructions To return to the exception-causing location To manipulate special registers –Processor modes Normal mode – user programs run in this mode Privileged mode – interrupt handlers and operating system codes run in this mode Processor switches from normal mode to privileged mode on exceptions/interrupts

9 To Summarize… Exceptions and interrupts are an important part of any processor Modern operating system heavily depends on the hardware support for exceptions Interrupt mechanism allows efficient use of CPU cycles by getting hold of it only when it is necessary Implementing this interrupt mechanism usually is complicated and requires a lot of validation efforts in a processor design cycle