interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / HARDWARE_TEST_RIG.md

194 lines · 10828 bytes Raw Blame History Source

Machine 1 hardware test rig

**Status: proposed design (2026-09-24). Nothing is wired or enabled yet. The operator chooses and approves the parts; maintainers wire it up. Until then, M2C power, capture and input stay pending and boots stay attended.**

Governing: ADR 0011, MILESTONES.md gate M2C, NATIVE_BOOT_ONE_TIME.md, issue #25.

Why

Every Spark boot currently needs a person at the machine: someone holds the power button when a boot hangs, photographs the screen because the post-exit report has no other record, and types at the firmware menus. That does not scale, and it cannot run unattended. The rig gives three independent functions for Machine 1, all serialized through aien-proof hold --resource machine-1 (see Serialization):

  1. Power and reset control: momentary press, long press (force off), and a hard power cut that always works.
  2. Display or console capture: the screen from cold boot through the post-exit report, replacing the operator photograph.
  3. Deterministic input and boot selection: scripted keystrokes into the firmware boot menu, the firmware setup screen, and later the AIENOS early console, so the same image boot can be driven the same way every time.

Independence matters: a hung capture dongle must not block a power cut, and a dead HID gadget must not trap the machine with no way to reboot it. Each function below fails without breaking the other two.

A Raspberry Pi is already cabled to the Spark and acts as the rig controller: USB keyboard gadget, capture host, relay driver, and the place aien-proof runs.

Parts list

Prices are approximate, one unit each, 2026. Nothing here is proprietary; every part is replaceable with an equivalent.

FunctionPartRoleApprox. cost
ControllerRaspberry Pi 5 (already cabled to the Spark)Runs aien-proof, the gadget stack, capture and relay controlowned
Power senseSpark ATX 24-pin sense lead (PWR_OK, green wire PS_ON) tapped at the PSU connectorGround PS_ON to force the PSU on; read PWR_OK to know the board has powercable only
Power cutSPDT relay board, 5 V coil, 10 A mains-rated contacts (for example an opto-isolated Songle SRD-05VDC module)Inline with the mains feed or the PSU enable; drops power unconditionally~5 USD
Power/reset buttons2x reed or opto-isolated reed relays (for example Omron G3VM SIP MOSFET relays)One across the Spark front-panel power-header pins, one across the reset-header pins; momentary closure only~4 USD
Display captureUSB 3 HDMI capture dongle, UVC class, 1080p60 (for example an MS2109 or MS2130 based dongle)Spark HDMI out to dongle input; appears as a webcam on the Pi; loop-through port passes the desk monitor~20 to 40 USD
Input emulationThe Pi itself, USB OTG port in HID gadget mode (Linux configfs, dwc2 overlay)Presents a standard USB boot-protocol keyboard to the Sparkincluded
Console capturePi GPIO UART (TX/RX) wired to the Spark UART at 0x16A00000Bounded serial console once #22 lands; 3.3 V levels onlyjumper wires
Enclosure and safetyFused mains inlet box for the relay, insulated standoffs, labeled header leadsMains stays in a closed, fused box; low voltage leaves it~20 USD

Total new spend is roughly 50 to 70 USD. No part is on the Spark's boot critical path except by explicit command: with every relay at rest and every cable disconnected, the Spark boots exactly as it does today.

Function 1: power and reset control

The Spark exposes standard PC-style front-panel pins. Shorting the power pins briefly is a press; shorting them for about five seconds forces power off. The relay board gives a hard cut that works even when the board is wedged.

Safety invariants (enforced by the control scripts, reviewed in the ledger):

Function 2: display and console capture

Two capture paths, both terminating on the Pi:

Capture is read-only: nothing in this function can change what the machine does. A failed capture never blocks power control.

Function 3: deterministic input and boot selection

The Pi's OTG port runs the Linux HID gadget (configfs + dwc2) and appears to the Spark as a plain USB keyboard. The gadget implements the HID boot protocol, so it works in the firmware setup screen and boot menu where no OS driver exists, and later against the native xHCI/HID driver from #24.

Boot selection is deterministic: the rig never types blind. Each scripted sequence is a list of (wait for capture frame matching X, send keystrokes Y) steps. Examples:

The keystroke sets, frame references and expected end states are versioned in this repository next to the scripts that use them, so a boot sequence maps to one exact commit, same rule as the staged image.

Serialization through aien-proof

aien-proof and its machine-1 resource lock live in the aien-sovereign-core repository; this repository holds the rig design and the contract the control surface must meet. The contract is the one already used for staging:

aien-proof hold --resource machine-1 --job <name> -- <rig command>

Rules:

The M2 evidence flow changes in one place: the photograph rows (framebuffer: line and post-exit drawing) come from capture stills named in the ledger payload, and the collector checks them the way it checks the firmware-variable report today.

Attended-to-unattended boot contract

The current attended procedure (NATIVE_BOOT_ONE_TIME.md) maps onto the rig without changing the image:

Attended step todayWith the rig
Operator holds power button after a hangpower.forceoff, then power.press
Monitor attached; operator photographs the screenHDMI capture stills and video, recorded in the ledger payload
Keyboard attached; operator picks entries in firmwareHID gadget sequences, matched against capture frames
Recovery USB stick chosen from the boot menu by handBoot-menu sequence against the same capture frames

Until the owner-controlled boot chain exists (see the Secure Boot note in MILESTONES.md), the rig changes how boots are driven, not what is booted: Secure Boot stays on, native AIENOS boots stay paused, and the rig's first job is running attended flows like recovery-media testing and the TRUST-1 100-boot campaign without a person in front of the machine.

Wiring checklist (maintainers)

  1. Bench-test the relay board on a lamp before touching the Spark.
  2. Tap PS_ON/PWR_OK at the ATX connector; verify sense reads on the Pi.
  3. Identify the Spark front-panel header; wire the two reed relays; verify a 500 ms closure powers the machine on and off.
  4. Route HDMI through the capture dongle to the desk monitor; verify the Pi sees a UVC device and a frame.
  5. Enable the HID gadget on the Pi OTG port; verify the Spark firmware sees a keyboard (boot-menu navigation by script).
  6. Wire the UART (3.3 V only); leave it disconnected until #22 makes the Spark side real.
  7. Run the attended procedure once under the rig, end to end, and record the ledger events as the rig's commissioning evidence.

Each step is independently verifiable and independently reversible; a step that fails leaves the previous functions working.