Systems

Silicon Swarm

A bare-metal AArch64 game for QEMU virt that joins an isometric city builder to escalating siege waves that start at 1,000 attackers. It runs with no OS or libc, and the worst profiled frame takes about 3M cycles against a 60M-cycle 60Hz budget on Apple Silicon.

Stack
C, AArch64 assembly, NEON, QEMU
Code
github.com/ADM1SH/silicon-swarm

Overview

Install

brew install llvm qemu lld dtc

Verified on this machine:

  • llvm 22.1.8, qemu 11.0.2, lld 22.1.8, dtc 1.8.1: all installed.
  • QEMU reports hvf in qemu-system-aarch64 -accel help: hardware acceleration will actually engage, not silently fall back to TCG.
  • clang -target aarch64-none-elf -ffreestanding -nostdlib → ld.lld → llvm-objcopy -O binary pipeline compiles and links a trivial freestanding object end to end.

Debugging: use lldb, not gdb. Homebrew’s gdb needs a self-signed codesigning cert to attach to processes on macOS. lldb (bundled with Xcode Command Line Tools) speaks the same gdbserver protocol QEMU’s -s -S exposes, so it works out of the box. See debug/lldbinit: lldb -s debug/lldbinit after make debug is running in another shell.

Updates

  • docs: update README with comprehensive documentation
  • Docs: README status/input sections updated to v5 reality
  • v5: live minimap, shift+WASD fast cursor, 1x/2x/4x speed toggle
  • v4: full Cities-Skylines-style simulation on the siege game
  • v3: water + moats, 4-way rotation, entity occlusion, escalating waves
  • v3: fix flicker (double-buffered ramfb page flip), fix input (virtio keyboard), 1920x1080
  • v2 Phase 6: docs + perf verification -- README/handoff updated for v2
  • v2 Phase 5: HUD -- 3x5 bitmap font, money/tool/HP readouts, banners
  • v2 Phase 4: siege on the world heightmap
  • v2 Phase 3: city layer -- building prisms + road/house economy

Docs

The full documentation covers how it works, configuration and results.