Repository navigation
Done
Description
Problem Statement & Context
Currently, running a full end-to-end test pass requires invoking individual kernel shell test * commands from the milo> monitor (kernel/shell/shell.cpp), or manually running individual EL0 binaries (/bin/hello, /bin/hello_musl, /bin/hello_dyn, /bin/fb_test) after entering sh or bash. Once inside milo-sh or milo-bash in EL0, there is no single test_milo command that exercises the userspace ABI, syscalls, memory management, filesystems (rootfs, tmpfs, ext2, devfs), pipes/FDs, signals/wait4, and /dev/fb0 framebuffer path in one cohesive run with clear pass/fail reporting and exit status.
Scope & Technical Touchpoints
In Scope
- Add a self-contained EL0 C test utility
user/test_milo.ccompiled with$(MUSL_CC)and packaged at/bin/test_miloinMakefile(initrds/busybox.cpioandinitrds/bash.cpio). - Exercise real EL0 syscall and subsystem behavior across:
- Process & job control:
getpid,getppid,setsid/setpgid/getpgid,clone(SIGCHLD),execve(/bin/helloand-ENOENTnegative check),wait4(WNOHANGand blocking exit status decoding). - Signals & timers:
rt_sigaction,rt_sigprocmask,kill,clock_gettime,nanosleep(short/zero interval),times,getrusage,uname,sysinfo,getrandom. - Memory & address space:
brkexpand/shrink, anonymousmmap(MAP_PRIVATE | MAP_ANONYMOUS) +mprotect+munmap, andfork()(clone) memory isolation. - File descriptors, pipes & VFS:
pipe2,dup/dup3,fcntl,ppoll/pselect6,getdents64,fstat/newfstatat/faccessat/readlinkat/getcwd/chdir, read-only check on/init.txt(-EROFS), read/write/truncate/unlink/rename on/tmp(tmpfs), and mount/geometry check on/mnt/disk(ext2when available). - TTY & framebuffer:
/dev/consoleand/dev/nullbehavior, and/dev/fb0ioctl(FBIOGET_VSCREENINFO,FBIOGET_FSCREENINFO,FBIO_FLUSH) +MAP_SHAREDmmapwhen/dev/fb0is present.
- Process & job control:
- Print structured
[PASS]/[FAIL]lines and a final summary count, exiting with0when all checks pass and non-zero (1) if any check fails.
Technical Touchpoints
user/test_milo.c(new EL0 test binary)Makefile(SRCS_C,TEST_MILO_BIN/ build rule,$(BUSYBOX_CPIO),$(BASH_CPIO))- Existing UAPI & syscall contracts in
kernel/uapi/andkernel/syscalls/(SyscallDispatcher.cpp,FileSyscalls.cpp,MemorySyscalls.cpp,ProcessSyscalls.cpp,SignalSyscalls.cpp,TimeSyscalls.cpp) - Existing
rootfs,tmpfs,ext2, anddevfs(kernel/fs/)
Out of Scope
- Modifying kernel syscall ABI numbers or rewriting existing kernel unit tests in
kernel/shell/tests/ortests/host/. - Full network stack (
virtio-netTCP/IP) or interactive GUI input (virtio-input) unless a deterministic loopback/device probe is supported without blocking stdin.
Proposed Subissues
[SUBISSUE #1]: Createuser/test_milo.ccore EL0 harness (process, signals, time/sysinfo, brk/mmap/munmap, pipe2/dup3/fcntl/ppoll) and wire/bin/test_milointoMakefileinitrd targets. (No prerequisites)[SUBISSUE #2]: Add VFS (rootfs,tmpfs,ext2), TTY (/dev/console,/dev/null), and/dev/fb0(ioctl+MAP_SHARED+ flush) checks touser/test_milo.cwith graceful skip/assert handling when optional mounts or/dev/fb0are absent. (Depends on#1)[SUBISSUE #3]: Add optional flags/non-interactive summary output and verification notes inMakefile/ docs for runningtest_miloinside QEMU shells and CI. (Depends on#1,#2)
Acceptance Criteria
-
/bin/test_milobuilds cleanly with$(MUSL_CC)(-Wall -Wextra) and is included ininitrds/busybox.cpioandinitrds/bash.cpiowhenHAS_MUSL_CCis present. - Running
test_miloinsidemilo-shormilo-bashexecutes all checks non-interactively (never hanging onstdinread), prints clear[PASS]/[FAIL]results, and exits0on full pass. - Re-running
test_milomultiple times in the same shell session leaves no zombie children, leaked FDs, or PFA frame leaks. -
make -j$(nproc) all && make -j$(nproc) qualitypasses with zero warnings and ASan/UBSan green.
Edge Cases
- Missing optional hardware/mounts:
/mnt/diskmay not be mounted if noext2block image is attached, and/dev/fb0may be absent if no framebuffer/GPU device is present;test_milomust handle those cleanly without false failures or panics. - No
stdinblocking: All reads/polls intest_milomust use pipes,/dev/null,/init.txt, orO_NONBLOCK/ zero-timeoutppollso automated runs never block waiting for interactive serial keystrokes. - Repeated invocations: Running
test_miloback-to-back in a single shell session must reap all spawned child PIDs and clean up temporary/tmptest files so subsequent runs see clean state.
Linked Subissues (TODO)
- # — [SUBISSUE feat: implement VBAR_EL1 exception vector table & synchronous exception handler #1] Core EL0 test_milo harness & initrd packaging
- # — [SUBISSUE feat: implement physical memory frame allocator (4KB page blocks)` #2] Filesystem, TTY & /dev/fb0 checks in test_milo (depends on #)
- # — [SUBISSUE feat: configure AArch64 MMU translation tables (TTBR0/TTBR1) & enable paging #3] Non-interactive summary & QEMU/CI verification for test_milo (depends on #, #)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(user): add EL0 test_milo end-to-end verification command (#220)
feat(user): add EL0 test_milo end-to-end verification command (#220) (#…