Bare-metal tests (am-tests)

Bare-metal kernels that exercise the HAL and the core device set without any OS layer.

Running

cd xkernels/tests/am-tests
make run                # run all
make run TEST=u         # UART echo
make run TEST=t         # trap + interrupt routing
make run TEST=k         # keyboard (interactive PTY echo)
make run TEST=f         # float sanity

What each letter covers

LetterSubject
uUART TX, THRE interrupt, DLAB divisor
cCSR read / write / WARL masks
tTrap delegation, mret / sret, vectored mtvec
iInterrupt priority, MIE / SIE gating, global enable
aACLINT (MSWI + MTIMER + SSWI), mtimecmp, Sstc
pPLIC claim / complete, level-trigger semantics
kKeyboard — PTY-backed UART RX
fF / D extension, NaN-boxing, fcsr shifted aliases

Exit semantics

am-tests use the SiFive test finisher at 0x0010_0000:

  • Write 0x5555 → graceful exit, status 0
  • Write (code << 16) | 0x3333 → exit with code

xlib/src/stdio.c provides the xam_halt() helper that wraps this.