9
Interrupts Signal that causes the CPU to alter its normal flow on instruction execution frees CPU from waiting for events provides control for external input Examples unexpected input abnormal situation illegal instructions multitasking, multiprocessing http://sites.google.com/site/ computing9691/ Slide 1

Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Embed Size (px)

Citation preview

Page 1: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

InterruptsSignal that causes the CPU to alter its

normal flow on instruction execution◦ frees CPU from waiting for events◦ provides control for external input

Examples◦ unexpected input◦ abnormal situation◦ illegal instructions◦ multitasking, multiprocessing

http://sites.google.com/site/computing9691/

Slide 1

Page 2: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Interrupt TerminologyIn understanding the concept of

interrupts, there are a few commonly used terms:-◦ Interrupt lines (hardware)◦ Interrupt request◦ Interrupt handlers

Program that services the interrupt Also known as an interrupt routine

◦ Process Control Block (PCB) Located in a part of memory known as the stack

area All registers of a program are saved here before

control is transferred to the interrupt handler

http://sites.google.com/site/computing9691/

Slide 2

Page 3: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Servicing an InterruptWhen an interrupt occurs, it must

be serviced.Servicing the interrupt involves:-

◦suspending the program in progress.◦save pertinent information including

last instruction executed and data values in registers in the PCB (process control block).

◦branch to the interrupt handler.

http://sites.google.com/site/computing9691/

Slide 3

Page 4: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Servicing an Interrupt

http://sites.google.com/site/computing9691/

Slide 4

Page 5: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Use of InterruptsInterrupts are such powerful

mechanisms that they are used widely, such as:-◦ Notifying that an external event has

occurred real-time or time-sensitive

◦ Signalling completion printer ready or buffer full

◦ Allocating CPU time time sharing

◦ Indicating abnormal event (CPU originates for notification and recovery) illegal operation, hardware error

◦ Software interruptshttp://sites.google.com/site/computing9691/

Slide 5

Page 6: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Multiple InterruptsIdentifying devices

◦Polling (checking for input in rotation)

◦Vectored interrupts (include address of interrupting device)

Interrupt priorities◦Loss of data vs. task completion

Maskable (disabled) interrupts

http://sites.google.com/site/computing9691/

Slide 6

Page 7: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Vectored Interrupts

http://sites.google.com/site/computing9691/

Slide 7

Page 8: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Polled Interrupts

http://sites.google.com/site/computing9691/

Slide 8

Page 9: Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external

Multiple Interrupts Example

http://sites.google.com/site/computing9691/

Slide 9