Lec04&05-Interrupts

Lec04&05-Interrupts - National University of Computer...

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

View Full Document Right Arrow Icon
Operating System Spring 07 National University Lec 04-Interrupts Prepared by Uzma Maroof uzma.maroof@nu.edu.pk
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 A Question A Question The operating system Gets an input Performs a computation Produces an output And Quits Yes or no? The answer: No The operating system is a Reactive Program
Background image of page 2
3 Operating System Operating System Modern Operating Systems are Interrupt driven ??? If No process to execute No I/O device to service No user to whom to respond Then OS will sit quietly, waiting for something to happen This something is Interrupt At a particular time either a user program is running or operating system is running => Pseudo-Parallelism
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 CPU Cycle now is: CPU Cycle now is: Fetch Next Instruction Execute Instruction Check for Interrupt: Process Interrupt Start Halt Decode Instruction
Background image of page 4
5 Interrupt Handling Interrupt Handling Different routines handle different type of interrupts. Called Interrupt Service Routine (ISR) When the CPU is interrupted it stops what it is doing The address of the interrupted instruction is saved A generic routine is run This routine examines the nature of interrupt Calls the corresponding ISR The ISR’s are usually stored in the lower part of the memory After the interrupt is serviced, the saved address is loaded to the Program Counter The Interrupted computation can resume as though the interrupt had not occurred.
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Classes of Interrupts Classes of Interrupts Program division by zero execute illegal instruction reference outside user’s memory space Timer I/O Hardware failure A temporary problem: E.g., the subroutine is not in the memory
Background image of page 6
7 I/O Interrupts I/O Interrupts Generated when a program issues an input or output request
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.

Page1 / 26

Lec04&05-Interrupts - National University of Computer...

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