Lecture Notes on CPU Exceptions and Interrupts

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/17

flashcard set

Earn XP

Description and Tags

Flashcards reviewing key concepts related to CPU exceptions, privilege levels, and interrupt handling.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

18 Terms

1
New cards

What is the purpose of an exception?

To model unexpected events during program execution.

2
New cards

What are the two main types of exceptions?

Synchronous and Asynchronous.

3
New cards

What causes a synchronous exception?

An instruction in the running program (e.g., arithmetic exceptions, invalid memory addresses).

4
New cards

What causes an asynchronous exception?

An I/O device requesting the processor (also known as a hardware interrupt).

5
New cards

Why do computers limit resource access to different processes?

To prevent buggy code from corrupting systems and to ensure security.

6
New cards

What is the purpose of a Supervisor Instruction (SVC)?

It provides a way for user code to request a service from the OS.

7
New cards

What does the CPU do upon receiving a Supervisor Instruction?

The CPU reads arguments from specific registers and executes the requested service.

8
New cards

What is the purpose of an exception vector table?

To determine where to jump to the exception handler when an exception/interrupt is raised.

9
New cards

Where is the exception vector table typically located?

In low memory.

10
New cards

List the steps in Exception Handling

  1. Store the cpsr into banked spsr. 2. Set execution mode and privilege level based on exception type. 3. Disable interrupts using the interrupt mask bits in cpsr. 4. Store the return address into banked lr 5. Pushes other registers onto stack 6. Branch to the exception function based on the address from the vector table 7. Execute exception handler 8. Copy lr → pc (movs pc, lr), banked spsr → cpsr 9. Pop the registers back off the stack
11
New cards

Name some ARM Execution Modes

User, IRQ, Supervisor, System

12
New cards

What is the Current Program Status Register (CPSR)?

An ARM register that records the state of the program.

13
New cards

What is a BusFault?

A memory access error in the bus interface.

14
New cards

What are the different registers in the System Control Unit related to fault handling?

SCR (Sleep modes), CCR (stack alignment and memory access behavior), CFSR (details of current HardFault), BFAR (bus address that caused error).

15
New cards

What registers are contained in the BusFault Status Register (BFSR)?

STKERR/UNSTKERR: Stack error, PRECISERR: Error Mem address is in BFAR, IBUSERR: Error reading instruction, BFARVALID: Records if this is a BusFault

16
New cards

What is Fast Interrupt Execution mode (FIQ)?

A fast, low-latency interrupt handling mechanism in high-end ARM that uses banked registers for faster interrupt handling.

17
New cards

Provide an example of a synchronous and asynchronous exception.

Synchronous: Arithmetic overflow. Asynchronous: Hardware interrupt from a peripheral device.

18
New cards

Why does an exception handler require escalated privileges?

To access system resources and manage the interrupt safely and effectively without compromising system integrity.