Hasty Briefsbeta

Bilingual

I Came, I Prompted, I Left Part 1: Building a Hypervisor for the MacBook Neo

21 days ago
  • The author built a custom hypervisor for the MacBook Neo (A18 Pro) to reverse engineer Apple Silicon for Linux porting, using mostly unattended LLM loops.
  • The hypervisor emulates Apple's Secure Page Table Monitor (SPTM) rather than virtualizing it, requiring disassembly of SPTM binary and documenting its internals.
  • Key challenges included an interrupt storm fix, PIO Gateway panic due to incorrect SPTM emulation, SEP timeouts resolved by disabling TrustedAccessory, and a WiFi driver timer misconfiguration fixed by using the ARM generic timer.
  • WindowServer crashes were fixed by disabling Exclave functionality, and UNEXP_RT_HIT_DIR errors were handled by substituting pages with noncoherent memory.
  • The project achieved a fully functional macOS system under the hypervisor within two months, with most debugging done by Codex (LLM), which outperformed Claude Code.
  • Lessons learned: understand the problem before deploying an agent, guide agents with clear processes, and avoid Claude Code due to its inefficiency.
  • Clean room documentation on SPTM internals was published, enabling a clean emulator implementation by another developer.
  • Future work includes GPU driver development, with early prototypes already working on the A18 Pro and M5, and progress on DCP and Linux GPU stacks.