Unit10-Exceptions-EE357-Nazarian-Fall09

Unit10-Exceptions-EE - University University of Southern California Viterbi School of Engineering EE357 Basic Organization of Computer Systems

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
University of Southern California Viterbi School of Engineering EE357 asic Organization of Computer Systems Basic Organization of Computer Systems xceptions Exceptions References: 1) Textbook 2) Mark Redekopp’s slide series Shahin Nazarian Fall 2009 3) Freescale documents on CF
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Status Register T-bit = Trace Bit Used for debugging; when set, it can be used to pause the CPU after execution of each instruction S-bit = Supervisor Bit ColdFire can run programs in two modes: supervisor mode (for OS and other system SW) and user mode (for user apps.) S = 1 => Supervisor mode / S = 0 => User Mode M-bit = Master/Interrupt Bit ssume 0 unless told otherwise Assume 0 unless told otherwise I-bits (IM) = Interrupt Priority Mask 3-bit value indicating which interrupt priorities ( I) to ignore Assume = 7=111 2 for now 15 13 12 10 9 8 4 3 2 1 0 Shahin Nazarian/EE357/Fall 2009 2 T 0 S I 0 0 0 X N Z V C SR: M 0
Background image of page 2
Supervisor and User Mode User applications are designed to run in user mode Operating System and other system software should run in supervisor mode Certain features/privileges are only allowed to code running in supervisor mode Shahin Nazarian/EE357/Fall 2009 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Supervisor Mode Privileges Privileged instructions (a few examples below…) MOVE #imm 16 ,SR => Sets SR = imm. STOP #imm 16 => Halt proc. & set SR = imm. User apps. shouldn’t be allowed to stop or reset e computer or arbitrarily change things in the SR the computer or arbitrarily change things in the SR Privileged Memory or I/O access Processor supports special areas of memory or I/O space that can only be accessed in supervisor mode Separate Stack areas 2 physical A7 registers: SSP and USP SSP (System SP) is used when in Supervisor Mode SP (User SP) is used when in User Mode Shahin Nazarian/EE357/Fall 2009 4 USP (User SP) is used when in User Mode
Background image of page 4
Exceptions Any event that causes a break in normal execution Error Conditions DIV by 0, unaligned address used for .W/.L ccess etc access, etc. Hardware Interrupts / Asynchronous HW Events Handling a keyboard press, mouse moving, new USB device, etc. Will be discussed in a future lecture System Calls / Traps (user mode -> supervisor mode) User applications calling OS code Shahin Nazarian/EE357/Fall 2009 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Error Condition Exceptions Access Error No memory or I/O device responds to a read or write Address Error Unaligned address used for W/L access llegal instruction Illegal instruction Invalid opcode Divide by 0 Privilege violation User code attempting to perform supervisor mode operation Trace violation Stop to call debugger P Exceptions Shahin Nazarian/EE357/Fall 2009 6 FP Exceptions
Background image of page 6
I/O Notification Interrupts are a method for alerting the processor that an I/O device needs attention ost I/O devices have a bit in an I/O status Most I/O devices have a bit in an I/O status register that is: Set to ‘1’ by HW when an event occurs (e.g.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/14/2010 for the course EE 357 at USC.

Page1 / 37

Unit10-Exceptions-EE - University University of Southern California Viterbi School of Engineering EE357 Basic Organization of Computer Systems

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online