* 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 - page hit vs. page fault - sharing code/data - Copy-On-Write (COW) * Dynamic Memory Allocation - define - explicit vs. implicit (reminder: this is language/runtime dependent!) - 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 * Files and Directories - Abstraction of hardware --> OS - 5 User Requirements on Data - Files - Operations: create, delete, open/close, read/write, seek - Access - Directories - Methods * Sequential vs. Direct - Naming strategies * Single-level * Two-level * Multi-level - Soft vs. Hard links - Directories - Operations: search, create, delete (rm), list (ls), rename (mv) - Protections and Permissions - Access Lists/Groups vs. Access Control Bits * Physical Disks - Physical Block * Surface Tracks, Sectors (HD) * Flash Translation Layer -> Block, Page (SSD) - Logical Blocks - Scheduling: FCFS, SSTF, SCAN - RAID (define) * File Organization - Mapping of files (and their blocks) to logical/physical blocks - File Descriptor - Implementations - Contiguous Allocation - Linked Files - Indexed Files - Multi-level Indexed Files - Free list management - Bitmap - Free list