Presentation topic:
Interrupts
Presented by:
Tanzeela Sheikh
BSE-3A
Interrupt
• When a Process is executed by the CPU and when
a user Request for another Process then this will
create disturbance for the Running Process. This is
also called as the Interrupt.
• Mechanism by which other modules (e.g. I/O)
may interrupt normal sequence of processing
Interrupt Cycle
• Added to instruction cycle
• Processor checks for interrupt
-Indicated by an interrupt signal
• If no interrupt, fetch next instruction
• If interrupt pending:
- Suspend execution of current program
- Save context
- Set PC to start address of interrupt handler
routine
- Process interrupt
- Restore context and continue interrupted
program
Interrupt Cycle
Types of Interrupts:
Generally there are three types o Interrupts
those are Occurred For Example
1) Internal Interrupt
2) Software Interrupt.
3) External Interrupt.
Types of Interrupts
Software InterruptExternal InterruptInternal Interrupt
Internal Interrupts
The Internal Interrupts are those which are occurred due to Some Problem in
the Execution For Example When a user performing any Operation which
contains any Error and which contains any type of Error. So that Internal
Interrupts are those which are occurred by the Some Operations or by Some
Instructions and the Operations those are not Possible but a user is trying for
that Operation.
External Interrupts
The External Interrupt occurs when any Input and Output Device request for
any Operation and the CPU will Execute that instructions first For Example
When a Program is executed and when we move the Mouse on the Screen
then the CPU will handle this External interrupt first and after that he will
resume with his Operation.
Software Interrupts
The Software Interrupts are those which are made some call to the System for Example
while we are Processing Some Instructions and when we wants to Execute one more
Application Programs.
There are different types of
interrupt:
Multiple interrupts :
• Disable interrupts
Processor will ignore further interrupts whilst processing
one interrupt
Interrupts remain pending and are checked after first
interrupt has been processed
Interrupts handled in sequence as they occur
• Define priorities
Low priority interrupts can be interrupted by higher
priority interrupts
When higher priority interrupt has been processed,
processor returns to previous interrupt
Multiple Interrupts (sequential)
Multiple Interrupts ( Nested)
• An interrupt can stop the CPU from what it
is doing and instead start it doing
something else.
What would happen if a lot of interrupts
happened at the same time? How does the
CPU know which one to deal with first?
• The CPU knows which interrupt to handle
first because there are a hierarchy of
interrupts. This is because some interrupts
are more important than others.
First Priority:
• Hardware commands
Second Priority:
• Program/Software
Third Priority
• Timer
Fourth Priority
• Input/output devices
Hardware Commands:
Reset Button pressed
Power Supply failure
Power-down command (screen off, hibernate etc)
These send a physical signal to the CPU via the interrupt chip.
Program/Software
Software is also allowed to issue interrupts to the CPU. For example software has detected
that an error has occurred and will issue a software interrupt for the CPU to run some
instructions to try to clear the error.
Input/output devices
Devices such as the keyboard and mouse demand attention. Otherwise, your mouse
and keyboard inputs would never get a look-in! Other Input - Output devices include
Hard Disk
Optical Disk
Printer
Graphics tablet
Timer:
Some programs trigger a 'timer interrupt' for example a
data-logging application that *has* to read an input sensor every 1 second.
Or perhaps a screen recording application that has to read the next screen update.
So as you see, there are levels of interrupts that are more
important than others. This is called the 'interrupt
priority'
But they all do the same thing if they are allowed to do so
- they suspend the CPU operation and tell it to start
executing the relevant interrupt service routine.
Interrupt presentaion

Interrupt presentaion

  • 1.
  • 2.
    Interrupt • When aProcess is executed by the CPU and when a user Request for another Process then this will create disturbance for the Running Process. This is also called as the Interrupt. • Mechanism by which other modules (e.g. I/O) may interrupt normal sequence of processing
  • 3.
    Interrupt Cycle • Addedto instruction cycle • Processor checks for interrupt -Indicated by an interrupt signal • If no interrupt, fetch next instruction • If interrupt pending: - Suspend execution of current program - Save context - Set PC to start address of interrupt handler routine - Process interrupt - Restore context and continue interrupted program
  • 4.
  • 5.
    Types of Interrupts: Generallythere are three types o Interrupts those are Occurred For Example 1) Internal Interrupt 2) Software Interrupt. 3) External Interrupt. Types of Interrupts Software InterruptExternal InterruptInternal Interrupt
  • 6.
    Internal Interrupts The InternalInterrupts are those which are occurred due to Some Problem in the Execution For Example When a user performing any Operation which contains any Error and which contains any type of Error. So that Internal Interrupts are those which are occurred by the Some Operations or by Some Instructions and the Operations those are not Possible but a user is trying for that Operation.
  • 7.
    External Interrupts The ExternalInterrupt occurs when any Input and Output Device request for any Operation and the CPU will Execute that instructions first For Example When a Program is executed and when we move the Mouse on the Screen then the CPU will handle this External interrupt first and after that he will resume with his Operation.
  • 8.
    Software Interrupts The SoftwareInterrupts are those which are made some call to the System for Example while we are Processing Some Instructions and when we wants to Execute one more Application Programs.
  • 9.
    There are differenttypes of interrupt: Multiple interrupts : • Disable interrupts Processor will ignore further interrupts whilst processing one interrupt Interrupts remain pending and are checked after first interrupt has been processed Interrupts handled in sequence as they occur • Define priorities Low priority interrupts can be interrupted by higher priority interrupts When higher priority interrupt has been processed, processor returns to previous interrupt
  • 10.
  • 11.
  • 12.
    • An interruptcan stop the CPU from what it is doing and instead start it doing something else. What would happen if a lot of interrupts happened at the same time? How does the CPU know which one to deal with first? • The CPU knows which interrupt to handle first because there are a hierarchy of interrupts. This is because some interrupts are more important than others.
  • 13.
    First Priority: • Hardwarecommands Second Priority: • Program/Software Third Priority • Timer Fourth Priority • Input/output devices
  • 14.
    Hardware Commands: Reset Buttonpressed Power Supply failure Power-down command (screen off, hibernate etc) These send a physical signal to the CPU via the interrupt chip. Program/Software Software is also allowed to issue interrupts to the CPU. For example software has detected that an error has occurred and will issue a software interrupt for the CPU to run some instructions to try to clear the error.
  • 15.
    Input/output devices Devices suchas the keyboard and mouse demand attention. Otherwise, your mouse and keyboard inputs would never get a look-in! Other Input - Output devices include Hard Disk Optical Disk Printer Graphics tablet Timer: Some programs trigger a 'timer interrupt' for example a data-logging application that *has* to read an input sensor every 1 second. Or perhaps a screen recording application that has to read the next screen update.
  • 16.
    So as yousee, there are levels of interrupts that are more important than others. This is called the 'interrupt priority' But they all do the same thing if they are allowed to do so - they suspend the CPU operation and tell it to start executing the relevant interrupt service routine.