0% found this document useful (0 votes)
2 views4 pages

Interrupts and Scheduling

The document discusses the concepts of polling and interrupts in CPU scheduling, explaining that polling involves the OS actively checking devices for attention, while interrupts allow devices to signal the CPU when they need attention. It details how interrupts are managed through an interrupt service routine (ISR) and the use of a system stack to handle the current state during an interrupt. Additionally, it outlines the types of interrupts, including hardware and software, and briefly touches on memory management concepts like paging and segmentation.

Uploaded by

doejohnny549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Interrupts and Scheduling

The document discusses the concepts of polling and interrupts in CPU scheduling, explaining that polling involves the OS actively checking devices for attention, while interrupts allow devices to signal the CPU when they need attention. It details how interrupts are managed through an interrupt service routine (ISR) and the use of a system stack to handle the current state during an interrupt. Additionally, it outlines the types of interrupts, including hardware and software, and briefly touches on memory management concepts like paging and segmentation.

Uploaded by

doejohnny549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Interrupts and scheduling

A CPU needs to know when a device needs its attention

Polling

Interrupts

Polling

Polling is when the OS asks a peripheral or service if its ok or if it needs


attention.

It is in fact used in computer systems, but mostly where the likelihood of


something needed attention is high

The monitoring system inside a nuclear reactor uses polling

It’s also commonly used on communication systems to check connectivity

And to see if more data needs to be processed

The Bluetooth system which connects your phone to your car so it knows when
it disconnects

Most devices however don’t use polling they use Interrupts

Interrupts
Stacks use a last in first out structure (LIFO)

Interrupts are when a device sends a signal to the CPU asking for attention

The OS has an interrupt service routing (ISR) which deals with this and with what happens
next

At the end of each FDE cycle the CPU checks if any interrupts have been signalled – if they
are of a higher priority than the job it’s doing it jumps to that interrupt.

-Interrupts,
The contents of the PC (and other registers) are pushed onto the system stack

The interrupt service routine (ISR) is started by pointing the PC to the ISR location

The interrupt is dealt with by the ISR

When finished, the register contents are taken from the stack (popped) and put back into
registers, including the original value of the PC

Execution continues from the point where the interrupt occurred.

The Interrupt services

A list of interrupt services and their memory locations are stored on a


dedicated space on the RAM.

These services may be part of the OS or software/hardware specific

This is known as the Interrupt Service Table

Part of the Ram always stores the ISR table

The interrupt service routine


An interrupt is called upon

If the interrupt is of equal or lower priority than the current process then the process is
completed

If the interrupt is of higher importance than the current process then the CPU completes its
current FDE cycle.

Then the contents of the PC (and other registers) are pushed into the system stack

The interrupt service routine is started by pointing the PC to the ISR location

While one interrupt is being dealt with, another more important one can occur

Then the current register values are placed onto stack – That’s the current state if the first
interrupt

The address if The new ISR is loaded into the PC AND EXECUTION CONTINUES FROM
THERE(this can carry on)

Types of interrupts

Hardware
-Power button

- Memory error

- Memory refresh

Software:

Illegal instruction

Stack over flow

Explain whether the following image represents paging or segmentation. Use the phrases within
your answer.

Paging- Memory is split into physical divisions, not logical like in segmentation. Also there is no
consideration of logic of the program when creating divisions which again shows it is paging and
the divisions or pages are the same size, again showing its paging

Explain whether the following image represents paging or segmentation. Use the phrases within
your answer.

Segmentation
1. It represents

You might also like