Final review session CS 372H 16 May 2010 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 me (we are not going to collect them). the purpose of this is to give everyone the same amount of time. --at 183 minutes, I will walk out of the room and won't accept any exams when I 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 --emphasis will be on second half of the semester, but first half will be covered --**DISCLAIMER**: We do not guarantee that these review notes are necessary or sufficient: there may be material on the final that is not referenced here, and there may be material referenced here that is not on the final. Material --Readings (book, papers, articles, Web sites; see course Web page, the column called "Reading assignment") --Labs --Homeworks --Lectures PRE-MIDTERM [what is listed below is taken verbatim from the midterm review.] --Operating systems: what are they? --goals, purpose --PC architecture, x86 instructions, gcc calling conventions --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?) --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) --cache replacement policies (applies to caches in general, which includes paging) --went through a bunch of policies: OPT/MIN, FIFO, LRU, CLOCK, NTH CHANCE --some implementation points --the limits of caching --threads --user-level vs. kernel --how implemented? switch(), separate registers, separate stacks (which applies to both user-level and kernel) --concurrency --big unit --see lecture notes from last Tuesday for summary --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. --we assumed sequential consistency --lots of "advice". some is literally advice; some of the material is required in this class. --alternatives to concurrency --scheduling --costs, metrics, criteria --disciplines: FIFO, round-robin, SJF, priority, multilevel feedback queues, real time, lottery scheduling --lessons and conclusions --kernel organization --monolithic, microkernel, exokernel --software safety (Therac-25) POST-MIDTERM --interrupts: purpose and mechanics --I/O --architecture --how kernel communicates with devices --device drivers --DMA --polling vs. interrupts --Disks --performance, geometry, interface, technology trends, scheduling, placement strategy --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, soft updates, write-ahead logging (called *journaling* in FS context) --case study: LFS (log-structured file system) --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 --locking --RPC, client/server systems --case study: NFS (network file system) --marquee user of RPC --RPC: transparent or not? --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 --interface between application and network: often, sockets --interface between kernel and network: often, device driver --distributed systems --what makes them hard? --two generals' problem, two-phase commit --distributed transactions --alternative abstraction to RPC --guest lecture by Keith Winstein --virtual machines --purpose --approaches: binary interpretation, trap-and-emulate, binary translation, etc. --need to "virtualize" (that is, lie to guest OS about) I/O, CPU, memory --protection and security --stack smashing --trusting trust --Unix security model --access control, privileges (explicit and implicit), setuid, attacks --security thoughts generally: when do you use which tool?