SlideShare a Scribd company logo
1 of 18
Saleem
Mahar
 What Are Interrupts?
 Why Interrupts?
 Instruction Cycle And Interrupts
 Difference b/w Interrupts and Exceptions
 Classes Of Interrupts
 How They Are Handled?
 I/O Communication Techniques
2
3
 A Suspension of a process such as the execution
of a computer program, caused by an event
external to that process, and performed in such a
way that the current process can be resumed.
 A way to improve processor utilization.
4
 The OS is a reactive program
 When you give some input
 It will perform computations
 Produces output BUT
 Meanwhile you can interact with the system by
interrupting the running process or
 You can stop and start another process.
 This reactive ness is due to interrupts
 Modern Operating Systems Are Interrupt driven
 Without Interrupts
 Two steps ( cycles)
 Instruction Fetch
 Instruction Execute
5
 State Diagram
( Without Interrupts)
6
(Continued)
 With Interrupts
 Three steps ( cycles)


 Instruction Fetch
Instruction Execute
Check Interrupt
7
 State Diagram ( With
Interrupts)
8
9
 Two main types of events: interrupts and
exceptions
 Exceptions are caused by software executing
instructions

 e.g., a page fault, or an attempted write to a read-
only page
an expected exception is a “trap”, unexpected is a
“fault”
 Interrupts are caused by hardware devices
 e.g., device finishes I/O
10
 Program
 Generated by some condition that occurs as a result of an
instruction execution, such as arithmetic overflow,
division by zero, attempt to execute an illegal machine
instruction etc.
 Timer
 Generated by a timer within the processor. This allows the
operating system to perform certain functions on a regular
basis.
 I/O
 Generated by an I/O controller, to signal normal completion
of an operation or to signal a variety of error conditions.
 Hardware failure
 Generated by a failure, such as power failure or memory parity error.
11
 Different routines handle different interrupts –
called Interrupt Service Routines (ISR).
 When CPU is interrupted
 It stops what it was doing, and context is saved.
 A generic routine called Interrupt Handling
Routine (IHR) is run which
 Examines the nature of interrupt
 Calls the corresponding Interrupt Service Routine
(ISR) -- stored in lower part of memory.
 After servicing the interrupt, the saved address
is loaded again to PC to resume the process
again.
12
ts By: Irfanullah University Of Peshawar, 13
(Continued)
 Interrupt
Processing
14
 Three techniques are possible for I/O operations
 Programmed I/O
 Interrupt-driven I/O
 Direct memory access (DMA)
15





CPU while executing a
program encounters an I/O
instruction
CPU issues I/O command to I/
O module
I/O module performs the
requested action & set status
registers
CPU is responsible to check
status registers periodically to
see if I/O operation is
complete. SO
No Interrupt to alert the
processor
16
 Similar to direct I/O but
processor not required
to poll device.
 I/O module will interrupt
CPU for data exchange
when ready
 Requires DMA module on system bus
 Capable of mimicking CPU and taking over
control of system from CPU
 DMA will use bus when
17
 I/O exchanges occur directly with
memory



 Processor does not require it
OR
Must force processor to
suspend operation
temporarily– called cycle
stealing


An interrupt is sent when the task
is complete
The processor is only involved at
the beginning and end of the
transfer
Interrupts

More Related Content

What's hot

System component and system calls unit 1 by ram k paliwal
System component and system calls unit 1 by ram k paliwalSystem component and system calls unit 1 by ram k paliwal
System component and system calls unit 1 by ram k paliwalRam Paliwal
 
Interrupt in real time system
Interrupt in real time system Interrupt in real time system
Interrupt in real time system ali jawad
 
Input/Output System (Part 2)
Input/Output System (Part 2) Input/Output System (Part 2)
Input/Output System (Part 2) Ajeng Savitri
 
A451 introduction to cpu (2-12)
A451   introduction to cpu (2-12)A451   introduction to cpu (2-12)
A451 introduction to cpu (2-12)wardjo
 
Fault tolerance techniques for real time operating system
Fault tolerance techniques for real time operating systemFault tolerance techniques for real time operating system
Fault tolerance techniques for real time operating systemanujos25
 
Chapter 8 system soft ware
Chapter 8 system soft wareChapter 8 system soft ware
Chapter 8 system soft wareMrSaem
 
Operating System and related questions
Operating System and related questionsOperating System and related questions
Operating System and related questionsimdurgesh
 
Operating system 03 handling of interrupts
Operating system 03 handling of interruptsOperating system 03 handling of interrupts
Operating system 03 handling of interruptsVaibhav Khanna
 
