The Big Picture: Four Ideas to Keep

Four ideas come back again and again in this course: abstraction, layering, concurrency, and interrupts. Learn them now and the rest gets easier.

6.1 Abstraction

What it means: Each layer hides the complexity of the layer below.

Think of driving a car. You press the pedal. You do not need to know how fuel burns in the engine. The pedal hides that detail.

Application Layer: "I want to save a file"
                    ↓
Windows API:      "Create a file on disk"
                    ↓
File System:      "Find free space, create inode, allocate blocks"
                    ↓
Storage Driver:   "Send commands to disk controller"
                    ↓
Disk Controller:  "Move read/write head, write data magnetically"
                    ↓
Hardware:         "Electrons flow through circuits"

A file system is the system that keeps track of where every file is stored. An inode and blocks are its record and storage pieces for a file; you will meet them later.

You don't need to understand the electrons to save a file. Abstraction handles that.

6.2 Layering

What it means: Lower layers provide services to higher layers.

Applications
     ↑ needs services
     ↓ calls
Operating System
     ↑ needs services
     ↓ calls
Firmware
     ↑ needs services
     ↓ calls
Hardware

A layer can only request services from the layer immediately below it (mostly). Like a restaurant: the customer talks to the waiter, not the cook.

6.3 Concurrency

What it means: Multiple things happening simultaneously.

Think of a kitchen where one cook chops, one boils, and one bakes, all at the same time.

Simultaneous activities on your computer:

  • CPU executing instructions
  • GPU rendering graphics
  • Disk controller reading/writing
  • Network adapter sending/receiving packets
  • Audio controller playing sound

They coordinate via:

MethodPlain meaning
InterruptsHardware signals "I finished, do something"
Shared memoryThey read/write shared data structures (a common notice board)
DriversManage the coordination

6.4 Interrupts

What they are: Signals that pause the CPU to handle events. It is a tap on the shoulder: "Excuse me, I need you now."

CPU executing     Hard disk finishes      CPU stops and
instruction X     reading data      →     handles interrupt
                                    →     comes back to X

Types of interrupts:

TypeWhat it isExample
Hardware interruptExternal device signalsDisk ready, network packet arrived
Software interrupt (system call)Application asks the OS to do somethingA program asks to open a file
Exception/FaultError conditionDivide by zero, page fault

We'll cover this in detail in Chapter 2.

Summary

ConceptPlain meaning
AbstractionEach layer hides the details below it
LayeringEach layer uses only the layer just below
ConcurrencyMany parts work at the same time
InterruptA signal that pauses the CPU to deal with something