Process: A running program identified by a PID

Process Control Block (PCB): Where OS store data about each processes

Starting Process:

  1. Create new process PCB + address space
  2. Load executable (“ready”)
  3. Dispatch process (”running”)

Process Lifecycle

State Queues: Queue of processes in different states

Context Switch: Switch cpu core from one running process to another ready process

  1. Set to kernel mode
  2. Save registers & PC (A) to kernel stack
  3. Jump to trap handler
  4. Restore registers & PC (B) from kernel stack
  5. Set to user mode

Context Switch Causes

Creation & Termination

Parent Process: Every process is created by a parent (up to PID1 - init)

Process Destruction: exit() releases all resources