Fault tolerant real-time scheduling
Fault tolerant real-time schedulingFault tolerant real-time scheduling
Fault tolerant real-time schedulingReza Ramezani
 
Major Function of i/o module
Major Function of i/o moduleMajor Function of i/o module
Major Function of i/o moduleDelowar Hossain
 
IO Techniques in Computer Organization
IO Techniques in Computer OrganizationIO Techniques in Computer Organization
IO Techniques in Computer OrganizationOm Prakash
 

What's hot (20)

System component and system calls unit 1 by ram k paliwal
System component and system calls unit 1 by ram k paliwalSystem component and system calls unit 1 by ram k paliwal
System component and system calls unit 1 by ram k paliwal
 
Coa INTERUPT
Coa INTERUPTCoa INTERUPT
Coa INTERUPT
 
Interrupt in real time system
Interrupt in real time system Interrupt in real time system
Interrupt in real time system
 
Control Unit (CU)
Control Unit (CU)Control Unit (CU)
Control Unit (CU)
 
Input/Output System (Part 2)
Input/Output System (Part 2) Input/Output System (Part 2)
Input/Output System (Part 2)
 
Interrupt
InterruptInterrupt
Interrupt
 
Interrupts and types of interrupts
Interrupts and types of interruptsInterrupts and types of interrupts
Interrupts and types of interrupts
 
A451 introduction to cpu (2-12)
A451   introduction to cpu (2-12)A451   introduction to cpu (2-12)
A451 introduction to cpu (2-12)
 
Fault tolerance techniques for real time operating system
Fault tolerance techniques for real time operating systemFault tolerance techniques for real time operating system
Fault tolerance techniques for real time operating system
 
Interrupts
InterruptsInterrupts
Interrupts
 
Chapter 8 system soft ware
Chapter 8 system soft wareChapter 8 system soft ware
Chapter 8 system soft ware
 
Ch2
Ch2Ch2
Ch2
 
Operating System and related questions
Operating System and related questionsOperating System and related questions
Operating System and related questions
 
Operating system 03 handling of interrupts
Operating system 03 handling of interruptsOperating system 03 handling of interrupts
Operating system 03 handling of interrupts
 
Fault tolerant real-time scheduling
Fault tolerant real-time schedulingFault tolerant real-time scheduling
Fault tolerant real-time scheduling
 
Major Function of i/o module
Major Function of i/o moduleMajor Function of i/o module
Major Function of i/o module
 
MD JAHID HASAN
MD JAHID HASANMD JAHID HASAN
MD JAHID HASAN
 
Ch 01 os8e
Ch 01  os8eCh 01  os8e
Ch 01 os8e
 
IO Techniques in Computer Organization
IO Techniques in Computer OrganizationIO Techniques in Computer Organization
IO Techniques in Computer Organization
 
OS_Ch2
OS_Ch2OS_Ch2
OS_Ch2
 

Similar to Interrupts

Operatingsystems lecture2
Operatingsystems lecture2Operatingsystems lecture2
Operatingsystems lecture2Gaurav Meena
 
Lecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfLecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfTaufeeq8
 
interruptpresentaion-151207165807-lva1-app6892.pptx
interruptpresentaion-151207165807-lva1-app6892.pptxinterruptpresentaion-151207165807-lva1-app6892.pptx
interruptpresentaion-151207165807-lva1-app6892.pptxAmulyagt1
 
advanced Operating system
advanced Operating systemadvanced Operating system
advanced Operating systemLakshmiakshiva
 
Exception handling in Pipelining in COA
Exception handling in Pipelining in COAException handling in Pipelining in COA
Exception handling in Pipelining in COARishavChandel1
 
Os files 2
Os files 2Os files 2
Os files 2Amit Pal
 
Computer architecture presentation
Computer architecture presentationComputer architecture presentation
Computer architecture presentationMuhammad Hamza
 
Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Ajeng Savitri
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsJyoReddy9
 
Operating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to studyOperating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to studymuhammadalam77863
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxLeahRachael
 
introduction to computer system
introduction to computer systemintroduction to computer system
introduction to computer systemumardanjumamaiwada
 
CMP 416-Architecture and system design.pdf
CMP 416-Architecture and system design.pdfCMP 416-Architecture and system design.pdf
CMP 416-Architecture and system design.pdfElvisAngelot
 

Similar to Interrupts (20)

Interrupts
InterruptsInterrupts
Interrupts
 
Interrupts
InterruptsInterrupts
Interrupts
 
Operatingsystems lecture2
Operatingsystems lecture2Operatingsystems lecture2
Operatingsystems lecture2
 
Lecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfLecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdf
 
