Final review session CS 372H 08 May 2012 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 --**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 --Labs --Homeworks, as relevant to class discussions --Class meetings: lectures and DDs Here is a very brief summary of lectures and DDs 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 --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 (why is it needed, and what are the considerations) --the limits of caching --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 control in Unix --shell, pipes, file descriptors --fork/exec separation --Unix --mechanics --perspective --threads --user-level vs. kernel --how implemented? swtch(), separate registers, separate stacks (which applies to both user-level and kernel) --concurrency --big unit; see lecture notes from February 21 for summary (not going to review it here in depth) --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. --lots of "advice". some is literally advice; some is actually required practice in this class. --alternatives to concurrency --software safety + Therac-25 --linking/loading --what does a process look like in memory? --what problem is linking solving? (latex + page numbering example) --what are the mechanics of linking/loading/etc.? --Jon's lecture on binary rewriting --SFI and sandboxing --kernel design --monolithic, microkernel, exokernel: what are these? --microkernels: --Liedtke paper on IPC performance in L3 --Tanenbaum/Torvalds discussion --exokernels: --The Exokernel paper POST-MIDTERM --disks: the basics --file systems --basic objects: files, directory, meta-data, links inodes --how does naming work? what allows system to map /usr/homes/bob/index.html to a file object? --classic Unix layout (index files, indirect pointers, etc.) --LFS layout --LFS as a case study (crash recovery, garbage collection, layout, etc.) --scheduling --costs, metrics, criteria --disciplines: FIFO, round-robin, SJF, priority, multilevel feedback queues, real time, lottery scheduling --lessons and conclusions --I/O --DMA --polling vs. interrupts --Livelock paper --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 --Clark's "design philosophies" paper --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 --TxOS, which makes the syscall interface, and any corresponding kernel state, transactional --Determinator --what is deterministic execution? --what's Determinator's programming model? --how does it provide that programming model? --how does it provide deterministic execution for legacy code? --Chris's presentation --virtualization --what is the purpose of virtualization? --how does trap-and-emulate work? --virtualizing the CPU --virtualizing virtual memory --VMWare ESX paper --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? --Just want to emphasize that, at the end of the day, the processor and the hardware are providing a low-level interface, and yet we've somehow managed to get the computer to construct these high-level abstractions: processes, file systems, transactions, virtual machines, etc.