Expand description
A tiny 64-bit virtual machine, for tests and for learning.
Real guests are big. To see exactly what the tracer does, it helps to
have a guest small enough to read in full: a few hundred bytes of
machine code, no firmware, no devices. MiniVm creates such a guest
directly in 64-bit long mode:
| guest-physical | contents |
|---|---|
0x0500 | GDT: null, 64-bit code (0x08), data (0x10) |
0x1000 | PML4 |
0x2000 | PDPT |
0x3000 | page directory: 2 MiB pages, except the second |
0x4000 | page table for 0x20_0000..0x40_0000 (4 KiB pages) |
0x6000 | IDT (256 × 16 bytes) |
0x1_0000 | MiniVm::CODE: where your program goes |
0x8_0000 | top of vCPU 0’s stack (each vCPU gets 64 KiB) |
Linear addresses equal physical addresses (identity mapping), and the second 2 MiB is mapped with 4 KiB pages so tests can unmap single pages and provoke page faults.
Structs§
- MiniVm
- A minimal long-mode VM.