Process lifecycle
Compiler/linker - compiling into a program on disk Loader - instantiates process PCB and allocates scheduler - schedules processes via ready q using wtv algorithm dispatcher - loads processor registers, pc, sp, etc from winning process PCB
Scheduling
Preemptive - boots others (e.,g. after a process comes back from IO, a process doesnt go for full length) Non-preemptive - priority, sjf
Methods for memory allocation
upper/lower bounds - static, processes can’t go to other areas fence - only one process at a time, user/kernel above/below fence register val base + limit - dynamic relocation but process has to be in one contiguous block
Paging
Frame table - system - stored in memory, stores what process has what page table Free list - system - tracks unallocated/free physical frames
If invalid page or not there (not a VPN) - triggers page fault
Pros/cons larger pages
Good: Smaller page tables, tlb hit rate inccrease Bad: more internal fragmentation,
Page replacement algos
FIFO - replaces at last evicted + 1 (unless free) second change - sets referenced bits to 0 if 1, else chooses a 0, two passes, starts looking at curr> true LRU - pushdown stack approx LRU - tracks number of references per page, chooses least as victim
Translation lookaside buffer
Save trips to memory (e.g. getting process page table for translation via frame table) by looking in separate small hardware table
fragmentation
Internal - free mem in used blocks (0 for variable-size partitions) External - 0k if only one continuous block, else all