Produce a flashable zynq-7010 image carrying the current console, and make the
image serve it on boot.
- image/make-zynq-afw.sh: cross-compiles alkane-os for armv7 (static musl,
matching the SDK rootfs; the ARM cross-gcc is the linker since the host cc
cannot link ARM objects), drops the binary and the image overlay into the SDK's
zynq rootfs, repacks the ramdisk under fakeroot (device nodes + root ownership
preserved), and packages zImage + dtb + rootfs into a .afw via ci/make-afw.sh.
- image/overlay/etc/init.d/S60alkane-web: starts `alkane-os --serve` after the
network, so the booted image serves the console (login + read-only API) on :80.
The SDK init owns board-detect/network/ssh and leaves the console to this.
- main.rs: fix serve_only to default the cgminer API to loopback (127.0.0.1:4028)
instead of 0.0.0.0, which bind_local (loopback-only) rejected - so plain
`--serve` now starts instead of failing to bind.
Verified: the build produces dist/alkane-os-0.1.0-zynq-7010-armv7.afw (check-afw
OK: kernel 4.3MB, dtb 11KB, rootfs 3.26MB), the rootfs carries the new binary +
the web-init overlay, and the static armv7 binary runs under qemu-arm and serves
the console end to end (login page renders, admin/admin -> 303 session,
/api/hardware open). dist/ is gitignored, so the artifact is not committed.
clippy -D warnings clean, no emojis.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
Introduce a single command point - the bus - that the HTTP API, the web console,
and any future remote/flare client all go through, mirroring wardenOS's
architecture (flare-edge `sprint`). wardenOS runs this as an MQTT broker over a
Unix socket; per its own porting note the right first step is to implement the
Bus facade (publish_state / read_state / request / emit) over an in-process
broker with the registry as the contract, swappable for a socket broker later
without touching callers. alkane-os is std-only and headless, so that is what
this does - no tokio, no MQTT.
- bus.rs: the in-process hub. Retained `state` topics (reads), `req`/`reply`
verbs dispatched to one owning handler (the single write path), and a bounded
`evt` ring. BusError carries warden-style E_* codes.
- registry.rs: the contract - every topic and verb as typed constants plus a
machine-readable description. A test asserts the live bus matches it, the
property busgen gives warden, so the contract cannot drift from the code.
- service.rs: the miner service owns the control/settings/dashboard verbs and
publishes the hardware/summary/control state. Like a warden service it
republishes the affected state the instant a command applies, so a reader
never sees a command lag the periodic telemetry publish (the bus is held Weak
to avoid an Arc cycle).
- web.rs is now a thin HTTP->bus translator (WebContext{bus, csrf}): writes are
bus.request, miner-state reads are bus.read_state, the legacy hand-rendered
page arms are gone (the console renders every nav tab). console.rs reads the
state docs and the csrf is passed in. app::start/main.rs build the bus, register
the service, and publish each control period.
Verified on --serve-sim: stop -> switch to ambient:18000 -> start now each
reflect immediately in /api/control, live frequency tracks the target, and a
stale CSRF is rejected. 193 lib tests pass (incl. bus/registry/service), full
suite green, clippy -D warnings clean, no emojis.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
The on-box UI shipped as a half-migrated shell: the schema settings rendered
with no submit form, the flare-ui nav tabs shadowed the legacy pages with empty
cards, and --serve stood the UI up with no runtime so every value read "not
identified" and nothing could be controlled. This makes it work end to end,
driven by flare-ui, and fully exercisable on a workstation with no hashboard.
Live backend (alkane-os --serve-sim): run the reference HAL in-process on a
private unix socket, boot the runtime against it, and run a control loop that
applies the operator intent every period and publishes a live snapshot. On this
workstation the console shows the chain frequency climbing toward the target and
the controls taking effect; --serve keeps serving the same console with no
backend for a board whose HAL is not written yet.
Operator control channel (control.rs): the one mutable path into the runtime -
a mode/target and a run switch, plus a per-process CSRF token. ControlMode maps
one-to-one onto the real TuningTarget variants (power / ambient / hashrate /
max-fan), so the UI never offers a behaviour the controller lacks. runtime.rs /
tuning.rs gain set_target/target so a mode change applies in place, keeping the
PID state instead of snapping to the envelope floor.
flare-ui console (console.rs): every nav tab rendered from flare-ui primitives
(shell, render::card, readings, actions, components) with live data - overview
hero + state, mining hashboards/power/fans, a Control page with Start/Stop
action buttons, a working Tuning form that posts to /settings, and the system/
security/logs/files/terminal pages wired to their existing data. The tuning
form submit persists the setting AND switches the live target; Start/Stop and
the form are CSRF-checked. /api/control exposes the operator state as JSON, the
interface of record behind the page.
Wiring: app::start and web::serve_listener/handle/route carry Arc<Control>;
main.rs gains --serve-sim and threads a Control through the existing serve/boot
paths. README updated: the "no web frontend" note is no longer true.
Verified on this workstation: --serve-sim boots (s19jpro-bm1362-pic, 3 chains),
frequency converges toward power:2400, and the flare-ui pages drive stop ->
switch to ambient:18000 -> start, with a stale CSRF token rejected (403).
Tests: 183 lib + integration green; clippy -D warnings clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
The UI follows the Warden/FLARE console shape rather than inventing one: a
fixed sidebar of groups and items, hash-routed pages, and dashboards that are a
JSON document an operator edits in place, with a default template per deck and
server-side caps on what a save may contain.
Sections: Dashboard and Mining/Overview are editable dashboards (drag to
reorder, add a block, save, reset). Mining also serves Hashboards, Power Supply
and Fans from the hardware document. Settings serves System, Drivers, Security,
Services, Monitor, Logs, Files and Terminal. Files and Terminal are gated on a
token at /var/lib/alkane/ui-token so a shared network cannot use them.
Served on port 80 of the miner's own address (8080 if 80 cannot be bound), and
started from the runlevel so the page is up without an operator. The JSON API
remains the interface of record: every value shown is also at /api/, and nothing
is reachable only through the page.
Verified: 165 tests, clippy clean, all 13 pages answering, and on the bench S21
Pro the UI answers on port 80 after an unattended reboot.
A client watching the API during a run saw the boot-time snapshot: status was
published at boot and again when the loop exited, so frequency and voltage were
frozen at their starting values for the whole run. The loop now publishes each
period, which is what makes the UI and the API honest while the machine is
actually mining.
--check-profiles parses a database and reports schema, count and validation,
so envelope work can be checked before an image ever boots with it. An inverted
envelope is rejected with a non-zero exit.
The conformance power check now sets 500 MHz before reading, because a backend
that always reports 0 W passed a range check while being useless to a
power-target loop. It must now report a plausible non-zero draw at a known
operating point.
A family backend is only useful if it answers the contract the OS expects, and
until now the only way to know was to boot a board and watch it fail somewhere
downstream. --check-hal walks the contract in order (capabilities, probe,
EEPROM, PSU, frequency and temperature, power, fan) and reports each check
separately, using a fresh connection per check so one desynchronised exchange
cannot invalidate the rest.
It catches the failure modes that matter for autodetect: a backend that does
not advertise chain probing, one that reports an inverted envelope, one that
returns an implausible temperature or power, and one that cannot accept
frequency or fan commands.
Zones now respond to the fan that actually cools them (round-robin by zone
index), so the active fan sweep can be demonstrated end to end without
hardware: with two fans and three zones the learned map is fan 0 -> zones 0,2
and fan 1 -> zone 1, persisted to the map file.
The settle interval is configurable (ALKANE_FAN_SETTLE_MS) because the real
twenty-second settle makes an interactive sweep last minutes.
The reference server answers the real ALKH contract from a fixed machine
description, so the whole OS path can run on a development host and a backend
author has a concrete example of every opcode. It serves detection, frequency,
fan, temperature and power over one socket.
Power was the missing measurement: a power target could not regulate because
the HAL had no way to report watts, so READ_POWER joins the verbs behind
CAP_POWER. With it, --boot against the reference server settles the loop at
623 MHz for a 2400 W target (4 W per MHz in the model) instead of holding at
the boot frequency.
Fan mapping stays opt-in for --boot (ALKANE_FAN_FANS/ALKANE_FAN_ZONES) because
it perturbs the machine and takes minutes.
The tuner produced a frequency the hardware contract had no way to apply, so
detection and tuning could not affect a real board. SET_CHAIN_FREQUENCY joins
the HAL verbs behind its own capability bit, and HalClient refuses to use it
when the backend does not advertise it.
--boot HAL_SOCKET PROFILES.json TARGET [PIC|NOPIC] [TICKS] now runs the real
path: detect over the socket, serve the API and UI, read the hottest sensor,
tick the runtime, apply the frequency to each active chain and the fan duty
when the target owns the fan, then print the published document. A missing
socket exits 1 with a backend error instead of a half-booted miner.
alkane-os --self-check drives the whole chain without hardware: parse the
example profile database, detect three BM1362 chains with a dead EEPROM,
identify an APW12, boot the runtime, tick toward a power target and print the
published hardware document. It fails loudly if the profile database does not
parse, detection refuses, the tuner does not move, or the chain set is wrong,
which makes it usable as a bench smoke test on a bare control board.
profiles.example.json is a shape example, not validated hardware data: the
envelopes are placeholders until real captures fill the database.
Add an app layer that binds and starts the management API and the web UI,
publishes the runtime snapshot, and exposes a bound-address result so callers
can discover ephemeral ports. The binary now uses the same function the tests
use, so the wiring CI exercises is the wiring that runs on a board, and it
gained ALKANE_WEB_LISTEN alongside ALKANE_API_LISTEN.
The snapshot is built from the live runtime: active chains, stop reason and
the last applied frequency rather than the boot default.