1.2.1e - interrupts Flashcards

1
Q

What is an interrupt?

A

A signal to the processor indicating an event needs attention.

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

What are hardware interrupts?

A

Signals from devices (e.g. keyboard press).

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

What are software interrupts?

A

Signals from programs (e.g. divide by zero error).

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

What happens when an interrupt is received?

A

CPU pauses current task and executes an Interrupt Service Routine (ISR).

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

What is the ISR?

A

Interrupt Service Routine – handles the interrupt.

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

What is the purpose of interrupts?

A

To allow immediate response to important events.

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

What is an interrupt vector?

A

A list of addresses to ISR functions.

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

What is context switching?

A

Saving current state to resume later.

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

What is the role of the stack in interrupts?

A

Stores register values during the ISR.

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

What happens after an ISR finishes?

A

The CPU resumes the previous task from the saved state.

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

Why are interrupts prioritised?

A

So urgent tasks are handled before less critical ones.

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

What is polling?

A

Repeatedly checking for events – less efficient than interrupts.

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

How do interrupts improve CPU efficiency?

A

Avoids wasting cycles checking for events.

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

What kind of events can trigger interrupts?

A

I/O operations, errors, timers.

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

What’s the difference between maskable and non-maskable interrupts?

A

Maskable can be ignored temporarily

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

What is a timer interrupt?

A

Signals the end of a time slice in scheduling.

17
Q

What’s a keyboard interrupt?

A

Triggered when a key is pressed or released.

18
Q

How does an OS use interrupts?

A

For multitasking, I/O handling, and time management.

19
Q

Can interrupts be nested?

A

Yes, higher-priority interrupts can interrupt lower ones.

20
Q

Why is interrupt handling important in real-time systems?

A

Ensures time-sensitive tasks are handled promptly.

21
Q

What is an interrupt flag?

A

Indicates that an interrupt has occurred.

22
Q

What is priority-based interrupt handling?

A

Highest priority interrupt is serviced first.

23
Q

What’s the danger of too many interrupts?

A

Can lead to missed or delayed processing (interrupt storm).

24
Q

What must happen before an ISR runs?

A

CPU state must be saved.

25
How does the CPU detect an interrupt?
By checking the interrupt register at each cycle.