Operating Systems

Table of Contents

Interrupt Handling & Scheduling

interrupt handling:

The scheduler gets control every time an interrupt occurs. It acts as a mediator.

What happens?

  1. Hardware puts program counter etc. on the stack
  2. Hardware loads new program counter from interrupt vector
  3. Assembly language procedure saves registers
  4. Assembly language procedure sets up new stack
  5. C interrupt service runs (e.g. reads and buffers input)
  6. Scheduler decides which process is to run next.
  7. C procedure returns to assembly code.
  8. Assembly language procedure starts up new current process

A process can’t give the CPU to another process (i.e. do a context switch) without going through the scheduler.