Description
The /system JSON endpoint in webfrontend/netsrv.c hardcodes "power": 0
on line 313 (and "reset": 0 on line 312), regardless of the simulator's
actual run state.
httpdPrintf(conn, "\"reset\": %d, ", 0 /*reset*/);
httpdPrintf(conn, "\"power\": %d ", 0 /*power*/);
The /*power*/ and /*reset*/ inline comments suggest these were
placeholder values during early development — likely pending wiring to the
actual simulator state variables.
Impact
Any frontend that polls /system and reads state.power will always see
the simulator as "powered off" — even when the CPU is actively running CP/M
or any other ROM/program. This breaks status indicators and any auto-recovery
logic that gates on state.power == 1.
Reproduction
- Build any frontpanel-enabled machine (e.g.
imsaisim)
- Start with
-n flag (web frontend enabled)
- Boot CP/M in the terminal — emulator is clearly running
curl http://localhost:8080/system | jq .state
- Observed:
{"last_error": 0, "cpu_error": 0, "reset": 0, "power": 0}
- Expected:
power: 1 while simulator is running
Context
Discovered while deploying imsaisim in a headless Linux container
(Debian 13 trixie) for a public-facing web demo. Frontend showed
"System offline. Reload?" loop because it interpreted state.power == 0
as the simulator being down, despite CP/M booting fine and accepting
keyboard input via the /tty WebSocket.
We don't propose a specific fix path here — wiring state.power and
state.reset to actual simulator state may interact with the CPA
(Control Panel Adapter, see #38) work and the FRONTPANEL conditional
compilation paths, which warrant maintainer judgment.
Environment
- z80pack: master HEAD
91fd28eb (release 1.38)
- Build:
make FRONTPANEL=NO INFOPANEL=NO build for headless container deployment
- OS: Debian 13 trixie (libc 2.41), x86_64
Reported by Richard Murray, in collaboration with Claude (Anthropic) — colossus-ia.org
Description
The
/systemJSON endpoint inwebfrontend/netsrv.chardcodes"power": 0on line 313 (and
"reset": 0on line 312), regardless of the simulator'sactual run state.
The
/*power*/and/*reset*/inline comments suggest these wereplaceholder values during early development — likely pending wiring to the
actual simulator state variables.
Impact
Any frontend that polls
/systemand readsstate.powerwill always seethe simulator as "powered off" — even when the CPU is actively running CP/M
or any other ROM/program. This breaks status indicators and any auto-recovery
logic that gates on
state.power == 1.Reproduction
imsaisim)-nflag (web frontend enabled)curl http://localhost:8080/system | jq .state{"last_error": 0, "cpu_error": 0, "reset": 0, "power": 0}power: 1while simulator is runningContext
Discovered while deploying imsaisim in a headless Linux container
(Debian 13 trixie) for a public-facing web demo. Frontend showed
"System offline. Reload?" loop because it interpreted
state.power == 0as the simulator being down, despite CP/M booting fine and accepting
keyboard input via the
/ttyWebSocket.We don't propose a specific fix path here — wiring
state.powerandstate.resetto actual simulator state may interact with the CPA(Control Panel Adapter, see #38) work and the FRONTPANEL conditional
compilation paths, which warrant maintainer judgment.
Environment
91fd28eb(release 1.38)make FRONTPANEL=NO INFOPANEL=NO buildfor headless container deploymentReported by Richard Murray, in collaboration with Claude (Anthropic) — colossus-ia.org