Midterm review session CS 372H 7 March 2011 --------------------------------------------------------------------------- Ground rules --75 minute exam --at 70 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 78 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, where: x <= 70 OR 75 <= x < 78 --bring ONE two-sided sheet of notes; formatting requirements listed on Web page Material --Readings (book, papers, articles, Web sites; see course Web page, the column called "Reading assignment") --Labs --Homeworks --Lectures --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? swtch(), separate registers, separate stacks (which applies to both user-level and kernel) --concurrency --big unit; see lecture notes from last Tuesday (March 1) 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. --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) --kernel organization --monolithic, microkernel, exokernel --scheduling --costs, metrics, criteria --disciplines: FIFO, round-robin, SJF, priority, multilevel feedback queues, real time, lottery scheduling --lessons and conclusions --Now questions from you all......