CMD + K
CMD + K
Videoer
Animerte scener med fortellerstemme. Velg en scene for å spille av.
Kapittel 1 · Introduksjon til operativsystemer
Kapittel 2 · Prosesser og prosess-API
fork(): One Process Becomes Two
fork() duplicates the calling process — both parent and child return from the same call with different return values, and run concurrently from there
Process States: Running, Ready, Blocked
Process states — a process is always in one of three states: RUNNING on the CPU, READY waiting for the CPU, or BLOCKED waiting on an I/O completion; the scheduler and I/O events drive every transition
Kapittel 3 · CPU-virtualisering og Limited Direct Execution
Kapittel 4 · CPU-planlegging: fra FIFO til MLFQ
Multi-Level Feedback Queue: A Scheduler That Learns
MLFQ — three priority queues, jobs start at the top and get demoted when they use a whole time slice; a periodic priority boost lifts everyone back to the top to avoid starvation. Learns short vs long without knowing job lengths up front.
Round-Robin Scheduling: Fairness by the Slice
Round-robin scheduling — give every ready job one fixed-length time slice in turn; short jobs respond fast, long jobs make steady progress
Shortest Job First: Why Order Changes Wait Time
Shortest Job First scheduling — three jobs arrive together; running them in arrival order versus shortest-first changes the average turnaround time even though the total work is identical
Kapittel 6 · Adresseområder, relokering og segmentering
Kapittel 7 · Paging, TLB og sidetabeller
Address Translation: How a Page Table Finds the Bytes
Paging address translation — a virtual address splits into VPN + offset; the VPN indexes a per-process page table to a physical frame number; the frame number plus the offset is the physical address
TLB Hits and Misses: The Cost of a Page Table Lookup
Translation Lookaside Buffer — a tiny on-chip cache of recent virtual-to-physical translations; a hit returns the frame number in a single cycle, a miss walks the page table and then fills the cache, dramatically slower
Kapittel 8 · Virtuelt minne, page faults og sideerstatning
Kapittel 9 · Tråder, locks og condition variables
Producer–Consumer: When a Thread Needs to Wait
Producer–consumer with condition variables — a bounded buffer fills and drains; a producer that finds the buffer full waits on a condition; a consumer that finds it empty waits on the other; signal wakes one waiter
Race Condition: When Two Threads Share a Counter
Race condition — two threads incrementing a shared counter can interleave their load-add-store steps so an increment is silently lost; fixing it needs a critical section
Test-and-Set: Building a Lock with One Atomic Instruction
Test-and-set lock — a single atomic hardware instruction reads a flag's old value and writes one in the same step; threads that read zero own the lock, threads that read one spin until it is released
Kapittel 10 · Semaforer, klassiske synkroniseringsproblemer og deadlock
Dining Philosophers: A Deadlock by Symmetry
Dining philosophers — five threads each need two shared chopsticks; if every philosopher grabs the left one first they all wait forever for the right. The four Coffman conditions for deadlock and how breaking symmetry breaks the cycle.
Semaphores: A Counter Threads Wait On
Semaphores — a single integer plus a queue: P() decrements and blocks if the value would go negative, V() increments and wakes a waiter; a semaphore with initial value 1 acts as a lock
Kapittel 11 · I/O-enheter, disker og RAID
Polling vs Interrupts: How the CPU Talks to a Slow Disk
Polling vs interrupts — polling spins the CPU on a device status register until the device is ready; an interrupt lets the CPU run other work and be woken when the device is done. For a slow device the difference is most of the CPU's time.
RAID: Many Disks, One Logical Drive
RAID — combining several disks to trade capacity for speed (striping, RAID-0), redundancy (mirroring, RAID-1), or both (parity, RAID-5). Visualises a block landing across multiple disks and what happens when one disk dies.
Kapittel 12 · Filsystemer, journaling og crash consistency
Journaling: Crash Consistency by Write-Ahead Log
Crash consistency — a single file write touches data, inode, and bitmap; a crash partway through leaves the filesystem corrupt. A write-ahead journal records the intent first, then replays it on reboot so partial writes never become permanent.
The Inode: A File's Map to Its Blocks
Inodes — every file has a fixed-size record holding its metadata and a list of pointers to the disk blocks that contain its bytes; direct pointers handle small files in one hop, indirect pointers fan out to reach large files via a tree of block pointers