Skip to content

WP-12-watchdog_logging

Choose a tag to compare

@cubestudio-dev cubestudio-dev released this 22 Oct 11:52
· 111 commits to main since this release

WP-12-watchdog_logging: watchdog (hardware TCO/WDAT + software) + unified logging + health monitor

Hardware watchdog: Intel TCO discovery (LPC PMBASE +0x60, RCBA enable via PCI config 0xF0, GCS NO_REBOOT at RCBA+0x3410 cleared on arm - the iTCO_wdt update_no_reboot_bit step, found live via -trace tco_timer_expired) plus a full ACPI WDAT parser (24-byte entries, Header Length honoured, SystemIO + SystemMemory GAS with the table's own value/mask), WDAT taking precedence when present. watchdog hw start N arms the real countdown and expiry hard-resets the machine (QEMU q35: REAL reset -> second boot reaches the shell; a synthetic 164-byte WDAT injected with -acpitable drives the same register path). The default pc machine reports none honestly.

Software watchdog: 16 monitored slots (watchdog_register/start/feed/stop/set_timeout) on a 1 s kernel tick with four timeout policies - PANIC through the full WP-11 crash path, REBOOT, KILL task-only (kernel keeps running), LOG once per episode. Slot 0 wraps the WP-11 system heartbeat; the health sampler feeds it every second (boot default stays DISARMED, the documented WP-11 decision).

Unified five-level kernel log: DEBUG/INFO/WARN/ERROR/FATAL with independent per-level switches, a 1024-entry ring (64-entry static bootstrap ring keeps the identity-window ASSERT), serial + VGA live channels, the /var/log/kernel.log file channel (task-context appends, IRQ writers set dirty, panic flush for non-#DF sources - the 15.13 boundary unchanged), flush-first rotation at a runtime threshold (kernel.log -> .1 -> .2 -> .3, keep 3) and a level/module/keyword filter scoping live output AND replay.

Health monitor: a 1 s sampler (CPU busy% from new scheduler idle/total counters, PMM + heap memory, task states, disk + network counters) with rising-edge alarms (mem > 90%, tasks > 64, cpu >= 90% for 10 consecutive samples) and a JSON export (/var/log/health.json).

New commands: dmesg, logcat (-l/-m/-k/-t/-n + -f follow), logctl (status/level/enable/disable/clear/flush/rotate/threshold/export/filter/test), watchdog (status/slots/hw family + test kill|panic|log), health, health watch, health export - 226 -> 233 total (SHELL_MAX_COMMANDS 232 -> 256 after 232 filled exactly and silently refused the last registration, found live at the boot banner). L1 extension interfaces: 146 -> 162 (klog 6 + watchdog 5 + health 5).

Gates, measured on this exact release ISO: WP-12 E2E 14/14 across pc/q35/q35+WDAT (tools/wp12_watchdog_logging_e2e.py; both TCO and WDAT really hard-reset the machine), regression 28/28, dhtest 5/5, cryptotest, SSH E2E 5/5, HTTPS E2E 7/7, BIOS + UEFI boots, 0 errors 0 warnings.

Assets: ISO 12,326,912 B (sha256 5e1d231de96c8681ff872df5dabff35454126e58252da151972af0e8ffb93314), SRC zip 3,797,140 B (07fc65b24aa93271b89e0b6cf8241f90090b9455e8a5c6c23362d37e10e8ff9d), update package 1,063,428 B (e1967c4cb5ddcaad5996fa44a1e304d255d76d688cc90d3dbc7b2233a4d31034) - 3-way identical with the site downloads. Build 250.