Table of Contents
Computer Architecture Overview
What is an OS?
Two popular definitions for OS
What does hardware provide?
The x86 Platform
Typical PC Architecture
Computer Organization
Computer Organization: Abstract Model
The Stored Program Computer
Memory Access
The Stack
I/O Access
Interrupts
Direct Memory Access
Symmetric Multiprocessors (SMP)
Computer Architecture Overview
What is an OS?
“A program that acts as an intermediary between a user of a computer and the computer hardware.”
Two popular definitions for OS
Bottom-up perspective:
resource manager/coordinator
, manage your computer’s resources
Top-down perspective:
hardware abstraction layer
, turn hardware into something that applications can use
What does hardware provide?
Seen a glimpse of the functions
OS
provides
But what hardware does it have to work with to provide those functions?
Let's take a high level overview of how a typical computer system looks inside
Different platforms have different chips: phone, PC, your DVD player, etc.
But major concepts are the same
The x86 Platform
Many processor architectures: Intel x86, ARM, Oracle Sparc, IBM Power, etc.
We’ll use x86 as an exemplar
The Android emulator uses an x86 Atom image
Familiarity. Lots of online resources.
Applies to most other architectures as well (with small differences)
Besides, most of the
OS
code we will encounter is architecture agnostic
Typical PC Architecture
One or more CPUs, memory, and device controllers connected through system bus
Computer Organization
Computer Organization: Abstract Model
I/O: communicating data to and from devices
CPU: digital logic for doing computation
Memory: N
words
of B bits
The Stored Program Computer
Often called the
"Von Neumann"
architecture
Memory holds both
instructions
and
data
CPU interprets instructions
Instructions read/write data
“Instructions” are
CPU-level instructions
Memory Access
Memory accesses are
synchronous
Instruction stalls while memory is fetched
Caches are used to reduce the performance hit
The Stack
For implementing function calls
Temporary storage area
Saved register values, local variables, parameters
Stack grows “downward” on x86
I/O Access
Similar to memory access
Except different control signals, so I/O devices know to respond (rather than memory)
IN, OUT instructions are also synchronous
Interrupts
I/O instructions synchronous, but hardware devices can be slow
Reading from disk (milliseconds), waiting for a keystroke (hours?)
Should CPU stay idle when waiting for device?
Interrupts allow CPU to multitask while waiting
Allows I/O to be
asynchronous
Programmable Interrupt Controller (PIC) allows more than one device to interrupt CPU
Direct Memory Access
DMA allows CPU to do useful work while transferring data between disk and memory
CPU programs (controls) DMA controller (or device directly)
DMA controller gets ownership of the bus
DMA controller produces mem read/write bus signals
Symmetric Multiprocessors (SMP)
Initially, one CPU starts executing instructions to initialize system
Thereafter, each CPU executes independently
Only sharing is through common memory (data structures)
Each CPU receives interrupts independently through an APIC (Advanced PIC)