diff --git a/README.md b/README.md index cd01f6c..b044ee1 100644 --- a/README.md +++ b/README.md @@ -134,10 +134,17 @@ Cloned coreboot `main`; read manually-confirmed values), synthetic coreboot table layout test, color composition for all four checkpoints, and full-screen fill bounds (first/last pixel written, no overflow past `yres*bpl`). -- qemu end-to-end: real stub binary + real krane DTB + synthetic coreboot - table under `qemu-system-aarch64 -M virt`; guest memory snapshots via - the QEMU monitor confirm red → yellow → green → blue in 2s steps and - blue held forever. All 4 checks pass (`qemu_test.py`). +- qemu end-to-end (`qemu_test.py`, needs `qemu-system-aarch64` + `dtc`): + real stub binary + real krane DTB + synthetic coreboot table under + `qemu-system-aarch64 -M virt`. Guest memory sampled via the QEMU + monitor: first pixel every 0.5s must transition exactly + red → yellow → green → blue with blue held forever, and the final + full-screen snapshot must be uniform blue. All checks pass. + +``` +./build.sh && python3 qemu_test.py # run the end-to-end test +gcc -O2 -o host_test host_test.c && ./host_test # host parser tests +``` - Packed payload verified with `futility vbutil_kernel --verify` (body verification succeeded, devkeys). diff --git a/qemu_test.py b/qemu_test.py index 2ca318a..eb76ddc 100755 --- a/qemu_test.py +++ b/qemu_test.py @@ -118,11 +118,22 @@ def main(): if not ok: fails += 1 - # Snapshot #1 at ~6s wall time (yellow window; qemu boot eats ~1s of - # the first 2s red window, so 6s lands solidly in yellow), #2 at ~12s - # (well into the held blue). - time.sleep(1) - t3 = pmem(FB_ADDR, FB_X * FB_Y * 4, "/tmp/fb_t3.bin") + # Full timeline: sample the first framebuffer pixel every 0.5s for + # ~9s of stub time and require the exact transition sequence + # red -> yellow -> green -> blue, each state held, blue never left. + # qemu startup eats ~1-2s, so sampling starts inside the red window. + seq = [] + for i in range(22): + snap = pmem(FB_ADDR, 4, "/tmp/fb_seq.bin") + c = struct.unpack_from("yellow->green->blue", + order[:4] == [RED, YELLOW, GREEN, BLUE], + f"(observed {[(f'{t:.1f}s', f'0x{c:08x}') for t, c in seq]})") + check("blue held forever (no further transitions)", len(order) == 4, + f"({len(order)} distinct states)") + check("t=13s(stub) full screen uniform blue", + all(px(t9, i) == 0x000000FF for i in (0, N // 2, N - 1)), + f"(0x{px(t9,0):08x})") print("\nALL PASS" if not fails else f"\nFAILED: {fails}") raise SystemExit(1 if fails else 0)