aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
GitHub aien-dev/aienux#350 (code only)
Apply it
git checkout -b patch-f6302cbf2c79a81c c05a49596c6e0bb78ca65b32aa947f52da7b8716 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/f6302cbf2c79a81c.patch | git am
Provenance
github-import 1
aien-dev/aienux
350
a7675bef99c9db92c4383dbaa9dc2ebebae691db
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":350,"url":"https://github.com/aien-dev/aienux/pull/350","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:15Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 09731fe1..0c8d100d 100644 --- a/.crumb +++ b/.crumb @@ -28,32 +28,32 @@ }, { "digest": "edc9efe14efab371f4d937256d062b8e17b4387d11914fced55ccdf365ad85a2", - "last_commit": "426c4b5", + "last_commit": "c05a495", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { - "digest": "8d8b584b803ad58093160f159c4e02e90362ade480b066b0275b196471e59535", - "last_commit": "8937980", + "digest": "9b55aeb41d7187fbef6fd8438a748fbb77ed95967f124b82e4d466a08793df09", + "last_commit": "a0fa796", "name": "native", "purpose": "Directory native. Purpose not yet described by a human." }, { - "digest": "172a8f2b99ec666758dfe56e51df2a79b9aa482154c193e1ce127b192e5fa520", - "last_commit": "426c4b5", + "digest": "fe47cb248b0f45e1d91fe38a8787181eee2a42fcd49cc313a70323f207d48392", + "last_commit": "a0fa796", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:0ac43095d2b89a99e4c1a68fe524e2e5953560027a44adc807b04f7fd553ffa4", - "compiled_at": "2026-10-14T11:49:57Z", + "children_root": "sha256:655675e603ff7ebfc946a44bc5d4f03ca7391513474aec182e1ae465ea82701b", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", - "digest": "sha256:404b1bed66d33000266f0b0d3508abdc9335c80aeefcb4bd63c613cdb2557313", - "evidence_files": 156, - "evidence_root": "sha256:cd53ab119be9de6ce28c4f5949b106c9622f1fe105611de3de21c3bce7932694", - "files": 3391, - "generated_at_commit": "426c4b5170cc0bdcb7b5d8a958508bf58705fe51", - "source_tree": "sha256:141a287bfa9195390e5915029bb32eb34982436d9745d8ee72a8c21ad43cf128" + "digest": "sha256:496650be293999f74ccead651ea81b1bec6bf4f6e0f123fe306cbbfee0254317", + "evidence_files": 183, + "evidence_root": "sha256:9ac286aca0d673f856463c2a1541854df773bfe792792e6b82b7cb7a47cd17cc", + "files": 3421, + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", + "source_tree": "sha256:469f3f55a14e1ae1e1afce9e45608d7d8c33504375697b603fac08d6f03b6e49" }, "owner_lane": "", "provenance": { diff --git a/crates/.crumb b/crates/.crumb index 86acbb6e..58809c7a 100644 --- a/crates/.crumb +++ b/crates/.crumb @@ -138,7 +138,7 @@ }, { "digest": "a0d0036c90e3d64d6e1caa67b77bf2b8deb898c597e9f0b797df4a144468e061", - "last_commit": "c9e49a1", + "last_commit": "2951ea1", "name": "aienos-kernel", "purpose": "Directory crates/aienos-kernel. Purpose not yet described by a human." }, @@ -150,13 +150,13 @@ } ], "children_root": "sha256:ca16d018c0c02840ba1f87e2a7b64ed259a36253ed29230f274ebcabb43c8a7e", - "compiled_at": "2026-10-14T05:42:42Z", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", "digest": "sha256:0a64e70b4b3a673fd433dc6404ed4c8fa0218362d90af3f16bd9f23ec4efc3e3", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 267, - "generated_at_commit": "02f8eab6a95907159c13e8b83fc0aaf2c100db11", + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", "source_tree": "sha256:95fcb3209b6312b16f4a300bbe9ef3fb0136389b0b418f049e82ea7a425b65c0" }, "owner_lane": "", diff --git a/crates/aienos-artifact-tool/.crumb b/crates/aienos-artifact-tool/.crumb index e78f43b2..a79f1dda 100644 --- a/crates/aienos-artifact-tool/.crumb +++ b/crates/aienos-artifact-tool/.crumb @@ -24,13 +24,13 @@ } ], "children_root": "sha256:9e74efbe992bdf8537913d0945f0b28487e757732babf47a95707d1203682e7b", - "compiled_at": "2026-10-14T00:20:37Z", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", "digest": "sha256:ff4260f8fede1182f834d89589eb4d5a6c6160032dfc570003d506411fe93aa4", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 39, - "generated_at_commit": "a3e9c23dfc5b0ed0f9701132904b28edac14b71f", + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", "source_tree": "sha256:89eb7ba0259498354bbb1f270b83b0a487ff86996ecb068df73ea51e473a92e2" }, "owner_lane": "", diff --git a/evidence/pi5_hardware_runs_2026-10-13/KLOG_BIN_SHA256.txt b/evidence/pi5_hardware_runs_2026-10-13/KLOG_BIN_SHA256.txt new file mode 100644 index 00000000..0951d2fe --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/KLOG_BIN_SHA256.txt @@ -0,0 +1,6 @@ +# sha256 of AIENOS/KLOG.BIN from each run (2097152 bytes each; the files are not in this folder). +# Originals: ~/workspace/pi5-runs/<tag>/AIENOS/KLOG.BIN on the Spark. +# Check on the Spark: cd ~/workspace/pi5-runs && sha256sum -c <this file> (lines starting with # are ignored) +b0d2272aed689d2962734f7eee78ad6bf8eebcbd76fd2d21cc2045e441231062 pi5-k1/AIENOS/KLOG.BIN +5cb19e99e6ea169f049f29c41ce7b62d49db62601968ebb0c41bd20a5826c7b1 pi5-sd1a/AIENOS/KLOG.BIN +a67d6a5c08233900c8bd2225d06240fc91b26ac75b19360f3f438c1eb4d714e6 pi5-sd1b/AIENOS/KLOG.BIN diff --git a/evidence/pi5_hardware_runs_2026-10-13/README.md b/evidence/pi5_hardware_runs_2026-10-13/README.md new file mode 100644 index 00000000..867b7296 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/README.md @@ -0,0 +1,191 @@ +# Pi 5 hardware runs, 2026-10-13: pi5-k1, pi5-sd1a, pi5-sd1b + +These are the raw records of the three runs of the AIENOS C kernel on the hub +Raspberry Pi 5 that merged PR #345 (pi5-k1) and PR #346 (pi5-sd1a, pi5-sd1b) cite. +Before this folder they existed only on the Spark, under `/home/drakestapleton/workspace/pi5-runs/<tag>/`. +Every file here is a byte-for-byte copy of the file of the same name in that run +folder (`cmp` equal when copied). Nothing was edited, including the home-directory paths inside `run.log`. + +Check the copies: `cd evidence/pi5_hardware_runs_2026-10-13 && sha256sum -c SHA256SUMS` +(SHA256SUMS covers every file in this folder except itself). + +The runner that produced the `run.log` files is `scripts/pi5/pi5-run.sh` (with `klog-lib.sh`). +It runs on the Spark and drives the hub over ssh. It is not run by CI. + +## Manifest + +The date is 2026-10-13 UTC for all three runs. `run.log` itself carries only +`HH:MM:SSZ`; the date is taken from the file times (`kernel.log` of pi5-k1 was written +2026-10-12 23:13:05 -0500, which is 04:13:05Z on the 13th). The time range is the first +and last timestamped line of `run.log`. + +| Tag | UTC time | EFI sha256 (`run.log`) | `aienos_commit` line (`kernel.log`) | Cited by | +| --- | --- | --- | --- | --- | +| pi5-k1 | 2026-10-13 04:03:42Z to 04:13:05Z | `cb25f3d3294e6b72b7cc773a8cbae2ff0718ada55cfa12c57d767369f9a69266` | `aienos_commit: 8863d91d410ae70536954a0166b71a2a7a982181` | #345 | +| pi5-sd1a | 2026-10-13 07:28:33Z to 07:39:14Z | `b0ffdc61dc23a255af63723a2dc813952d4e069aa8e11e77383eedbbc01ec55a` | `aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b` | #346 | +| pi5-sd1b | 2026-10-13 07:39:28Z to 07:50:44Z | `b0ffdc61dc23a255af63723a2dc813952d4e069aa8e11e77383eedbbc01ec55a` | `aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b` | #346 | + +pi5-sd1a and pi5-sd1b ran the same EFI file (same sha256). In each `kernel.log` the +`aienos_commit` line appears three times (one per report) and all three are identical. + +The EFI files themselves are not in this folder. When this folder was made, the +Spark copies (`~/workspace/pi5-efi/PI5SD1.EFI` and +`~/.claude/jobs/9974574d/tmp/PI5K1-8863d91.EFI`) hashed to the values above. + +### Key result lines, quoted exactly + +Each block is the output of +`grep -E 'pi5_part|pi5_store_layer|klog|timer|cpu|PASS|FAIL' <tag>/kernel.log`. +No line in any of the three `kernel.log` files contains the words PASS or FAIL +(the kernel prints `ok`, `result=ok` and `SUCCESS` instead), so the "PASS on hardware" in the title of PR #345 +is a reading of these lines, not a verdict the kernel printed. +pi5-k1 has no `pi5_part` or `pi5_store_layer` lines (that code came later). + +pi5-k1: + +``` +klog_map: slot lba=86336 sectors=4096 on a disk of 250347520 sectors (firmware read back the header) +timer_irq: 19 ticks in 200 ms +gic_cpu_interface: mmio gicc=0x107fffa000 +timer_stats: intid=30 freq_hz=54000000 period_us=10000 min_us=10000 avg_us=10000 max_us=10000 +smp: boot_mpidr=0x0 madt_cpus=4 conduit=smc psci_version=1.1 +smp_cpu_on: target=0x100 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x200 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x300 psci_rc=0 (SUCCESS) +smp_cpu: target=0x100 checked_in=yes seen_mpidr=0x100 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x200 checked_in=yes seen_mpidr=0x200 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x300 checked_in=yes seen_mpidr=0x300 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp: cpus=4 started=4 checked_in=4 psci_errors=0 distinct_mpidrs=4 wait_us=1 result=ok +klog_card: slot verified by the kernel's own SD driver (lba=86336 sectors=4096); writing +``` + +pi5-sd1a: + +``` +klog_map: slot lba=16392 sectors=4096 on a disk of 250347520 sectors (firmware read back the header) +pi5_part: AIENOS partition first_lba=1050624 blocks=8388608 (4096 MiB) entries_used=2 index=1 via GPT (CRC32 primary+backup ok) +pi5_store_layer: formatted (blank region written, flushed, read back identical) generation=1 region=64 sectors at partition block 8388544 +timer_irq: 19 ticks in 200 ms +gic_cpu_interface: mmio gicc=0x107fffa000 +timer_stats: intid=30 freq_hz=54000000 period_us=10000 min_us=10000 avg_us=10000 max_us=10000 +smp: boot_mpidr=0x0 madt_cpus=4 conduit=smc psci_version=1.1 +smp_cpu_on: target=0x100 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x200 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x300 psci_rc=0 (SUCCESS) +smp_cpu: target=0x100 checked_in=yes seen_mpidr=0x100 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x200 checked_in=yes seen_mpidr=0x200 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x300 checked_in=yes seen_mpidr=0x300 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp: cpus=4 started=4 checked_in=4 psci_errors=0 distinct_mpidrs=4 wait_us=0 result=ok +klog_card: slot verified by the kernel's own SD driver (lba=16392 sectors=4096); writing +``` + +pi5-sd1b: + +``` +klog_map: slot lba=20848 sectors=4096 on a disk of 250347520 sectors (firmware read back the header) +pi5_part: AIENOS partition first_lba=1050624 blocks=8388608 (4096 MiB) entries_used=2 index=1 via GPT (CRC32 primary+backup ok) +pi5_store_layer: reopened (payload identical to the pattern, generation bumped and read back) generation=2 region=64 sectors at partition block 8388544 +timer_irq: 19 ticks in 200 ms +gic_cpu_interface: mmio gicc=0x107fffa000 +timer_stats: intid=30 freq_hz=54000000 period_us=10000 min_us=10000 avg_us=10000 max_us=10000 +smp: boot_mpidr=0x0 madt_cpus=4 conduit=smc psci_version=1.1 +smp_cpu_on: target=0x100 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x200 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x300 psci_rc=0 (SUCCESS) +smp_cpu: target=0x100 checked_in=yes seen_mpidr=0x100 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x200 checked_in=yes seen_mpidr=0x200 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x300 checked_in=yes seen_mpidr=0x300 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp: cpus=4 started=4 checked_in=4 psci_errors=0 distinct_mpidrs=4 wait_us=0 result=ok +klog_card: slot verified by the kernel's own SD driver (lba=20848 sectors=4096); writing +``` + +## What each file is + +| File | What it is | +| --- | --- | +| `<tag>/run.log` | The runner's log. Times are UTC. | +| `<tag>/kernel.log` | The kernel's console text, taken from the log slot (`KLOG.BIN`) on the SD card after the run. | +| `<tag>/block.txt` | The temporary block the runner added to the hub's `config.txt` so the Pi boots the AIENOS test image once (tryboot). | +| `<tag>/config.txt.before`, `.during`, `.after` | The hub's `config.txt` before the block, with it, and after it was removed. For all three runs `before` and `after` are byte-identical, and `during` is exactly `before` followed by `block.txt` (both checked with `cmp` when this folder was made). | +| `<tag>/KLOG.MAP` | The map the runner wrote to the card before the run: where the log slot is, plus a fresh random nonce. Byte-identical to the copy read back from the card after the run (`cmp`). | +| `<tag>/klog-hdr.bin` | The empty slot header the runner wrote at the start of the slot (512 bytes). | + +Not copied: `AIENOS/KLOG.BIN`, the 2 MiB log slot (mostly empty). Its sha256 is in +`KLOG_BIN_SHA256.txt`; the originals are in the Spark's run folders. + +## Checks made when this folder was made + +- `kernel.log` equals `KLOG.BIN` (see limit a below). +- The nonce in each `KLOG.BIN` header equals the nonce in `klog-hdr.bin` and in `run.log`. +- The 64-bit commit field in each `KLOG.BIN` header holds the first 16 hex digits of the + `aienos_commit` line (`8863d91d410ae705` for pi5-k1, `502d1682153b0314` for pi5-sd1a and pi5-sd1b). + +## Limits (read these before relying on these runs) + +a. **`kernel.log` is `KLOG.BIN` bytes 512 to 512+`log_len`.** Checked with `cmp` for all + three: `log_len` (from the `KLOG.BIN` header) is 3809 for pi5-k1, 4075 for pi5-sd1a and + 4089 for pi5-sd1b, and `tail -c +513 KLOG.BIN | head -c <log_len>` is identical to `kernel.log`. + The last line of each `kernel.log` (`klog_card: ... writing`) is printed before the log is + written to the card, so the text cannot show that the write finished; the card copy with + `state=1` (the `klog: state=1 log_len=...` line in `run.log`) is what shows it did. + `KLOG.BIN` is not in the repo, so this check can only be repeated on the Spark. + One more oddity: the pi5-k1 `run.log` says `kernel log NOT written (slot still empty or + missing)` even though the line before it says `state=1 log_len=3809` and `kernel.log` is + complete. `kernel.log` was written in the same instant as that line (file times 23:13:05.517 and + 23:13:05.520 -0500), and `klog-lib.sh` was last modified about 50 seconds later (23:13:56) and now + carries the comment "head stops tail early (SIGPIPE under pipefail)". So the message was most + likely a false alarm from the runner; that cause is an inference, not proven. + +b. **pi5-k1 booted commit `8863d91`, which is not on GitHub.** `8863d91` ("native/disk: polled SD + Host Controller driver for the Pi 5 microSD", 2026-10-12 22:38:42 -0500) exists only on a local + branch (`pi5/target-backup`) on the Spark; `gh api repos/aien-dev/aienos/commits/8863d91...` finds + no such commit. PR #345 landed on GitHub as the single commit `502d168`; the PR's own branch + commits (`93ae032`, `db97e25`) are not `8863d91` either. The Pi image source of `502d168` builds to + the same EFI as `8863d91` (see the rebuild experiment), so the work is in `502d168`, but the commit + the stamp names is not on GitHub. Whether the tree was clean when the pi5-k1 EFI was built is not + recorded (the stamp had no dirty flag then). + +c. **pi5-sd1a and pi5-sd1b stamp `502d168`, but they were built from an uncommitted tree, so the + stamp does not identify their source.** The strings `pi5_part` and `pi5_store_layer`, and the file + `native/kernel/core/pi5_marker.c`, are not in the `502d168` tree (`git grep` finds none); they + first appear in `e262a06` (PR #346). Both `kernel.log` files print them, so the EFI contained code + that `502d168` does not. + +d. **A rebuild from a GitHub commit is not shown to reproduce these EFI hashes as the stamps stand.** + Before this folder, no record showed such a rebuild reproducing them, and building the commit that + a stamp names does not: `502d168` builds to `34f3e4ef...`, which is neither run's EFI (see the + rebuild experiment below). The experiment got matching hashes only by forcing the stamp, once, + on the Spark; it is not a CI check. + +e. **Out of scope here:** the Store runs `pi5-store1` and `pi5-store2` belong to the Pi Store work + (branch `pi5/store-tier`, PR #348, which cites them), not to this folder. They are not recorded here. + +From the PR that adds this folder on, a Pi build (`make -C native/kernel pi5`) made from a tree whose +tracked files differ from HEAD stamps `<HEAD>-dirty`, and `scripts/pi5/pi5-run.sh` logs the stamp it +finds in the EFI and says `NOT commit-bound (dirty build)` for such an image. The three runs here +predate that. + +## Rebuild experiment (done once, 2026-10-13, on the Spark) + +Toolchain: gcc 13.3.0 and binutils 2.42 (Ubuntu 24.04, aarch64 host, native build). +For each row: `git archive <source commit> | tar -x -C <empty dir>`, then +`make -s -C <dir>/native/kernel pi5 AIENOS_COMMIT=<stamp>`, then `sha256sum <dir>/target/native-kernel-pi5/BOOTAA64.EFI`. + +| Source commit | On GitHub | `AIENOS_COMMIT` passed | EFI sha256 | Equals | +| --- | --- | --- | --- | --- | +| `502d168` | yes | `502d1682153b03146c421e5eba4555a9b1ba1c4b` | `34f3e4efa9101ac759cf57b1f9f6b394ee9e0abdb816b23dc388480abd799148` | neither run | +| `502d168` | yes | `8863d91d410ae70536954a0166b71a2a7a982181` | `cb25f3d3294e6b72b7cc773a8cbae2ff0718ada55cfa12c57d767369f9a69266` | pi5-k1 | +| `e262a06` | yes | `502d1682153b03146c421e5eba4555a9b1ba1c4b` | `b0ffdc61dc23a255af63723a2dc813952d4e069aa8e11e77383eedbbc01ec55a` | pi5-sd1a, pi5-sd1b | +| `8863d91` | no (local) | `8863d91d410ae70536954a0166b71a2a7a982181` | `cb25f3d3294e6b72b7cc773a8cbae2ff0718ada55cfa12c57d767369f9a69266` | pi5-k1 | + +What this shows: + +- The pi5-k1 EFI is what the source of `502d168` builds to when the stamp is forced to `8863d91`. + The Pi image source of `502d168` and `8863d91` is the same: inside `native/` the two commits differ + only in the PI5DIAG tool, one Makefile rule for it, README files and crumb files, and the other + differences (Rust crates, a workflow, two scripts) did not change the image. +- The pi5-sd1a and pi5-sd1b EFI (the one that ran) is what the source of `e262a06` builds to when + the stamp is forced to `502d168`. `e262a06` is the child of `502d168`, the commit the stamp names. + +What it does not show: that the same holds on another machine or toolchain (UNVERIFIED), or how +the original images were built (the build commands were not recorded). diff --git a/evidence/pi5_hardware_runs_2026-10-13/SHA256SUMS b/evidence/pi5_hardware_runs_2026-10-13/SHA256SUMS new file mode 100644 index 00000000..413486ad --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/SHA256SUMS @@ -0,0 +1,26 @@ +5d9271897ada58fed92ff8fc29153665f0c7aed7767f7db248c3a9b72d843b60 KLOG_BIN_SHA256.txt +0c8a4f0ba0550e46f1dcd7862c115e1b60f8c6b44cd4844e657d52ee9290d8cc README.md +eac9c34235f7c676fba004e69db01c61f5ca509d21f513de99b3ad647339fb14 pi5-k1/KLOG.MAP +92223aa3b39462c514716dd65d0747fdc8a0f8bb6f7c2274e26ba431d55d4a55 pi5-k1/block.txt +0c0f253d91f0dcd620573696dcfb5b4576e6d70f96bc6b4ac0eb1014b8eac951 pi5-k1/config.txt.after +0c0f253d91f0dcd620573696dcfb5b4576e6d70f96bc6b4ac0eb1014b8eac951 pi5-k1/config.txt.before +6d707ce51653e3d61e008646d4ddd639fb7070ae44cef0089b99bcfe17ed3d8a pi5-k1/config.txt.during +5beba5dbeab83e2bda24b9a535165522298594738d52e1678c9d43bd76fd4c20 pi5-k1/kernel.log +b33c23d250454dfd790c9f822d3a7b2aad303672bca7e5ea30f79c9f687ee99b pi5-k1/klog-hdr.bin +5860d2dde62aacbe8197f95676c7fbcc891fcb81747370e8c200fd75c6383016 pi5-k1/run.log +ca2b85e34feb162055ec0a00397827853394b59704d213b9aa30117d70dce60d pi5-sd1a/KLOG.MAP +92223aa3b39462c514716dd65d0747fdc8a0f8bb6f7c2274e26ba431d55d4a55 pi5-sd1a/block.txt +0c0f253d91f0dcd620573696dcfb5b4576e6d70f96bc6b4ac0eb1014b8eac951 pi5-sd1a/config.txt.after +0c0f253d91f0dcd620573696dcfb5b4576e6d70f96bc6b4ac0eb1014b8eac951 pi5-sd1a/config.txt.before +6d707ce51653e3d61e008646d4ddd639fb7070ae44cef0089b99bcfe17ed3d8a pi5-sd1a/config.txt.during +907d72460ec8340a0d04a029a7d3f6b7dc1ec7cbad77f4f4396f3c868cb5f8e0 pi5-sd1a/kernel.log +bdd479d1c4b3f22dfef0cf68be2c927bf4b6dded58ca24ad3257f83630cb90b7 pi5-sd1a/klog-hdr.bin +07cf0059acd49ebfc1c83ae0f3ae2a1f7fb76fdaafa359d236ff660a07e08b9c pi5-sd1a/run.log +18af158e4b4af7ba442cd8b3add90b005efd9349139c5781965942f296948f04 pi5-sd1b/KLOG.MAP +92223aa3b39462c514716dd65d0747fdc8a0f8bb6f7c2274e26ba431d55d4a55 pi5-sd1b/block.txt +0c0f253d91f0dcd620573696dcfb5b4576e6d70f96bc6b4ac0eb1014b8eac951 pi5-sd1b/config.txt.after +0c0f253d91f0dcd620573696dcfb5b4576e6d70f96bc6b4ac0eb1014b8eac951 pi5-sd1b/config.txt.before +6d707ce51653e3d61e008646d4ddd639fb7070ae44cef0089b99bcfe17ed3d8a pi5-sd1b/config.txt.during +4e594195516228ac9b3e3e7a9e75ebc37fbebec29ec1e215af3543c0d13758fe pi5-sd1b/kernel.log +8fc1e4068f4497e80ecb32e14f5f4258b5fee323b006049f1da028b8e8289228 pi5-sd1b/klog-hdr.bin +3085e502602ce429f6e6c5a60307eea02ab2d13151ac8d9ad0ff6fc6cf46bba0 pi5-sd1b/run.log diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/KLOG.MAP b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/KLOG.MAP new file mode 100644 index 00000000..e41fa28f Binary files /dev/null and b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/KLOG.MAP differ diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/block.txt b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/block.txt new file mode 100644 index 00000000..88caf692 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/block.txt @@ -0,0 +1,15 @@ + +# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after) +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +# <<< AIENOS-PI5 diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.after b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.after new file mode 100644 index 00000000..530b402a --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.after @@ -0,0 +1,67 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.before b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.before new file mode 100644 index 00000000..530b402a --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.before @@ -0,0 +1,67 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.during b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.during new file mode 100644 index 00000000..215d4445 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/config.txt.during @@ -0,0 +1,82 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] + +# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after) +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +# <<< AIENOS-PI5 diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/kernel.log b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/kernel.log new file mode 100644 index 00000000..eddcc019 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/kernel.log @@ -0,0 +1,76 @@ + +report_version: 1 +aienos_commit: 8863d91d410ae70536954a0166b71a2a7a982181 +report_kind: pre_exit +last_stage: firmware_entry +gop: none (LocateHandleBuffer status=0x800000000000000e handles=0) +model_map: absent (no \EFI\AIENOS\MODEL.MAP on the boot volume) +klog_map: slot lba=86336 sectors=4096 on a disk of 250347520 sectors (firmware read back the header) +kernel_impl: c (native/kernel, Lane 18) +firmware_vendor: EDK2 +firmware_revision: 0x10000 +firmware_el: EL2 +counter_frequency_hz: 54000000 +acpi_rsdp: 0x3e394018 +uart: pl011 spcr type=0x3 base=0x107d001000 +image: 0x3cc6a000-0x3cd90000 +exiting firmware boot services +screen: none (no UEFI Graphics Output Protocol); report on UART only +pi5_watchdog: armed 15 s (PM block 0x107d200000), petted at every stage +pi5_sd: host 0x1000fff000 version=0x1002 caps=0x15eac832 caps_base_mhz=200 using 200 MHz (clk_emmc2) +pi5_sd: card ready spec=2 card_hz=25000000 high_capacity=1 blocks=250347520 (122240 MiB) rca=0x59b4 bus=4bit +pi5_sd: read sector 0 rc=0 signature=55aa (MBR ok) + +report_version: 1 +aienos_commit: 8863d91d410ae70536954a0166b71a2a7a982181 +report_kind: kernel +last_stage: kernel_el1 +mmu: enabled +pt_frames_used: 18 +mmu_switch: firmware=EL2 firmware_mmu=on firmware_ttbr0=0x3fbfa000 aienos_root=0x210000 ttbr0_el1=0x210000 switched=yes +mmu_regs: mair=0x4404ff tcr=0x280903510 sctlr=0x30d01805 +memory: ram_ranges=101 free_bytes=7384416256 stack=0x220000-0x260000 heap=0x261000-0x4261000 dma=0x4400000-0x4c00000 exit_attempts=1 +guard_page: ok fault=contained (stack=0x21f000 heap_lo=0x260000 heap_hi=0x4261000) [C kernel addition, not in the Rust kernel] +gic: v2 +timer_irq: 19 ticks in 200 ms +gic_madt: gicd=0x107fff9000 gicr=0x0 arch_rev=2 icc_sre=0 +gic_cpu_interface: mmio gicc=0x107fffa000 +timer_stats: intid=30 freq_hz=54000000 period_us=10000 min_us=10000 avg_us=10000 max_us=10000 +exception_level: EL1 +kernel: alive +kernel_el: EL1h +entropy: unavailable reason=absent (ID_AA64ISAR0_EL1.RNDR=0, no FEAT_RNG); security consumers refuse, fail closed +smp: boot_mpidr=0x0 madt_cpus=4 conduit=smc psci_version=1.1 +smp_cpu_on: target=0x100 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x200 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x300 psci_rc=0 (SUCCESS) +smp_cpu: target=0x100 checked_in=yes seen_mpidr=0x100 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x200 checked_in=yes seen_mpidr=0x200 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x300 checked_in=yes seen_mpidr=0x300 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp: cpus=4 started=4 checked_in=4 psci_errors=0 distinct_mpidrs=4 wait_us=1 result=ok +threads: ok interleave=ABABABABAB +el0 user: hello +el0: ok write=granted forged=denied fault=contained exit=0 +preempt: ok a=13077616 b=8718418 switches=4 +placement: worker0=class0/core0 worker1=class0/core1 +ipc: ok message=delivered cap=delegated rights=attenuated forged=denied revoked=denied +ipc_detail: exit_a=0x0 exit_b0=0x0 exit_b1=0x0 child=0x100000001 revoke=0 +stage devices: not linked +stage security: not linked +stage store: not linked +artifact_source: none (no Store stage in this image) +artifact_candidates: 0 +artifact_receipt_tier: SEED-0B-QEMU +artifact_verifier_identity: 1f49f9593bd304d81c4078665fb50daace59d28dfafb91bdbb94ec0cc981ee05 +artifact_policy_digest: f81123b15a0032656f040e543f3619633ae62e59f98ab8260d5ed786d89e1fbb +artifact_frames_free_before: 1802820 +artifact_frames_free_after: 1802820 +mm_usage: stack_bytes=262144 stack_used=2624 heap_bytes=67108864 heap_free=67108848 heap_min_free=67103696 + +report_version: 1 +aienos_commit: 8863d91d410ae70536954a0166b71a2a7a982181 +report_kind: final +last_stage: final +artifacts: candidates=0 admitted=0 rejected=0 +note: QEMU qualifies nothing physical +klog_card: slot verified by the kernel's own SD driver (lba=86336 sectors=4096); writing diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/klog-hdr.bin b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/klog-hdr.bin new file mode 100644 index 00000000..3d41cdab Binary files /dev/null and b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/klog-hdr.bin differ diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/run.log b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/run.log new file mode 100644 index 00000000..e316aa92 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-k1/run.log @@ -0,0 +1,20 @@ +[04:03:42Z] run pi5-k1: efi=/home/drakestapleton/.claude/jobs/9974574d/tmp/PI5K1-8863d91.EFI sha256=cb25f3d3294e6b72b7cc773a8cbae2ff0718ada55cfa12c57d767369f9a69266 +users: 0 +card+stick ready + +/mnt/aienos/EFI/AIENOS/KLOG.BIN: + filesystem blocksize 512, begins at LBA 2048; assuming 512 byte sectors. + byte_offset begin_LBA end_LBA sectors + 0 86336 90431 4096 +klog_slot_ready +[04:06:43Z] klog slot lba=86336 sectors=4096 nonce=af203ca44b1f0ecab0a9340dc51590f3 (raw card sector matches) +[04:07:16Z] block appended; rebooting the hub with tryboot +[04:10:16Z] hub answers ping again after 180 s; waiting 60 s for ssh +tryboot_flag_now=00000000 +block_removed + 04:13:04 up 3 min, 2 users, load average: 12.43, 8.05, 3.37 +[04:13:04Z] config.txt restored byte for byte +[04:13:05Z] report copied: /home/drakestapleton/workspace/pi5-runs/pi5-k1/AIENOS: KLOG.BIN KLOG.MAP +klog: state=1 log_len=3809 log_total=3809 stage=final +[04:13:05Z] kernel log NOT written (slot still empty or missing) +[04:13:05Z] run pi5-k1 done diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/KLOG.MAP b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/KLOG.MAP new file mode 100644 index 00000000..85162d4b Binary files /dev/null and b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/KLOG.MAP differ diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/block.txt b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/block.txt new file mode 100644 index 00000000..88caf692 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/block.txt @@ -0,0 +1,15 @@ + +# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after) +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +# <<< AIENOS-PI5 diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.after b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.after new file mode 100644 index 00000000..530b402a --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.after @@ -0,0 +1,67 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.before b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.before new file mode 100644 index 00000000..530b402a --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.before @@ -0,0 +1,67 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.during b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.during new file mode 100644 index 00000000..215d4445 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/config.txt.during @@ -0,0 +1,82 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] + +# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after) +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +# <<< AIENOS-PI5 diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/kernel.log b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/kernel.log new file mode 100644 index 00000000..dc7fdc0c --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/kernel.log @@ -0,0 +1,78 @@ + +report_version: 1 +aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b +report_kind: pre_exit +last_stage: firmware_entry +gop: none (LocateHandleBuffer status=0x800000000000000e handles=0) +model_map: absent (no \EFI\AIENOS\MODEL.MAP on the boot volume) +klog_map: slot lba=16392 sectors=4096 on a disk of 250347520 sectors (firmware read back the header) +kernel_impl: c (native/kernel, Lane 18) +firmware_vendor: EDK2 +firmware_revision: 0x10000 +firmware_el: EL2 +counter_frequency_hz: 54000000 +acpi_rsdp: 0x3e394018 +uart: pl011 spcr type=0x3 base=0x107d001000 +image: 0x3cc53000-0x3cd90000 +exiting firmware boot services +screen: none (no UEFI Graphics Output Protocol); report on UART only +pi5_watchdog: armed 15 s (PM block 0x107d200000), petted at every stage +pi5_sd: host 0x1000fff000 version=0x1002 caps=0x15eac832 caps_base_mhz=200 using 200 MHz (clk_emmc2) +pi5_sd: card ready spec=2 card_hz=25000000 high_capacity=1 blocks=250347520 (122240 MiB) rca=0x59b4 bus=4bit +pi5_sd: read sector 0 rc=0 signature=55aa (MBR ok) +pi5_part: AIENOS partition first_lba=1050624 blocks=8388608 (4096 MiB) entries_used=2 index=1 via GPT (CRC32 primary+backup ok) +pi5_store_layer: formatted (blank region written, flushed, read back identical) generation=1 region=64 sectors at partition block 8388544 + +report_version: 1 +aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b +report_kind: kernel +last_stage: kernel_el1 +mmu: enabled +pt_frames_used: 18 +mmu_switch: firmware=EL2 firmware_mmu=on firmware_ttbr0=0x3fbfa000 aienos_root=0x210000 ttbr0_el1=0x210000 switched=yes +mmu_regs: mair=0x4404ff tcr=0x280903510 sctlr=0x30d01805 +memory: ram_ranges=101 free_bytes=7384285184 stack=0x220000-0x260000 heap=0x261000-0x4261000 dma=0x4400000-0x4c00000 exit_attempts=1 +guard_page: ok fault=contained (stack=0x21f000 heap_lo=0x260000 heap_hi=0x4261000) [C kernel addition, not in the Rust kernel] +gic: v2 +timer_irq: 19 ticks in 200 ms +gic_madt: gicd=0x107fff9000 gicr=0x0 arch_rev=2 icc_sre=0 +gic_cpu_interface: mmio gicc=0x107fffa000 +timer_stats: intid=30 freq_hz=54000000 period_us=10000 min_us=10000 avg_us=10000 max_us=10000 +exception_level: EL1 +kernel: alive +kernel_el: EL1h +entropy: unavailable reason=absent (ID_AA64ISAR0_EL1.RNDR=0, no FEAT_RNG); security consumers refuse, fail closed +smp: boot_mpidr=0x0 madt_cpus=4 conduit=smc psci_version=1.1 +smp_cpu_on: target=0x100 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x200 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x300 psci_rc=0 (SUCCESS) +smp_cpu: target=0x100 checked_in=yes seen_mpidr=0x100 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x200 checked_in=yes seen_mpidr=0x200 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x300 checked_in=yes seen_mpidr=0x300 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp: cpus=4 started=4 checked_in=4 psci_errors=0 distinct_mpidrs=4 wait_us=0 result=ok +threads: ok interleave=ABABABABAB +el0 user: hello +el0: ok write=granted forged=denied fault=contained exit=0 +preempt: ok a=13078830 b=8718441 switches=4 +placement: worker0=class0/core0 worker1=class0/core1 +ipc: ok message=delivered cap=delegated rights=attenuated forged=denied revoked=denied +ipc_detail: exit_a=0x0 exit_b0=0x0 exit_b1=0x0 child=0x100000001 revoke=0 +stage devices: not linked +stage security: not linked +stage store: not linked +artifact_source: none (no Store stage in this image) +artifact_candidates: 0 +artifact_receipt_tier: SEED-0B-QEMU +artifact_verifier_identity: 30854467983f22c8740758c4821419eaae5133a39841544a6c1b8be9e0493728 +artifact_policy_digest: f81123b15a0032656f040e543f3619633ae62e59f98ab8260d5ed786d89e1fbb +artifact_frames_free_before: 1802788 +artifact_frames_free_after: 1802788 +mm_usage: stack_bytes=262144 stack_used=2624 heap_bytes=67108864 heap_free=67108848 heap_min_free=67103696 + +report_version: 1 +aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b +report_kind: final +last_stage: final +artifacts: candidates=0 admitted=0 rejected=0 +note: QEMU qualifies nothing physical +klog_card: slot verified by the kernel's own SD driver (lba=16392 sectors=4096); writing diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/klog-hdr.bin b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/klog-hdr.bin new file mode 100644 index 00000000..7fc238ce Binary files /dev/null and b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/klog-hdr.bin differ diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/run.log b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/run.log new file mode 100644 index 00000000..0a879be5 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1a/run.log @@ -0,0 +1,20 @@ +[07:28:33Z] run pi5-sd1a: efi=/home/drakestapleton/workspace/pi5-efi/PI5SD1.EFI sha256=b0ffdc61dc23a255af63723a2dc813952d4e069aa8e11e77383eedbbc01ec55a +users: 0 +card+stick ready + +/mnt/aienos/EFI/AIENOS/KLOG.BIN: + filesystem blocksize 512, begins at LBA 2048; assuming 512 byte sectors. + byte_offset begin_LBA end_LBA sectors + 0 16392 20487 4096 +klog_slot_ready +[07:32:29Z] klog slot lba=16392 sectors=4096 nonce=9dbd04a475665402fdfc26d9f8b45c5d (raw card sector matches) +[07:33:18Z] block appended; rebooting the hub with tryboot +[07:36:50Z] hub answers ping again after 212 s; waiting 60 s for ssh +tryboot_flag_now=00000000 +block_removed + 07:39:14 up 3 min, 2 users, load average: 8.50, 4.26, 1.68 +[07:39:14Z] config.txt restored byte for byte +[07:39:14Z] report copied: /home/drakestapleton/workspace/pi5-runs/pi5-sd1a/AIENOS: KLOG.BIN KLOG.MAP +klog: state=1 log_len=4075 log_total=4075 stage=final +[07:39:14Z] kernel log: 78 lines in /home/drakestapleton/workspace/pi5-runs/pi5-sd1a/kernel.log +[07:39:14Z] run pi5-sd1a done diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/KLOG.MAP b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/KLOG.MAP new file mode 100644 index 00000000..211de610 Binary files /dev/null and b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/KLOG.MAP differ diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/block.txt b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/block.txt new file mode 100644 index 00000000..88caf692 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/block.txt @@ -0,0 +1,15 @@ + +# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after) +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +# <<< AIENOS-PI5 diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.after b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.after new file mode 100644 index 00000000..530b402a --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.after @@ -0,0 +1,67 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.before b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.before new file mode 100644 index 00000000..530b402a --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.before @@ -0,0 +1,67 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.during b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.during new file mode 100644 index 00000000..215d4445 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/config.txt.during @@ -0,0 +1,82 @@ +[all] +os_prefix=current/ + +[tryboot] +os_prefix=new/ + +[all] +arm_64bit=1 +kernel=vmlinuz +cmdline=cmdline.txt +initramfs initrd.img followkernel + +# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these +# parameters related to the base device-tree they must appear *before* any +# other dtoverlay= specification +dtparam=audio=on +dtparam=i2c_arm=on +dtparam=spi=on +dtparam=watchdog=on + +# Comment out the following line if the edges of the desktop appear outside +# the edges of your display +disable_overscan=1 + +# If you have issues with audio, you may try uncommenting the following line +# which forces the HDMI output into HDMI mode instead of DVI (which doesn't +# support audio output) +#hdmi_drive=2 + +# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the +# default (the kernel is in control of graphics memory with full KMS) +dtoverlay=vc4-kms-v3d +disable_fw_kms_setup=1 + +# Enable the serial pins +enable_uart=1 + +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +camera_auto_detect=1 +display_auto_detect=1 + +# Config settings specific to arm64 +dtoverlay=dwc2 + +[pi4] +max_framebuffers=2 +arm_boost=1 + +[pi3+] +# Use a smaller contiguous memory area, specifically on the 3A+ to avoid an +# OOM oops on boot. The 3B+ is also affected by this section, but it shouldn't +# cause any issues on that board +dtoverlay=vc4-kms-v3d,cma-128 + +[pi02] +# The Zero 2W is another 512MB board which is occasionally affected by the same +# OOM oops on boot. +dtoverlay=vc4-kms-v3d,cma-128 + +[cm4] +# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into +# such a board) +dtoverlay=dwc2,dr_mode=host + +[all] + +# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after) +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +# <<< AIENOS-PI5 diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/kernel.log b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/kernel.log new file mode 100644 index 00000000..152972ce --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/kernel.log @@ -0,0 +1,78 @@ + +report_version: 1 +aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b +report_kind: pre_exit +last_stage: firmware_entry +gop: none (LocateHandleBuffer status=0x800000000000000e handles=0) +model_map: absent (no \EFI\AIENOS\MODEL.MAP on the boot volume) +klog_map: slot lba=20848 sectors=4096 on a disk of 250347520 sectors (firmware read back the header) +kernel_impl: c (native/kernel, Lane 18) +firmware_vendor: EDK2 +firmware_revision: 0x10000 +firmware_el: EL2 +counter_frequency_hz: 54000000 +acpi_rsdp: 0x3e394018 +uart: pl011 spcr type=0x3 base=0x107d001000 +image: 0x3cc53000-0x3cd90000 +exiting firmware boot services +screen: none (no UEFI Graphics Output Protocol); report on UART only +pi5_watchdog: armed 15 s (PM block 0x107d200000), petted at every stage +pi5_sd: host 0x1000fff000 version=0x1002 caps=0x15eac832 caps_base_mhz=200 using 200 MHz (clk_emmc2) +pi5_sd: card ready spec=2 card_hz=25000000 high_capacity=1 blocks=250347520 (122240 MiB) rca=0x59b4 bus=4bit +pi5_sd: read sector 0 rc=0 signature=55aa (MBR ok) +pi5_part: AIENOS partition first_lba=1050624 blocks=8388608 (4096 MiB) entries_used=2 index=1 via GPT (CRC32 primary+backup ok) +pi5_store_layer: reopened (payload identical to the pattern, generation bumped and read back) generation=2 region=64 sectors at partition block 8388544 + +report_version: 1 +aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b +report_kind: kernel +last_stage: kernel_el1 +mmu: enabled +pt_frames_used: 18 +mmu_switch: firmware=EL2 firmware_mmu=on firmware_ttbr0=0x3fbfa000 aienos_root=0x210000 ttbr0_el1=0x210000 switched=yes +mmu_regs: mair=0x4404ff tcr=0x280903510 sctlr=0x30d01805 +memory: ram_ranges=101 free_bytes=7384285184 stack=0x220000-0x260000 heap=0x261000-0x4261000 dma=0x4400000-0x4c00000 exit_attempts=1 +guard_page: ok fault=contained (stack=0x21f000 heap_lo=0x260000 heap_hi=0x4261000) [C kernel addition, not in the Rust kernel] +gic: v2 +timer_irq: 19 ticks in 200 ms +gic_madt: gicd=0x107fff9000 gicr=0x0 arch_rev=2 icc_sre=0 +gic_cpu_interface: mmio gicc=0x107fffa000 +timer_stats: intid=30 freq_hz=54000000 period_us=10000 min_us=10000 avg_us=10000 max_us=10000 +exception_level: EL1 +kernel: alive +kernel_el: EL1h +entropy: unavailable reason=absent (ID_AA64ISAR0_EL1.RNDR=0, no FEAT_RNG); security consumers refuse, fail closed +smp: boot_mpidr=0x0 madt_cpus=4 conduit=smc psci_version=1.1 +smp_cpu_on: target=0x100 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x200 psci_rc=0 (SUCCESS) +smp_cpu_on: target=0x300 psci_rc=0 (SUCCESS) +smp_cpu: target=0x100 checked_in=yes seen_mpidr=0x100 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x200 checked_in=yes seen_mpidr=0x200 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp_cpu: target=0x300 checked_in=yes seen_mpidr=0x300 el=1 mmu=on ttbr0_match=yes stack_ok=yes parked=wfe +smp: cpus=4 started=4 checked_in=4 psci_errors=0 distinct_mpidrs=4 wait_us=0 result=ok +threads: ok interleave=ABABABABAB +el0 user: hello +el0: ok write=granted forged=denied fault=contained exit=0 +preempt: ok a=13077751 b=8718451 switches=4 +placement: worker0=class0/core0 worker1=class0/core1 +ipc: ok message=delivered cap=delegated rights=attenuated forged=denied revoked=denied +ipc_detail: exit_a=0x0 exit_b0=0x0 exit_b1=0x0 child=0x100000001 revoke=0 +stage devices: not linked +stage security: not linked +stage store: not linked +artifact_source: none (no Store stage in this image) +artifact_candidates: 0 +artifact_receipt_tier: SEED-0B-QEMU +artifact_verifier_identity: 30854467983f22c8740758c4821419eaae5133a39841544a6c1b8be9e0493728 +artifact_policy_digest: f81123b15a0032656f040e543f3619633ae62e59f98ab8260d5ed786d89e1fbb +artifact_frames_free_before: 1802788 +artifact_frames_free_after: 1802788 +mm_usage: stack_bytes=262144 stack_used=2624 heap_bytes=67108864 heap_free=67108848 heap_min_free=67103696 + +report_version: 1 +aienos_commit: 502d1682153b03146c421e5eba4555a9b1ba1c4b +report_kind: final +last_stage: final +artifacts: candidates=0 admitted=0 rejected=0 +note: QEMU qualifies nothing physical +klog_card: slot verified by the kernel's own SD driver (lba=20848 sectors=4096); writing diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/klog-hdr.bin b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/klog-hdr.bin new file mode 100644 index 00000000..a54fb35b Binary files /dev/null and b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/klog-hdr.bin differ diff --git a/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/run.log b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/run.log new file mode 100644 index 00000000..4d9a3d06 --- /dev/null +++ b/evidence/pi5_hardware_runs_2026-10-13/pi5-sd1b/run.log @@ -0,0 +1,20 @@ +[07:39:28Z] run pi5-sd1b: efi=/home/drakestapleton/workspace/pi5-efi/PI5SD1.EFI sha256=b0ffdc61dc23a255af63723a2dc813952d4e069aa8e11e77383eedbbc01ec55a +users: 0 +card+stick ready + +/mnt/aienos/EFI/AIENOS/KLOG.BIN: + filesystem blocksize 512, begins at LBA 2048; assuming 512 byte sectors. + byte_offset begin_LBA end_LBA sectors + 0 20848 24943 4096 +klog_slot_ready +[07:42:01Z] klog slot lba=20848 sectors=4096 nonce=dadc67d52480f3617630d9c867a46c1f (raw card sector matches) +[07:43:27Z] block appended; rebooting the hub with tryboot +[07:46:27Z] hub answers ping again after 180 s; waiting 60 s for ssh +tryboot_flag_now=00000000 +block_removed + 07:50:43 up 4 min, 2 users, load average: 7.17, 6.65, 3.09 +[07:50:44Z] config.txt restored byte for byte +[07:50:44Z] report copied: /home/drakestapleton/workspace/pi5-runs/pi5-sd1b/AIENOS: KLOG.BIN KLOG.MAP +klog: state=1 log_len=4089 log_total=4089 stage=final +[07:50:44Z] kernel log: 78 lines in /home/drakestapleton/workspace/pi5-runs/pi5-sd1b/kernel.log +[07:50:44Z] run pi5-sd1b done diff --git a/native/.crumb b/native/.crumb index 1cc34eae..bb3b28da 100644 --- a/native/.crumb +++ b/native/.crumb @@ -79,8 +79,8 @@ "purpose": "Directory native/disk. Purpose not yet described by a human." }, { - "digest": "4b6595e55bb546c4d40de5188663a10b77dd3dd9932b57f17f839f8096836383", - "last_commit": "2a5d40f", + "digest": "31737455b2245028f473bf7d18f3c5e45f3f5e89d948d55d480c90f6b8b87f32", + "last_commit": "a0fa796", "name": "kernel", "purpose": "Directory native/kernel. Purpose not yet described by a human." }, @@ -109,15 +109,15 @@ "purpose": "Directory native/store. Purpose not yet described by a human." } ], - "children_root": "sha256:58b7ad9498fde99882d542de6809e662d076a5680abbb6446d673b3de0ee1db3", - "compiled_at": "2026-10-14T02:50:41Z", + "children_root": "sha256:ecde64d885b25ff0007256821368d782117a3229767f1288f58501f2fa5618fe", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", - "digest": "sha256:8d8b584b803ad58093160f159c4e02e90362ade480b066b0275b196471e59535", + "digest": "sha256:9b55aeb41d7187fbef6fd8438a748fbb77ed95967f124b82e4d466a08793df09", "evidence_files": 4, "evidence_root": "sha256:e410b845507e00568e15b51a5797af32a97e0e4b8ab4e8487bb7c98e7e0cf335", "files": 562, - "generated_at_commit": "2a5d40fb8714e3917e82215388e08865a579ecbb", - "source_tree": "sha256:3bbd01bb70304e837f00086ca0b2646f4a113ac759671ce6db8753053a7cd28b" + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", + "source_tree": "sha256:b01897405fdf7f14cf3e5349b434489acfc2c0469455ec92bb91bd5666a435d2" }, "owner_lane": "", "provenance": { diff --git a/native/argus/.crumb b/native/argus/.crumb index 65bb1785..ac2f33a7 100644 --- a/native/argus/.crumb +++ b/native/argus/.crumb @@ -28,7 +28,7 @@ }, { "digest": "c519b9b561e14e4c8017f79c86093d14b250c72e5c17258d77507130dd420a44", - "last_commit": "f78977a", + "last_commit": "09e59a8", "name": "docs", "purpose": "Directory native/argus/docs. Purpose not yet described by a human." }, @@ -40,13 +40,13 @@ } ], "children_root": "sha256:60f887eb1e514a9e647f622c81848e2accd452e38b157103e8a9f58a32bb1694", - "compiled_at": "2026-10-14T01:16:45Z", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", "digest": "sha256:50aa2fbd6ca356b7703517bc7ecf439f7b6e0a6b935d0ca6ca4c6f7caf23ce34", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 47, - "generated_at_commit": "f78977a6ce33ea89a5b3b1952c0a0e403d4504fa", + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", "source_tree": "sha256:9511497343ad28d30fb7c58c0d11c87ab936d6e95ff561bf245ea2e5acbbb4f1" }, "owner_lane": "", diff --git a/native/argus/tests/.crumb b/native/argus/tests/.crumb index bc7771b5..8bba1f25 100644 --- a/native/argus/tests/.crumb +++ b/native/argus/tests/.crumb @@ -13,13 +13,13 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:47:18Z", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", "digest": "sha256:9da71b144b276a79663b8240d09f6ee8ec187a336b45c48dc47adeca8012a11c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 24, - "generated_at_commit": "a863d5c1f5bd89c88c5f6671eecfd27b599ee512", + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", "source_tree": "sha256:9b3b6e1d929d015275c4ed69028acc5b2ea489d66c53540908bb375803fa13f1" }, "owner_lane": "", diff --git a/native/kernel/.crumb b/native/kernel/.crumb index bf8a9f7a..b29837ee 100644 --- a/native/kernel/.crumb +++ b/native/kernel/.crumb @@ -94,20 +94,20 @@ }, { "digest": "8c9d6edb01cdf61cdbeb1399e07e4bf4e506dc841c798db8a03e4ef86efb0a8e", - "last_commit": "2a5d40f", + "last_commit": "8937980", "name": "tools", "purpose": "Hosted (Linux-built) checkers for the native kernel, run by `make -C native/kernel test`; nothin" } ], "children_root": "sha256:07df85f4c5f2c7c519b2d0c0e9a94cdabf029ba6935c68d7af30c1076a8dcbec", - "compiled_at": "2026-10-14T02:50:41Z", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", - "digest": "sha256:4b6595e55bb546c4d40de5188663a10b77dd3dd9932b57f17f839f8096836383", + "digest": "sha256:31737455b2245028f473bf7d18f3c5e45f3f5e89d948d55d480c90f6b8b87f32", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 381, - "generated_at_commit": "2a5d40fb8714e3917e82215388e08865a579ecbb", - "source_tree": "sha256:ca852832288b60fe1665cd76bdac4a08f2ed10eb59b3c7c53b7509d808a9bf4c" + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", + "source_tree": "sha256:9cf06b5cf7b997b087b4ea61597184fa3fff7637a72dd44dcbf0230316cc03b0" }, "owner_lane": "", "provenance": { diff --git a/native/kernel/Makefile b/native/kernel/Makefile index 13db0a4e..582bb097 100644 --- a/native/kernel/Makefile +++ b/native/kernel/Makefile @@ -489,7 +489,22 @@ endif endif OUT ?= $(REPO)/target/native-kernel -AIENOS_COMMIT ?= $(shell git -C $(REPO) rev-parse HEAD 2>/dev/null || echo unknown) +# Pi builds only (CK_PI5=1: "make pi5" and anything built on it): when a tracked +# file differs from HEAD the stamp ends in "-dirty", so the kernel's report +# ("aienos_commit: <stamp>") and the EFI itself say the image is not the bare +# commit. Pi hardware runs are cited as evidence; a bare hash on an image built +# from an edited tree would name a commit that does not contain its source. +# Untracked files are ignored (build output lives in untracked target/). +# Non-Pi builds are untouched: the suffix stays empty and git status is not run +# (the QEMU gates compare "aienos_commit: <HEAD>"). An AIENOS_COMMIT given on +# the command line or in the environment is used as is, with no suffix. +AIENOS_COMMIT_SUFFIX := +ifeq ($(strip $(CK_PI5)),1) +ifneq ($(strip $(shell GIT_OPTIONAL_LOCKS=0 git -C $(REPO) status --porcelain --untracked-files=no 2>/dev/null)),) +AIENOS_COMMIT_SUFFIX := -dirty +endif +endif +AIENOS_COMMIT ?= $(shell git -C $(REPO) rev-parse HEAD 2>/dev/null || echo unknown)$(AIENOS_COMMIT_SUFFIX) CK_EXTRA_CFLAGS ?= # Build-time DMA policy for the full image (see dev/nvme_bind.c): diff --git a/native/kernel/README.md b/native/kernel/README.md index e03588fe..ac760f93 100644 --- a/native/kernel/README.md +++ b/native/kernel/README.md @@ -195,6 +195,11 @@ The image cannot boot in QEMU (the SD host and PM addresses are Pi 5 only). It runs on the hub Pi with the one-shot tryboot runner, which prepares the slot (one contiguous 2 MiB file, its raw card sector read back and compared before the map is written) and pulls the log back after the hub returns to Linux. +The runner is `scripts/pi5/pi5-run.sh` (run from the Spark). A Pi build made from a +tree with uncommitted changes to tracked files stamps `aienos_commit: <HEAD>-dirty` +(the default image never does); the runner reads the stamp out of the EFI, logs it in +`run.log`, and says "NOT commit-bound (dirty build)" for a `-dirty` image. Hardware +receipts from earlier runs are in `evidence/pi5_hardware_runs_2026-10-13/`. ## Known hardware risk: disk footprint (CK gate DISK_LAYOUT: NOT_RUN) diff --git a/native/kernel/tests/.crumb b/native/kernel/tests/.crumb index 5bd45a84..5446ce10 100644 --- a/native/kernel/tests/.crumb +++ b/native/kernel/tests/.crumb @@ -7,13 +7,13 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:54:45Z", + "compiled_at": "2026-10-14T13:28:10Z", "compiler": "crumb-compile/1", "digest": "sha256:67f43d00adce9780c2ae75ece209ac453a1b9debc74d735d9acdb72f36e6df77", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 165, - "generated_at_commit": "8307a68a2eedcc5c8d6c2a6ffbf7c12f398c094b", + "generated_at_commit": "a0fa796235409ce465c467e8c72fbd977485d8f7", "source_tree": "sha256:01254316e00d1bce77c10d8ac08c618006b73522f6d0da0816da80fef5a065f7" }, "owner_lane": "", diff --git a/scripts/.crumb b/scripts/.crumb index 5ca5cfed..869545dc 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T11:49:57Z", + "compiled_at": "2026-10-14T13:26:06Z", "compiler": "crumb-compile/1", - "digest": "sha256:172a8f2b99ec666758dfe56e51df2a79b9aa482154c193e1ce127b192e5fa520", + "digest": "sha256:fe47cb248b0f45e1d91fe38a8787181eee2a42fcd49cc313a70323f207d48392", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 112, - "generated_at_commit": "426c4b5170cc0bdcb7b5d8a958508bf58705fe51", - "source_tree": "sha256:9a6a9875841493c603123e66632b2fc41da523c6d29b61fad4b0e85bbd9d4af6" + "files": 115, + "generated_at_commit": "0d3545fd67a68cb35cb6604be47008826081b309", + "source_tree": "sha256:2db4f6237f7ea63129e4e850cf2ff96f4e6fd726bf38ad59c5c633305bad391c" }, "owner_lane": "", "provenance": { diff --git a/scripts/ck_pi5_build_check.sh b/scripts/ck_pi5_build_check.sh index 7d5a8b76..84a6feca 100755 --- a/scripts/ck_pi5_build_check.sh +++ b/scripts/ck_pi5_build_check.sh @@ -5,6 +5,18 @@ # 1. the Pi image defines the board glue: watchdog, SD host, card log slot; # 2. the default image (make -C native/kernel all) defines none of it, so the # Spark and QEMU builds carry no Pi code (the hooks are weak and absent). +# 3. the commit stamp (the "aienos_commit" string the kernel prints, read back +# out of the EFI with scripts/pi5/efi-commit.sh) tells the truth about the tree: +# - the default image always carries the bare HEAD hash (the QEMU gates +# compare "aienos_commit: <HEAD>"), dirty tree or not; +# - the Pi image carries the bare HEAD hash when no tracked file differs +# from HEAD, and "<HEAD>-dirty" when one does. The dirty case is built +# from a temporary appended line in native/kernel/README.md, restored +# afterwards, into its own OUT (deleted). With that same edit in place +# the default image is built too and must still carry the bare hash. +# If the tree already has uncommitted tracked changes when the script +# starts, the clean-tree and temporary-edit cases cannot be shown and are +# printed as NOT_RUN; the Pi image must then carry <HEAD>-dirty. # The Pi image cannot boot in QEMU (its SD host and PM watchdog addresses are # Pi 5 only); it is run on the hub Pi with the one-shot tryboot runner. set -euo pipefail diff --git a/scripts/pi5/efi-commit.sh b/scripts/pi5/efi-commit.sh new file mode 100755 index 00000000..fb633abf --- /dev/null +++ b/scripts/pi5/efi-commit.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# efi-commit.sh -- print the source commit stamp compiled into an AIENOS kernel EFI. +# +# efi-commit.sh <EFI file> +# +# The kernel prints its build stamp (native/kernel/Makefile AIENOS_COMMIT) as +# "aienos_commit: <stamp>" in every report. The stamp is a plain 40-digit hex +# string in the image; a Pi build (CK_PI5=1) made from a tree whose tracked files +# differ from HEAD carries "<40 hex>-dirty" instead. This script greps the image +# for it (grep -a) so the stamp can be read without booting the image. +# +# Prints the stamp on stdout. Exit 0: exactly one stamp. 1: none found (for +# example a build without git, stamp "unknown"). 2: more than one distinct stamp. +# 3: the file cannot be read. +# Used by pi5-run.sh (logged in run.log) and scripts/ck_pi5_build_check.sh. +set -euo pipefail +efi="${1:?EFI file}" +[[ -r "${efi}" ]] || { echo "efi-commit: cannot read ${efi}" >&2; exit 3; } +# Runs of 40 or more hex digits (optionally followed by -dirty), then keep only +# exactly 40 digits: a longer run (a 64-digit SHA-256 in the image) is not a stamp. +stamps=$(LC_ALL=C grep -a -o -E '[0-9a-f]{40,}(-dirty)?' "${efi}" \ + | LC_ALL=C awk '/^[0-9a-f]{40}(-dirty)?$/' | LC_ALL=C sort -u || true) +n=$(printf '%s' "${stamps}" | grep -c . || true) +case "${n}" in + 1) printf '%s\n' "${stamps}" ;; + 0) echo "none"; exit 1 ;; + *) echo "ambiguous: $(printf '%s' "${stamps}" | tr '\n' ' ')"; exit 2 ;; +esac diff --git a/scripts/pi5/klog-lib.sh b/scripts/pi5/klog-lib.sh new file mode 100644 index 00000000..7f1135eb --- /dev/null +++ b/scripts/pi5/klog-lib.sh @@ -0,0 +1,25 @@ +# klog-lib.sh -- KLOG slot helpers for pi5-run.sh (sourced). Formats: +# aienos native/kernel/core/klog_slot.h (struct ck_klog_map, ck_klog_hdr). +le32() { local v=$1; printf '\\x%02x\\x%02x\\x%02x\\x%02x' $((v&255)) $(((v>>8)&255)) $(((v>>16)&255)) $(((v>>24)&255)); } +le64() { le32 $(( $1 & 0xffffffff )); le32 $(( ($1 >> 32) & 0xffffffff )); } +hexbytes() { local h=$1 out="" i; for ((i=0;i<${#h};i+=2)); do out+="\\x${h:i:2}"; done; printf '%s' "$out"; } +# klog_struct <magic8> <lba> <count> <nonce-hex32> <out> ; map or empty header +klog_map() { # magic version sector_size lba count nonce pad + { printf "AIENKLM1$(le32 1)$(le32 512)$(le64 $1)$(le64 $2)$(hexbytes $3)"; head -c $((512-48)) /dev/zero; } > "$4" +} +klog_hdr_empty() { # magic version state nonce lba count, rest zero + { printf "AIENKLG1$(le32 1)$(le32 0)$(hexbytes $3)$(le64 $1)$(le64 $2)"; head -c $((512-48)) /dev/zero; } > "$4" +} +# klog_extract <KLOG.BIN> <out.txt> : prints the header fields, writes the text +klog_extract() { + local f=$1 out=$2 + [[ "$(head -c 8 "$f")" == AIENKLG1 ]] || { echo "klog: no header"; return 1; } + local state len total + state=$(od -An -tu4 -j12 -N4 "$f" | tr -d ' ') + len=$(od -An -tu8 -j48 -N8 "$f" | tr -d ' ') + total=$(od -An -tu8 -j56 -N8 "$f" | tr -d ' ') + echo "klog: state=${state} log_len=${len} log_total=${total} stage=$(dd if="$f" bs=1 skip=72 count=32 status=none | tr -d '\0')" + [[ ${state} == 1 ]] || return 2 + { tail -c +513 "$f" | head -c "${len}" > "$out"; } || true # head stops tail early (SIGPIPE under pipefail) + [[ $(stat -c %s "$out") == "${len}" ]] || { echo "klog: short extract"; return 3; } +} diff --git a/scripts/pi5/pi5-run.sh b/scripts/pi5/pi5-run.sh new file mode 100755 index 00000000..5576df47 --- /dev/null +++ b/scripts/pi5/pi5-run.sh @@ -0,0 +1,193 @@ +#!/usr/bin/env bash +# Runs from the Spark against the hub Pi 5 over ssh (host alias "hub"); never run it on the hub itself. Run folders go under $PI5_RUNS_DIR (default ~/workspace/pi5-runs). +# pi5-run.sh -- one remote, one-shot AIENOS test run on the hub Raspberry Pi 5. +# +# pi5-run.sh <EFI file> <tag> [wait-file] +# +# 1. Puts <EFI file> on the AIENOS test microSD (mmcblk0p1, label AIENOSPI5) as +# EFI/BOOT/BOOTAA64.EFI and removes the old report, so a report after the run +# proves this run wrote it. +# 2. Makes sure the Pi 5 UEFI firmware from the card is also on the USB stick's +# boot partition under aienos/ (the Pi bootloader reads config from the stick). +# 3. Appends a [tryboot]-only block to the stick's config.txt (backup kept on the +# hub and here) and reboots with reboot '0 tryboot'. Raspberry Pi docs +# (bootflow-eeprom.adoc): the flag "is cleared before starting the firmware, a +# crash or reset will cause the original config.txt file to be loaded on the +# next reboot". Normal boots never read the block. +# 4. Waits for the hub to come back on normal Linux (ping every 30 s, ssh only +# after ping answers; hub stick is fragile: one ssh at a time, no fast retries). +# 5. Removes the block (restores the backup, checks it), copies the card's +# EFI/AIENOS tree to ~/workspace/pi5-runs/<tag>/, unmounts. +# If the hub is not back after 15 min: notify Drake (power-cycle the Pi; it comes +# back on normal Linux because the flag is already cleared). +set -euo pipefail +efi="${1:?EFI file}"; tag="${2:?tag}" +hub=hub +runs="${PI5_RUNS_DIR:-$HOME/workspace/pi5-runs}/${tag}" +mkdir -p "${runs}" +log() { echo "[$(date -u +%H:%M:%SZ)] $*" | tee -a "${runs}/run.log"; } +hs() { ssh -o BatchMode=yes -o ConnectTimeout=15 "${hub}" "$@"; } +mark_begin='# >>> AIENOS-PI5 one-shot tryboot block (pi5-run.sh adds it before a run, removes it after)' +mark_end='# <<< AIENOS-PI5' + +[[ -r "${efi}" ]] || { echo "no EFI file ${efi}"; exit 2; } +sha=$(sha256sum "${efi}" | cut -d' ' -f1) +log "run ${tag}: efi=${efi} sha256=${sha}" + +# ---- which source commit does this EFI claim? (the kernel prints the same string as aienos_commit) ---- +# A Pi build made from a tree with uncommitted changes to tracked files ends in +# -dirty (native/kernel/Makefile); such a run is not tied to any GitHub commit. +stamp_rc=0 +commit_stamp=$("$(dirname "$0")/efi-commit.sh" "${efi}" 2>&1) || stamp_rc=$? +log "efi aienos_commit: ${commit_stamp}" +if [[ ${stamp_rc} != 0 ]]; then + log "!!! NOT commit-bound (no single commit stamp found in the EFI)" +elif [[ ${commit_stamp} == *-dirty ]]; then + log "!!! NOT commit-bound (dirty build): ${commit_stamp%-dirty} is only the commit the build started from; this EFI also holds uncommitted changes" +fi + +# ---- preflight on the hub ---- +hs 'set -e +test "$(cat /proc/device-tree/chosen/bootloader/tryboot | od -An -tx1 | tr -d " ")" = 00000000 +test ! -e /boot/firmware/new || { echo "REFUSE: /boot/firmware/new exists (pending Ubuntu tryboot update)"; exit 1; } +grep -qF "AIENOS-PI5 one-shot" /boot/firmware/config.txt && { echo "REFUSE: block already in config.txt"; exit 1; } || true +lsblk -no LABEL /dev/mmcblk0p1 | grep -qx AIENOSPI5 +findmnt /dev/mmcblk0p1 >/dev/null && { echo "REFUSE: card mounted"; exit 1; } || true +echo "users: $(who | wc -l)"' 2>&1 | tee -a "${runs}/run.log" +[[ ${PIPESTATUS[0]} == 0 ]] || { log "preflight FAILED"; exit 1; } + +# ---- card: install EFI, clear old report; stick: firmware copy ---- +scp -q -o BatchMode=yes "${efi}" "${hub}:/tmp/aienos-run.efi" +hs "set -e +sudo mkdir -p /mnt/aienos +sudo mount /dev/mmcblk0p1 /mnt/aienos +trap 'sudo umount /mnt/aienos' EXIT +sudo cp /tmp/aienos-run.efi /mnt/aienos/EFI/BOOT/BOOTAA64.EFI +sudo rm -rf /mnt/aienos/EFI/AIENOS +test \"\$(sha256sum /mnt/aienos/EFI/BOOT/BOOTAA64.EFI | cut -d' ' -f1)\" = ${sha} +sudo mkdir -p /boot/firmware/aienos/overlays +for f in RPI_EFI.fd RPI_NV0.bin RPI_NV1.bin bcm2712-rpi-5-b.dtb overlays/bcm2712d0.dtbo; do + if ! cmp -s /mnt/aienos/\$f /boot/firmware/aienos/\$f; then sudo cp /mnt/aienos/\$f /boot/firmware/aienos/\$f; fi +done +test -e /boot/firmware/aienos/overlays/README || echo 'AIENOS-PI5 tryboot overlays (only bcm2712d0)' | sudo tee /boot/firmware/aienos/overlays/README >/dev/null +sync +echo card+stick ready" 2>&1 | tee -a "${runs}/run.log" + +# ---- optional: KLOG slot for a kernel run (KLOG=1) ---- +# A 2 MiB contiguous file on the card plus \EFI\AIENOS\KLOG.MAP naming its +# absolute first sector and a fresh nonce (aienos core/klog_slot.h). The raw +# card sector is read back and compared before the map is written, so the +# kernel is never told a position that is not the file. +if [[ "${KLOG:-0}" == 1 ]]; then + . "$(dirname "$0")/klog-lib.sh" + slot_secs=4096 + ext=$(hs "set -e +sudo mount /dev/mmcblk0p1 /mnt/aienos; trap 'sudo umount /mnt/aienos' EXIT +sudo mkdir -p /mnt/aienos/EFI/AIENOS +sudo dd if=/dev/zero of=/mnt/aienos/EFI/AIENOS/KLOG.BIN bs=512 count=${slot_secs} conv=fsync status=none +sync +sudo hdparm --fibmap /mnt/aienos/EFI/AIENOS/KLOG.BIN") + echo "${ext}" >> "${runs}/run.log" + # hdparm --fibmap rows: byte_offset begin_LBA end_LBA sectors (absolute card LBAs) + rows=$(echo "${ext}" | awk '$1 ~ /^[0-9]+$/ && NF==4') + nexts=$(echo -n "${rows}" | grep -c . || true) + read -r poff klog_lba pend plen <<<"${rows}" + if [[ "${nexts}" != 1 || "${poff}" != 0 || "${plen}" != "${slot_secs}" || $((pend - klog_lba + 1)) != "${slot_secs}" ]]; then + log "KLOG.BIN is not one ${slot_secs}-sector extent (rows=${nexts} lba=${klog_lba} len=${plen}); stopping"; exit 1 + fi + nonce=$(od -An -tx1 -N16 /dev/urandom | tr -d ' \n') + klog_hdr_empty "${klog_lba}" "${slot_secs}" "${nonce}" "${runs}/klog-hdr.bin" + klog_map "${klog_lba}" "${slot_secs}" "${nonce}" "${runs}/KLOG.MAP" + scp -q -o BatchMode=yes "${runs}/klog-hdr.bin" "${runs}/KLOG.MAP" "${hub}:/tmp/" + if ! hs "set -e +sudo mount /dev/mmcblk0p1 /mnt/aienos; trap 'sudo umount /mnt/aienos' EXIT +sudo dd if=/tmp/klog-hdr.bin of=/mnt/aienos/EFI/AIENOS/KLOG.BIN bs=512 count=1 conv=notrunc,fsync status=none +sync; echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null +sudo dd if=/dev/mmcblk0 bs=512 skip=${klog_lba} count=1 iflag=direct status=none | cmp - /tmp/klog-hdr.bin +sudo cp /tmp/KLOG.MAP /mnt/aienos/EFI/AIENOS/KLOG.MAP; sync +echo klog_slot_ready" 2>&1 | tee -a "${runs}/run.log"; then :; fi + if ! grep -q klog_slot_ready "${runs}/run.log"; then log "klog slot raw read-back FAILED; stopping before any reboot"; exit 1; fi + log "klog slot lba=${klog_lba} sectors=${slot_secs} nonce=${nonce} (raw card sector matches)" +fi +if [[ "${DRY:-0}" == 1 ]]; then log "DRY=1: card prepared, stopping before any config change or reboot"; exit 0; fi + +# ---- config.txt: backup, append the tryboot-only block, check ---- +hs "sudo cp -p /boot/firmware/config.txt /boot/firmware/config.txt.pre-aienos" +hs "cat /boot/firmware/config.txt" > "${runs}/config.txt.before" +{ +cat <<BLOCK + +${mark_begin} +[tryboot] +armstub=aienos/RPI_EFI.fd +device_tree=aienos/bcm2712-rpi-5-b.dtb +overlay_prefix=aienos/overlays/ +device_tree_address=0x1f0000 +device_tree_end=0x210000 +framebuffer_depth=32 +disable_overscan=1 +usb_max_current_enable=1 +force_turbo=1 +initramfs aienos/RPI_NV0.bin,aienos/RPI_NV1.bin 0x04000000 +[all] +${mark_end} +BLOCK +} > "${runs}/block.txt" +scp -q -o BatchMode=yes "${runs}/block.txt" "${hub}:/tmp/aienos-block.txt" +hs "set -e; sudo sh -c 'cat /tmp/aienos-block.txt >> /boot/firmware/config.txt'; sync +diff /boot/firmware/config.txt.pre-aienos /boot/firmware/config.txt | grep -c '^>' " +hs "cat /boot/firmware/config.txt" > "${runs}/config.txt.during" +if ! diff <(cat "${runs}/config.txt.before" "${runs}/block.txt") "${runs}/config.txt.during" >/dev/null; then + log "config.txt is not exactly before+block: restoring and stopping" + hs "sudo cp -p /boot/firmware/config.txt.pre-aienos /boot/firmware/config.txt; sync" + exit 1 +fi +log "block appended; rebooting the hub with tryboot" +t0=$(date +%s) +hs "sudo reboot '0 tryboot'" >/dev/null 2>&1 || true + +# ---- wait: down, then back ---- +sleep 20 +down=0; back=0 +for i in $(seq 1 30); do + if ping -c1 -W3 192.168.1.192 >/dev/null 2>&1; then + [[ ${down} == 1 ]] && { back=1; break; } + else + down=1 + fi + sleep 30 +done +if [[ ${back} != 1 ]]; then + log "hub NOT back after ~15 min (down_seen=${down})" + exit 4 +fi +log "hub answers ping again after $(( $(date +%s) - t0 )) s; waiting 60 s for ssh" +sleep 60 +for i in 1 2 3 4 5; do hs true 2>/dev/null && break; sleep 60; done + +# ---- cleanup + evidence ---- +hs "set -e +tb=\$(od -An -tx1 /proc/device-tree/chosen/bootloader/tryboot | tr -d ' ') +echo tryboot_flag_now=\$tb +sudo cp -p /boot/firmware/config.txt.pre-aienos /boot/firmware/config.txt; sync +grep -qF 'AIENOS-PI5 one-shot' /boot/firmware/config.txt && echo BLOCK_STILL_THERE || echo block_removed +uptime" 2>&1 | tee -a "${runs}/run.log" +hs "cat /boot/firmware/config.txt" > "${runs}/config.txt.after" +cmp -s "${runs}/config.txt.before" "${runs}/config.txt.after" && log "config.txt restored byte for byte" || log "WARNING config.txt differs from before" +hs "set -e; sudo mount -o ro /dev/mmcblk0p1 /mnt/aienos; trap 'sudo umount /mnt/aienos' EXIT +if [ -d /mnt/aienos/EFI/AIENOS ]; then sudo tar -C /mnt/aienos/EFI -cf - AIENOS; fi" > "${runs}/aienos.tar" +if [[ -s "${runs}/aienos.tar" ]]; then + tar -C "${runs}" -xf "${runs}/aienos.tar" && rm "${runs}/aienos.tar" + log "report copied: $(ls -R "${runs}/AIENOS" | tr '\n' ' ' | head -c 400)" + if [[ "${KLOG:-0}" == 1 ]]; then + if [[ -f "${runs}/AIENOS/KLOG.BIN" ]] && klog_extract "${runs}/AIENOS/KLOG.BIN" "${runs}/kernel.log" | tee -a "${runs}/run.log"; then + log "kernel log: $(wc -l < "${runs}/kernel.log") lines in ${runs}/kernel.log" + else + log "kernel log NOT written (slot still empty or missing)" + fi + fi +else + log "NO report on the card: the AIENOS image did not run or did not write" + exit 5 +fi +log "run ${tag} done"