1.2.1 Operating System - Interrupts and Polling Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the two ways of the CPU knowing when a device needs its attention?

A

Interrupts and Polling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Polling?

A

Polling is when the CPU keeps checking each peripheral to see if it needs attention. This is often inefficient as the CPU is almost ‘wasting its time’ if none need attention.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Interrupts?

A

Interrupts is an alternative to polling, and is when a device sends a signal to the processor. Interrupts have priority indicating how urgently it requires attention.

When the interrupt is raised, the OS runs the relevant Interrupt Service Routine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When does the OS check to see if there any any interrupts?

A

At the end of every F-D-E cycle, the OS checks to see if there are any interrupts, halting the current task if there are any of higher priority.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 3 steps performed after the interrupt priority is checked against the priority of the current task and proven to be higher?

A
  1. The contents of the program counter and other registers are copied to an area of memory called a stack
  2. The relevant ISR (Interrupt Service Routine) can then be loaded by changing the PC value to the value of where the ISR starts
  3. When the ISR is complete, the previous values of the PC and registers are restored from memory to the CPU
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a stack overflow?

A

A stack overflow is when interrupts continually interrupt interrupts, and stack memory becomes full with the values of the registers from those interrupts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly