Skip to content

Example Apps

André Borchert edited this page Jun 14, 2026 · 5 revisions

Example Apps

Purpose

This page tracks the QEMU userspace example applications included in the OSAI initramfs. These apps prove the current EL0 C toolchain, syscall ABI, mutable filesystem surface, control-plane access, and CPU-only AI example path.

Contents

Status

The example apps are built as freestanding AArch64 ELF binaries and packaged into the VirtIO read-only initramfs under /bin.

Current QEMU gate status: done for the macOS/QEMU AArch64 target.

Included Apps

App Path Purpose Status
OSAI shell smoke /bin/osai-shell Exercises BSD-style file and directory commands: pwd, ls, mkdir, create/write, mv, rm, and rmdir. Done
Hello /bin/hello Demonstrates the freestanding C userspace toolchain and EL0 runtime integration. Done
Sysinfo /bin/sysinfo Prints OSAI/QEMU system identity and requests process, filesystem, network, and telemetry status through osctl. Done
Systest /bin/systest Exercises syscall and mutable filesystem behavior: mkdir, write, read, stat, list, rename, delete. Done
Smptest /bin/smptest Demonstrates SMP-visible process/scheduler telemetry through the control plane. Done
Nettest /bin/nettest Requests UDP/TCP/network telemetry from the queue-backed QEMU network path. Done
LSTM XOR /bin/lstm-xor Runs a CPU-only two-hidden-layer LSTM-style XOR example and emits train/run benchmark timings. Done

LSTM XOR Benchmark

/bin/lstm-xor is intentionally small and deterministic. It uses the current OSAI userspace ABI rather than a hosted libc or GPU runtime.

The app logs:

  • train_ns: monotonic nanoseconds spent in the deterministic training loop.
  • run3_avg_ns: average monotonic nanoseconds across three inference batches.
  • final_errors: final XOR error count.
  • xor solve passed predictions=0,1,1,0: correctness marker.

The benchmark is a QEMU correctness and integration benchmark only. It is not a physical-hardware performance claim.

Verification

Primary gates:

  • make qemu-smoke
  • make qemu-userspace-suite
  • make qemu-process-gate
  • make qemu-osctl-gate
  • make qemu-filesystem-gate
  • make qemu-abi-contract

Expected markers include:

  • /bin/osai-shell: commands passed pwd ls mkdir touch mv rm rmdir
  • /bin/hello: C toolchain and EL0 runtime integration passed
  • /bin/sysinfo: complete
  • /bin/systest: syscall and filesystem suite passed
  • /bin/smptest: complete
  • /bin/nettest: complete
  • /bin/lstm-xor: xor solve passed predictions=0,1,1,0

Limits

The shell app currently runs a non-interactive command smoke in QEMU. The SSH transport is planned through the existing QEMU host-forwarded network path, but a production SSH daemon and interactive terminal session are not complete yet.

These apps are QEMU-first integration fixtures. They should remain small until OSAI has a fuller userspace loader, process spawning model, and interactive service management.

Clone this wiki locally