0% found this document useful (0 votes)
6 views

Interrupts

The document provides an overview of interrupts, defining them as signals that request immediate attention from the CPU, and outlines their purpose in multitasking and resource management. It distinguishes between hardware interrupts, which come from external devices, and software interrupts, which are triggered by running programs, and describes the process of handling interrupts using the stack. Additionally, it includes an assignment to tabulate differences between hardware and software interrupts.

Uploaded by

shalomfadile944
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Interrupts

The document provides an overview of interrupts, defining them as signals that request immediate attention from the CPU, and outlines their purpose in multitasking and resource management. It distinguishes between hardware interrupts, which come from external devices, and software interrupts, which are triggered by running programs, and describes the process of handling interrupts using the stack. Additionally, it includes an assignment to tabulate differences between hardware and software interrupts.

Uploaded by

shalomfadile944
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SSS 1 COMPUTER STUDIES

INTERRUPTS

Learning Objectives:

1. Define interrupts and list examples of hardware and software interrupts.


2. Explain the purpose of interrupts.
3. Illustrate the process of how interrupts are handled, including the use of the stack.
4. Differentiate between hardware and software interrupts, emphasizing their functions and
priorities.

Definition of Interrupts

An interrupt is a signal sent from a device or software to the processor to request immediate attention.
It temporarily stops the execution of the current process, allowing the CPU to address a task of higher
priority before resuming the previous operations.

Purpose of Interrupts

Interrupts help in efficient multitasking and resource management by allowing the CPU to:

• Attend to certain tasks/issues


• Respond to critical events immediately.
• Improve processing efficiency by handling tasks asynchronously.
• Allow multiple programs and devices to work together without waiting for one task to complete
before another begins [multitasking].

TYPES OF INTERRUPTS

1. Hardware Interrupts: This is an electronic signal from an external hardware device that indicates it
needs attention from the operating system. Hardware interrupts can be Maskable (ignorable) or
non-maskable (important, not to be ignored).

Examples of hardware interrupt

▪ Power button may have been pressed


▪ Moving the mouse
▪ A disk drive is ready to receive more data
▪ Clicking an icon to open a new program
▪ ‘Out of paper’ message for a printer
▪ An error has occurred, such as a paper jam in a printer
▪ A user has pressed a key to interrupt the current process (<ctrl><alt><del>)
2. Software Interrupts: Triggered by a running program that terminates or requests for services
from the operating system.

Examples of software interrupt

▪ A program not responding


▪ Division by zero

MRS ADOGIE - POWERFIELDS GROUP OF SCHOOLS [COLLEGE], EGBIN


SSS 1 COMPUTER STUDIES

▪ Two processes trying to access the same memory location


▪ Invalid memory access
▪ A request for I/O operations
▪ A software error has occurred (an .exe file couldn't be found to initiate the execution of a
program).

Process of Handling Interrupts (Including Stack Usage)

When an interrupt is triggered, the following steps occur:

1. Interrupts are added to an area called the Interrupt Service Routine [ISR] which holds
instructions that will need to be fetched, decoded and executed to complete the commands of
the interrupt
2. Saving the Current State: The CPU pauses execution and saves the current instruction pointer
and register values onto the stack. The use of the stack ensures that the CPU can return to the
exact state it was in before handling the interrupt, maintaining system stability.
3. Identifying the Interrupt: The CPU checks the interrupt vector table to find the corresponding
ISR.
4. Executing the ISR: The ISR runs the appropriate response for the interrupt.
5. Restoring the State: Once the ISR completes, the saved values are retrieved from the stack.
6. Resuming Normal Execution: The CPU resumes the previously interrupted task.

ASSIGNMENT

Tabulate 5 differences between hardware and software interrupts (To be done in your notebooks)

MRS ADOGIE - POWERFIELDS GROUP OF SCHOOLS [COLLEGE], EGBIN

You might also like