notes5 - 1) Interrupts a) An interrupt is an even that...

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

View Full Document Right Arrow Icon
1) Interrupts a) An interrupt is an even that requires immediate attention from the CPU. b) When an interrupt is received, the CPU will stop whatever it is doing and it will jump to the “interrupt handler” that handles that specific interrupt. After executing the handler, it will return to the same place where the interrupt happened, and the program continues. i) Interrupts can be from almost anything, such as a keystroke, mouse motion, request for a swapped memory address, or network activity. c) Steps of an interrupt: i) Save registers and return address so normal operation can be resumed. ii) The CPU looks up the corresponding interrupt handler in the interrupt vector and jumps to it. iii) Once the interrupt handler is completed, it will restore the prior functions registers and returns to the operation where it was interrupted. iv) In some cases such as virtual memory, the operation that was interrupted is retried. v) The program continues as if nothing happened. (1) Interrupts are transparent to program execution. d) Interrupts run in kernel mode. i) This is because the interrupt handler may need to access the registers in the CPU or in the devices that are only available in kernel mode. ii) For security reasons, the interrupt vector can only be modified in kernel mode. iii) The interrupt vector is initialized at boot time and may be modified when new drivers are added to the system. e) How interrupts work i) The CPU has an interrupt terminal. When it gets a 1, the CPU knows an interrupt has occurred. The interrupt terminal is connected to all I/O devices and to the memory management unit. f) What can cause an interrupt? i) Devices can cause interrupts (1) Keyboard (2) Mouse (3) Network (4) Disk I/O ii) The Memory Management Unit (1) The MMU translates virtual addresses in the CPU to physical addresses in RAM. (2) Invalid address (3) Access to a valid address, but page not present in memory (a) Swapped memory
Background image of page 1

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

View Full DocumentRight Arrow Icon
(4) Not enough permission for operation (a) Write operation in read only memory (i) Causes a SEGV (5) Math unit of the CPU (a) Division by zero (6) Software interrupts (a) The CPU has an operation in assembly that causes an interrupt. (i)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 354 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 7

notes5 - 1) Interrupts a) An interrupt is an even that...

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

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