Homework 2

Due 1/27/2012 [start of section]

Problem 1

(Midterm 1 fall 2011)

Virtualization uses a hypervisor running in privileged mode to create a virtual machine that runs in unprivileged mode. Then, unmodified guest operating systems can run in the virtual machine. The hypervisor can provide the illusion that each guest operating system is running on its own machine in privileged mode.

Early versions of the x86 architecture (pre-2006) were not completely virtualizable -- these system could not guarantee to run unmodified guest operating systems properly. One problem was the popf ``pop flags'' instruction. When popf was run in privileged mode, it could change both the ALU flags (e.g., ZF) and the systems flags (e.g., IF, which controls interrupt delivery), and when popf was run in unprivileged mode, it could change just the ALU flags.

(a) Why do instructions like popf prevent transparent virtualization of the (old) x86 architecture?

(b) How would you change the x86 hardware to fix this problem?

Problem 2

Anderson and Dahlin OSPP Chapter: 4 Problem: 1

Problem 3

Anderson and Dahlin OSPP Chapter: 4 Problem: 3

Problem 4

Anderson and Dahlin OSPP Chapter: 4 Problem: 4

Problem 5

Anderson and Dahlin OSPP Chapter: 4 Problem: 5

Problem 6

Anderson and Dahlin OSPP Chapter: 4 Problem: 7

Problem 7

Anderson and Dahlin OSPP Chapter: 4 Problem: 8

Problem 8

Anderson and Dahlin OSPP Chapter: 4 Problem: 9

Discussion Problem

Everyone should attempt this problem before the discussion section, but no one is required to turn it in.

Anderson and Dahlin OSPP Chapter: 4 Problem: 10

Discussion Problem

Everyone should attempt this problem before the discussion section, but no one is required to turn it in.

Anderson and Dahlin OSPP Chapter: 4 Problem: 11