OS & Hardware

What is it called when a guest OS executes a privileged instruction, control passes to the hypervisor, and the hypervisor reproduces the instruction's effect on its behalf?

  1. ATrap-and-emulate
  2. BCopy-on-write
  3. CDemand paging
Show answer and explanation

Answer: A. Trap-and-emulate

A guest OS executes privileged instructions believing it controls the hardware, but it actually runs in a lower-privilege mode, so an exception (trap) occurs. The hypervisor catches it, reproduces (emulates) the instruction's effect so the result is correct for that virtual machine, and returns to the guest. CPU virtualization support makes these transitions fast and reliable. Copy-on-write and demand paging are memory-management techniques.

  • A. Correct. Privileged instructions are trapped and emulated by the hypervisor.
  • B. Copy-on-write is a memory-management technique that copies on write.
  • C. Demand paging loads pages when they are needed.
Practice this topic Back to topic

More OS & Hardware questions

  1. Which describes paravirtualization?
  2. Which correctly distinguishes containers from virtual machines?
  3. Many OSes map the kernel into part of every process's address space (for example the upper range) and forbid user-mode access through page-table protection bits. What is the main advantage of this layout?
  4. With a 4 KB page size, how many virtual address bits represent the position within a page (the offset)?
  5. With 4 KB pages, which pair gives the page number and offset of the 32-bit virtual address 0x00403ABC?