1. (User/Kernel Mode) Which of the following instructions should be priviledged (that is, can only be executed from kernel mode)? a. read value of the current clock; b. set value of the current clock; c. Turn off interrupts; d. switch from kernel to user mode; e. switch from user to kernel mode; f. Turn off clock interrupt (or timer interrupt); g. Turn on clock interrupt (or timer interrupt); h. Stop the disk from spinning (spin down the disk); i. read one byte from the keyboard buffer; 2. How many instances of caches are implemented by the Operating System? What are the instances of caches that are not implemented by the operating system, but the OS must deal with it? Why are the caches useful? What problems do they create? (Example: cache consistency in distributed file systems and their solutions) 3. Almost all user activities in the modern kernel are encapsulated as processes. What are the information that the operating system must keep track for each process? Now, suppose you want to implement a kernel facility that can migrate processes across the network to another computer. The facility is called when the load on the current computer is too high, or when the owner of the process would like to migrate it. Discribe the steps that the kernel facility must take in order to migrate a process. 4. The semaphores that we have learnt about are sometimes called "counting semaphores", because they have a value C associated with them. A simpler form of semaphore is a binary semaphore, in which there is the value C can be either 0 or 1, and can't be more than 1. Describe how to use two binary semphores S1 and S2 to implement a counting semaphore. Assume that S1's initial value is 1, and S2's initial counter value is 0. 5. Why are page sizes always powers of 2? 6. assume that a machine has M page frames. A process has P memory references, and during the P memory references, it accesses N distinct pages. - what's the lower bound on the number of page faults? - what's the uppper bound on the number of page faults? what if M > N? 7. Question 9.5 on pg. 331. 8. Question 9.9 on pg. 332. 9. Disks can be split into file system and swap partition in any portions. Describe how one might want to set up the partitions. 10. If a system support memory-map of a file, how should the virtual memory management code be changed? 11. What's the purpose of the open and close system calls? 12. Intel proposed an optimization technique for the refragmentation process. They notice that when a user starts Win95, the files that are read are always the same. Describe the optimization they used to speed up the start-up time.