W10_19_Interrupts - 19 Interrupts CSC 230 Department of...

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

View Full Document Right Arrow Icon
19 Interrupts CSC 230 Department of Computer Science University of Victoria
Background image of page 1

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

View Full DocumentRight Arrow Icon
What is an Interrupt? An interrupt is an unscheduled event that requires the CPU to stop normal program execution and perform some service related to the event External external circuitry enerates an vent Internal software errors or from ternal ircuitry (e.g. generates an event (e.g. a peripheral) Î Called an INTERRUPT internal circuitry (e.g. division by zero) Î Called an EXCEPTION Applications: 9 coordination of I/O activities leaving CPU free 9 graceful way to exit from software error 9 multitasking (signal end of time slot) 9 timer interrupt to indicate delays 9 page faults or paging 2
Background image of page 2
Typical sources for interrupts or exceptions Typical interrupts: ± a timer event character from an input Typical exceptions: ± an ALU exception e.g. ivide by zero overflow ± a character from an input device ± a button push ± a sensor signal divide by zero, overflow ± an addressing fault ± an external device completes an operation externals internals An interrupt is an event outside the program which requires the program to halt what it is doing, take appropriate action, and then (usually) return to the point where it was interrupted.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Seems similar to a subroutine call! onceptually an interrupt forces Conceptually, an interrupt forces a special type of jump to a special kind of subroutine at an indeterminate point in the program PRINT routine Program 2 Program 1 COMPUTE routine 2 1 Interrupt i i 1 + ransfer of control through the use of interrupts M Transfer of control through the use of interrupts. 4
Background image of page 4
Some Differences between a Subroutine Call and an Interrupt A1. Subroutine performs tasks required by control flow of A2. Interrupt is not scheduled by the program, may even be caused by or related to program other processes/users B1. Subroutine always eturns to where it B2. After an interrupt, xecution may: returns to where it was called from and program resumes execution execution may: i. Return where it left off (as in a subroutine call); i. Return to a different place in the application program (e.g. like a ‘catch’ block in ava) Java) ii. Exit from the application and return to the OS; iii. Exit from the OS and shut down (the ‘blue screen of death’?).
Background image of page 5

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

View Full DocumentRight Arrow Icon
Some basic concepts Î read more in textbook ± Interrupt line ± Interrupt service routine (ISR) a) General b) for each possibility / device ± Interrupt acknowledge signal (IACK) ± Return from interrupt ± Context switching ± Interrupt latency ± Saving states ± OS intervention Î more than just a mechanism for I/O transfers Î real-time control and processing
Background image of page 6
A basic sample sequence: 1 interrupt from 1 device (1)Device asserts “Interrupt” with a signal on an interrupt line (2)CPU stops computing and enters a general Interrupt Service Routine (ISR) (3)CPU disables Interrupts bits (using bits in Status Register) (4)CPU sends an acknowledgement to the device (5)Device resets the interrupt line signal (6)CPU services “Interrupt” with appropriate Interrupt Service Routine (7)CPU re-enables Interrupts bits (8)CPU resumes computing 7
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 01/15/2012 for the course CSC 230 taught by Professor Jasond.corless during the Summer '11 term at University of Victoria.

Page1 / 26

W10_19_Interrupts - 19 Interrupts CSC 230 Department of...

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