ADR-068 — Track N / N4 — EL0 net SVC + freestanding net-libctos sample
- Status: Accepted (sample + smoke Verified when serial / tests pass; product freestanding app hosting remains Verified under ADR-048/052 — do not reopen)
- Date: 2026-09-16
Context
ADR-063 locked EL0 net ABI until after link bring-up Verified. ADR-066 closed N1 (net: ok). ADR-067 closed N2 (net: ping-ok). Catalog freestanding samples exist for hello / VFS / FAT / yield (ADR-059 / ADR-061 / ADR-062).
This mile (N4) unlocks a tiny EL0 net SVC surface and a fifth freestanding sample that proves net via SVCs only. Kernel still owns virtio-net. Do not break blk/FAT/slot/N1/N2/sample greps.
Hypotheses
| ID | Option | Notes |
|---|---|---|
| H1 (chosen) | Add SYS_NET_MAC (24) + SYS_NET_PING (25). New crate user/net-libctos on FAT /netdemo. Print libctos: net-hi / libctos: net-mac / libctos: net-ok. Kernel netdemo: ok. ADR + catalog + smoke. | Minimal ABI; proves MAC read + kernel-path ICMP from EL0 without a guest driver. |
| H2 (rejected) | Expose raw Ethernet frame TX/RX buffers to EL0 this mile. | Larger surface; prefer ping-as-proof. |
| H3 (rejected) | Ship BSD sockets / TCP/UDP / DHCP/DNS product. | Locked non-goals (ADR-063). |
| H4 (rejected) | Teach EL0 to program virtio-net MMIO. | Honesty: kernel owns the NIC; SVCs only. |
| H5 (rejected) | Replace /hello or another slot. | Breaks A9 / catalog greps. |
Decision
-
SVC surface (document in syscall.md).
24net_mac—x0= user buf,x1= length (≥6). Copy 6-byte guest MAC. Return6, or0if rejected / net not ready.25net_ping— no args. Kernel does quiet ARP + ICMP echo vs SLIRP10.0.2.2(reuse N1/N2 helpers). Return0on success,u64::MAXon fail.- Unknown SVCs still park. Not sockets. Not a process ABI.
-
Sample crate.
user/net-libctos: sameaarch64-ctos-user/linker.ld/build-stdas prior samples.mainprintslibctos: net-hi, callsnet_macthenlibctos: net-mac, callsnet_ping, thenlibctos: net-ok. -
Publish.
build.rsbuilds and publishestarget/net-libctos.elf.scripts/mkfat16.py --app5writes 8.3NETDEMO. Keep/hello+/fsdemo+/fatdemo+/yldemo+ their*: okmarkers. -
Kernel probe.
src/netdemo.rsloads FAT/netdemo,ERETs vialoader::run_image_expecting(last uart len 16 forlibctos: net-ok\n). Serialnetdemo: fat/netdemo: mapped/netdemo: ok. Runs after the ADR-062 yldemo probe. Requires N1/N2 virtio-net already brought up (init_net). -
Smoke. Fail-closed greps for the new markers; preserve all existing greps (blk/fat/slot/net/ping/samples).
-
Docs. This ADR; honesty ledger evidence-only;
user/README.md; what-can-run.md; apps-today.md; track-n.md; SUMMARY; threat-model v1.43. -
Honesty. Do not claim: TCP/UDP product, BSD sockets, DHCP/DNS, Wi‑Fi, “has networking,” EL0 virtio driver, Linux/POSIX, EL0 isolated, or reopen ADR-048/052. CloudAgent HELD; tag agent-box / amd64 workstation. No self-merge (ADR-002).
Consequences
- Code:
libctos+sys.S;src/syscall.rs;src/virtio.rs(guest_mac/el0_icmp_ping);user/net-libctos/;src/netdemo.rs;build.rs;scripts/mkfat16.py;scripts/qemu-aarch64.sh;scripts/qemu-smoke.sh;src/main.rs. - Docs: this ADR + catalog / ledger / threat-model v1.43 / track-n N4.
- Follow-ups (not this PR): N3 sockets (locked); richer EL0 frame I/O only with new ADR + sponsor.