* Flow - control flow - Jumps/branches - Call/return - React to PROGRAM STATE - exceptional control flow - Exceptions - Process Context Switch - Signals - Nonlocal jumps - How to react to SYSTEM STATE * Exceptions * kernel * exception tables * interrupts (Async exceptions) - Timer - I/O * Synchronous Exceptions - Traps - System calls - File: read, write, open, close, stat - Flow: fork, execve, _exit - Signals: kill - Faults - Page - Segmentation - Aborts * Process - two key abstractions - concurrency - logical concurrency - context switching - coding with processes - getpid, getppid, exit, fork, wait, waitpid, getpgrp, setpgid - tracing concurrent programs - process graph - feasible orderings / output - reaping processes - zombie - process of reaping - consequences * Signals - define - who sends, who receives? - What gets sent? - Examples: SIGINT, SIGKILL, SIGSEGV, SIGCHLD - kill - masking - pending / blocked / received - sending signals to process groups - Ctrl-Z, Ctrl-C - receiving: pending & ~blocked - masking/blocking: sigprocmask, sigsuspend - building masks: sigemptyset, sigfillset, sigaddset, sigdelset * Files - types: regular files, directory, socket - others: named pipes, symbolic links - directory hierarchy - open / close / read / write - term: short count - kernel represents open files - descriptor table - open file table - v-node table - file sharing - multiple calls to open - fork - redirection (dup2) * Virtual Memory - define - page table, pages - page hit vs. page fault - terms: thrashing, working set - sharing code/data - Copy-On-Write (COW) * Dynamic Memory Allocation - define - explicit vs. implicit - malloc, free, realloc, sbrk - goals: maximize throughput, minimize peak utilization - fragmentation: internal vs. external - design issues: - marking blocks as allocated - picking a free block - re-insert free block - keep track of free blocks - knowing how much to free given only a pointer - designs: - "standard" -- keep length of a block in the word preceding block (header) - "implicit" -- use length of all blocks to "link" - "explicit" -- use pointers to link free blocks - "segregated" -- different lists for different size classes - "sorted" -- use blocks sorted by size (balanced tree w/ length as key) - terms: - split - coalesce - first fit, next fit, best fit - "boundary tags" - Garbage Collection - mark and sweep - reachable vs. garbage * Extras - pointer arithmetic