Ryerson Computer Science CPS590: Operating Systems

(go back)

Chapter 1: Computer Basics

Programs - fetch & execute instructions, one at a time

Interrupts types

Memory hierarchy:

Principle of Locality: memory nearby to memory currently being accessed as well as memory that was accessed recently will be transferred into processor cache.

Processor Types:

Chapter 2: OS Overview

Storage management responsibilities:

  • Process isolation
  • automatic isolation and management
  • support of modular programming
  • protection and access control
  • long-term storage

Causes of errors:

  • Deadlocks
  • Failed mutual exclusion

Multiprogramming: processes being switched in and out on a single processor

Batch Processing vs Time Sharing:

  • Batch processing designed for maximum CPU utilization
  • Time sharing designed for fast response time to user-terminalsc

Multiprocessing: multiple processors switching processes in and out which has the effect of multiple processes running simultaneously

  • ISA: OS's view of hardware
  • ABI: Process's view of hardware
  • API: Programmer's view of hardware (?)

Chapter 3: Processes


  1. Executable program (instructions)
  2. Associated data
  3. Execution context (process state)

States: Ready, Running, Blocked, Suspended

Memory tables, IO Tables, File Tables, Process Tables

Process Control Block --> Most important data structure in the OS

Chapter 4: Threads

User Level Threads:

created by the application process, the Kernal is not aware of them

+ Run on any OS

+ Application specific scheduling

+ Doesn't require kernal mode privileges

- Can't do true multi-processing

Kernal Level Threads:

+ Multiple threads on same or different processors

Chapter 5: Concurrency - Mutual Exclusion & Synchronization

Critical section: section of code that uses common resources and should not be executed in simultaneous processes

Race Condition: two processes are vying for the same resource, the last one to get there (the loser) updates it, overwriting the other proc's value.

3 control problems:

  1. The need for mutual exclusion
  2. Deadlock
  3. Starvation

Mutual Exclusion:

  • No deadlock or starvation
  • Proc remains in its critical section for finite time
  • If proc halts, must not interfere with other procs


  • disable hw interrupts -> guarantee's exclusion, but degrades performance (and doesn't work in multi-processor env)
  • Message Sending:
    • mailbox
    • port
    • pipe (named/unnamed)

Chapter 7: Memory Management

Organization techniques:

  • Partitioning
    • Fixed - suffers from internal fragmentation
    • Dynamic - suffers from external fragmentation
  • Paging
  • Segmentation

Chapter 8: Virtual Memory

Portion of Process in main memory is the Resident Set


  • Fetch
  • Placement
  • *Replacement
  • Resident Set Management
  • Cleaning
  • Load Control