Take-Home Optional Midterm

Due date: May 19, 2008 at 5:00 PM; no late work accepted Points: 100

A substantial number of people had problems with questions 3 and 7 on the midterm. Because I want everyone to understand the material, I have prepared this optional exam that focuses on the issues raised by those two problems. Those who do this should improve their understanding of the issues that those two questions raise.

This is an optional midterm. If you choose to do it, this exam counts one-half as much as the in-class midterm.

I will compute your overall midterm exam score as follows. If you do not do this exam, your in-class midterm score will be your overall midterm score. If you do this exam, I will compute your temporary overall midterm score by weighting this exam as one-third of the temporary overall midterm score and your in-class midterm score as two-thirds of the temporary overall midterm score. I will then take the higher of your temporary overall midterm score and your in-class midterm score. Thus, you cannot be hurt by doing this test—but you can raise your overall midterm score.

This exam is open book and open notes.

To turn in: Submit your answers through SmartSite.

  1. (20 points) A binary semaphore is a semaphore which takes two values: true and false. The up and down commands on a binary semaphore b are as follows:
    up(b): set b to false
    down(b): wait until b is false; then set b to true
    Implement binary semaphores using monitors.
  2. (40 points) A bounded semaphore is a regular semaphore that cannot exceed a given value smax > 0. The up and down commands on a bounded semaphore c are:
    up(c): wait until c < smax; then increment c by 1
    down(c): wait until c > 0; then decrement c by 1
    Implement bounded semaphores using regular semaphores.
  3. (40 points) A text editor running on a virtual machine issues a read system call. The editor is running in a virtual machine (call it VM2) that itself is running in another virtual machine (call it VM1). This second virtual machine is running on a virtual machine monitor (VMM). The virtual machine monitor is the operating system for the computer.
    Describe how the read system call is executed, in detail. In particular, state what the virtual machine monitor does, what each level of virtualization does, and how control is transfered to the virtual machine monitor whenever it is invoked, and each virtual machine whenever it is invoked.

You can also obtain a PDF version of this. Version of May 11, 2008 at 10:40 PM