Final review session CS439 7 May 2013 Ground rules --180 minute exam --at 170 minutes, you have to stay seated; do not get up and distract your classmates. --you must hand your exam to us (we are not going to collect them). the purpose of this is to give everyone the same amount of time. --at 183 minutes, we will walk out of the room and won't accept any exams when we leave --thus you must hand in your exam at time x minutes, x <= 170 or 180<=x<183 --you can bring TWO two-sided sheet of notes; formatting requirements listed on Web page --**NOTE**: We do not guarantee that these review notes are necessary or sufficient: there is likely to be material on the final that is not referenced here, and there is likely to be material referenced here that is not on the final. Material --Readings --Labs --Homeworks, as relevant to class discussions --Lectures. Following topic list taken nearly verbatim from first two midterm reviews. --Operating systems: what are they? --goals, purpose --examples and history --privileged vs unprivileged mode --user-level / kernel interaction: how does the kernel get invoked? --by user programs (system calls) --by hardware interrupts --processes --what are they? (registers, address space, etc.) --how do they get created? fork()/exec() --context switches (when? how?) --process states --system calls --shell --threads --why threads? --use of threads --user-level vs. kernel --how implemented? swtch(), separate registers, separate stacks (which applies to both user-level and kernel) --blocking vs. non-blocking I/O --concurrency --hard to deal with; abstractions help us, but not completely --critical sections --mutexes --spinlocks --condition variables --monitors --lots of things can go wrong: safety problems, liveness problems, etc. --What's the plan for dealing with these problems? --safety problems: build concurrency primitives that get help from hardware (atomic instructions, turning off interrupts, etc.) and move up to higher level abstractions that are easy to program with --liveness problems: most common is deadlock, and we discussed strategies for avoiding it. other problems too: starvation, priority inversion, etc. --lots of trade-offs and design decisions --performance v. complexity --lots of "advice". some is literally advice; some is actually required practice in this class. --software safety (Therac-25) --PC architecture, x86 instructions, gcc calling conventions --PC emulation --scheduling --virtual memory --segmentation (how does it work in general? on the x86?) --paging (how does it work in general? on the x86?) virtual address: [10bits 10bits 12bits] --entry in pgdir and page table: [20 bits more bits bottom 3 bits] --protection (user/kernel | read/write | present/not) --what's a TLB? --how does JOS handle virtual memory for the kernel? for user processes? --page faults (their uses and costs) --page replacement --heap management --interrupts: purpose and mechanics --I/O --architecture --how kernel communicates with devices --device drivers --DMA --polling vs. interrupts --Disks --geometry, performance, interface, technology trends, scheduling, placement strategy --More concurrency --review spinlocks, MCS locks --ccNUMA machines --event-driven programming --File systems --basic objects: files, directories, meta-data, links, inodes --how does naming work? what allows system to map /usr/homes/bob/index.html to a file object? --types of file layout: --extents, FAT, indexed structure, classic Unix, FFS --tradeoffs --performance --caching --crash recovery --ad-hoc: write meta-data synchronously and in the right order --depend on fsck --ordered updates: write meta-data in the right order but not necessarily synchronously --depend on fsck --write-ahead logging (called *journaling* in FS context) AFTER MIDTERM 2 --RPC, client/server systems --case study: NFS (network file system) --marquee user of RPC --RPC: transparent or not? --transactions --ACID semantics --we focused on the "A" and the "I" in ACID --we used a bunch of mechanisms, including but not limited to: --transactions API (begin_trans(), end_trans(), commit(), abort()) --undo/redo log + recovery protocol (can usually get away with redo logging, only) --locking --concept of a commit point --distributed systems --what makes them hard? --two generals' problem --distributed transactions, two-phase commit --MapReduce --class discussion on the paper --programming model --fault-tolerance (or lack thereof) --design decisions (don't handle all cases if you don't have to) --Networking --layered model: key abstraction for thinking about networks --physical layer, link layer, network layer, transport layer, application layer --for each layer, we used the Internet's corresponding technologies as a case study (wires, Ethernet, IP, TCP/UDP, HTTP) --also discussed ARP and DNS, which don't fit neatly into the layers --protection and security --stack smashing / buffer overflow --trusting trust --Unix security model --access control, privileges (explicit and implicit), setuid, attacks --security thoughts generally: when do you use which tool?