Operating Systems 2026F Lecture 2
Video
Video from the lectures given on September 15th and 16th, 2026 are now available:
Notes
Lecture 2B
----------
* We're not doing assigned TAs
* Please try to go to your assigned tutorial, but you may go to any tutorial if needed
- in general there is more room in the B tutorials
* You have until Sept 22nd to get T1 done
I'll be posting the list of TAs and their office hours by next week.
Textbook
- after today, go read (or at least skim) Chapter 1
- contains much more than I'm covering, but is a good supplement
Today we're starting with a historic approach
It starts with Moore's law
- number of transistors on a chip doubles every 2 years, so exponential growth
exponential growth never continues forever
- Moore's law is mostly done now?
key ideas of operating systems were developed in the 1960's and 1970's
We keep using them because
- they work (sort of)
- our software depends on those ideas
Modern computing is full of illusions
- we call them abstractions, but it goes further
Examples
- speculative execution
- old CPUs executed one instruction at a time
- most programming languages are built around this idea (mostly)
- but modern CPUs are pipelined & superscalar
- they execute more than one instruction at a time, even
for sequential code
- pipelining is just an assembly line applied to CPU instructions
- because there are multiple stages to executing an instruction
- speculative execution happens because of branches (if/then statements,
while loops)
Modern CPUs are so complicated that they have little operating systems in them!
- used to set up all the hardware & other things
I/O devices <-> CPU <-> RAM (volatile memory)
How many programs would an Apple II run at a time?
- only one!
Modern operating systems have two key tasks:
- resource management (managing sharing)
- abstraction
How much sharing are we talking about today?
- many many programs
- many users (sometimes)
- THE NETWORK
So in other words, the OS is abstracting and managing the resources provided by
- the CPU, RAM, and I/O devices
But how do we share these?
- I/O devices: make programs take turns or share, abstract
- keyboard: one at a time
- screen: shared between windows (GUI)
- disks: filesystems
- CPU: take turns
- RAM: everyone gets some RAM
Most efficient path is to make all code cooperate
- but if any behave badly, it all falls apart
So how do we enforce proper sharing in the face of bugs or just misbehaved code?
operating systems enforce resource sharing through raw power
- they are the dictator of their systems, with absolute authority
But operating systems are just code
- how can some code rule over other code?
Basically, the operating system runs first
- because the hardware is waiting to be controlled when first started
So what mechanisms does hardware have to facilitate managed sharing of resources?
- Interrupts
- virtual memory
Virtual memory means that every address a program uses is a virtual address
- has to be translated to a physical address on every memory access
Applications
-----------
Kernel
-----------
Hardware
With virtualization:
Applications
-----------
Kernels
-----------
Hypervisor
-----------
Hardware