
- Operating System Tutorial
- OS - Home
- OS - Overview
- OS - Components
- OS - Types
- OS - Services
- OS - Properties
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling algorithms
- OS - Multi-threading
- OS - Memory Management
- OS - Virtual Memory
- OS - I/O Hardware
- OS - I/O Software
- OS - File System
- OS - Security
- OS - Linux
- OS - Exams Questions with Answers
- OS - Exams Questions with Answers
- Operating System Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
What are the interrupt stages and processing?
Instruction cycle consists of fetch, execute and interrupt stage show in below diagram −
If any interrupt occurs, it is indicated by an interrupt flag. The CPU will go to interrupt handler routine. Interrupt handler then checks the type of interrupt and executes the appropriate function. It involves overhead but still better than the CPU waiting for I/O completion or other activities.
Interrupt handler activates most prior able activity first and later deferrable part will be handled.
Example
Block of data arrives on the network line.
Kernel marks the presence of data (urgent part) and gives the CPU back to the process that was running before.
Rest of processing can be done later (moving data to buffer where recipient will find it)
Interrupt vector
Table of pointers in memory contains the addresses of interrupt service routines at a fixed location for a given CPU.
Interrupt processing
Step 1 − First device issues interrupt to CPU.
Step 2 − Then, the CPU finishes execution of current instruction.
Step 3 − CPU tests for pending interrupt request. If there is one, it sends an acknowledgment to the device which removes its interrupt signal.
Step 4 − CPU saves program status word onto control stack.
Step 5 − CPU loads the location of the interrupt handler into the PC register.
Step 6 − Save the contents of all registers from the control stack into memory.
Step 7 − Find out the cause of interrupt, or interrupt type or invokes appropriate routine.
Step 8 − Restore saved registers from the stack.
Step 9 − Restore PC to dispatch the original process.
- Related Articles
- What are the architecture of Parallel Processing?
- What are the Key Stages in Supply Chain?
- How interrupt is handled by OS and what are the services for user and system?
- What are the steps involved in RNA Processing?
- What are the Stages in a Performance Management Cycle?
- What Are the Four Stages of COPD and the Gold System for Grading?
- What Are Different Stages in A Bioprocess
- What are the stages in operating a petty cash fund and its advantages?
- What are the Stages of Evaluation in Credit Analysis Process?
- What are interrupts and how interrupt handling is done in modern operating systems?
- What is the difference between context switching and interrupt handling?
- What are the steps of SQL Query processing in DBMS?
- What is Interrupt I/O Process?
- Difference between Interrupt and Exception
- Difference between Batch Processing and Stream Processing