interruptpresentaion-151207165807-lva1-app6892.pptx
interruptpresentaion-151207165807-lva1-app6892.pptxinterruptpresentaion-151207165807-lva1-app6892.pptx
interruptpresentaion-151207165807-lva1-app6892.pptx
 
Chapter01 new
Chapter01 newChapter01 new
Chapter01 new
 
Chapter01 new
Chapter01 newChapter01 new
Chapter01 new
 
advanced Operating system
advanced Operating systemadvanced Operating system
advanced Operating system
 
Exception handling in Pipelining in COA
Exception handling in Pipelining in COAException handling in Pipelining in COA
Exception handling in Pipelining in COA
 
Os files 2
Os files 2Os files 2
Os files 2
 
Computer architecture presentation
Computer architecture presentationComputer architecture presentation
Computer architecture presentation
 
Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2
 
Io pro
Io proIo pro
Io pro
 
IO_ORGANIZATION.pdf
IO_ORGANIZATION.pdfIO_ORGANIZATION.pdf
IO_ORGANIZATION.pdf
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
 
Operating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to studyOperating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to study
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
 
introduction to computer system
introduction to computer systemintroduction to computer system
introduction to computer system
 
CMP 416-Architecture and system design.pdf
CMP 416-Architecture and system design.pdfCMP 416-Architecture and system design.pdf
CMP 416-Architecture and system design.pdf
 
Interrupts
Interrupts Interrupts
Interrupts
 

Recently uploaded

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Interrupts

  • 2.  What Are Interrupts?  Why Interrupts?  Instruction Cycle And Interrupts  Difference b/w Interrupts and Exceptions  Classes Of Interrupts  How They Are Handled?  I/O Communication Techniques 2
  • 3. 3  A Suspension of a process such as the execution of a computer program, caused by an event external to that process, and performed in such a way that the current process can be resumed.  A way to improve processor utilization.
  • 4. 4  The OS is a reactive program  When you give some input  It will perform computations  Produces output BUT  Meanwhile you can interact with the system by interrupting the running process or  You can stop and start another process.  This reactive ness is due to interrupts  Modern Operating Systems Are Interrupt driven
  • 5.  Without Interrupts  Two steps ( cycles)  Instruction Fetch  Instruction Execute 5
  • 6.  State Diagram ( Without Interrupts) 6
  • 7. (Continued)  With Interrupts  Three steps ( cycles)    Instruction Fetch Instruction Execute Check Interrupt 7
  • 8.  State Diagram ( With Interrupts) 8
  • 9. 9  Two main types of events: interrupts and exceptions  Exceptions are caused by software executing instructions   e.g., a page fault, or an attempted write to a read- only page an expected exception is a “trap”, unexpected is a “fault”  Interrupts are caused by hardware devices  e.g., device finishes I/O
  • 10. 10  Program  Generated by some condition that occurs as a result of an instruction execution, such as arithmetic overflow, division by zero, attempt to execute an illegal machine instruction etc.  Timer  Generated by a timer within the processor. This allows the operating system to perform certain functions on a regular basis.  I/O  Generated by an I/O controller, to signal normal completion of an operation or to signal a variety of error conditions.  Hardware failure  Generated by a failure, such as power failure or memory parity error.
  • 11. 11  Different routines handle different interrupts – called Interrupt Service Routines (ISR).  When CPU is interrupted  It stops what it was doing, and context is saved.  A generic routine called Interrupt Handling Routine (IHR) is run which  Examines the nature of interrupt  Calls the corresponding Interrupt Service Routine (ISR) -- stored in lower part of memory.  After servicing the interrupt, the saved address is loaded again to PC to resume the process again.
  • 12. 12
  • 13. ts By: Irfanullah University Of Peshawar, 13 (Continued)  Interrupt Processing
  • 14. 14  Three techniques are possible for I/O operations  Programmed I/O  Interrupt-driven I/O  Direct memory access (DMA)
  • 15. 15      CPU while executing a program encounters an I/O instruction CPU issues I/O command to I/ O module I/O module performs the requested action & set status registers CPU is responsible to check status registers periodically to see if I/O operation is complete. SO No Interrupt to alert the processor
  • 16. 16  Similar to direct I/O but processor not required to poll device.  I/O module will interrupt CPU for data exchange when ready
  • 17.  Requires DMA module on system bus  Capable of mimicking CPU and taking over control of system from CPU  DMA will use bus when 17  I/O exchanges occur directly with memory     Processor does not require it OR Must force processor to suspend operation temporarily– called cycle stealing   An interrupt is sent when the task is complete The processor is only involved at the beginning and end of the transfer