# Foundry OS self-test, boot contract v2 (milestone M3). In a headless # kernel build, /sbin/init runs `rbsh /scripts/selftest.sh` on the console; # scripts/run-headless.sh (CONTRACT=v2) checks the output against # scripts/expect-v2.txt. rbsh echoes every line with its prompt before # running it, so an expected line must never appear literally in a command. # # The drives: A: is / (ext2 root), B: the FAT32 data disk (/mnt/disk0, with # the kernel's ABI test programs in B:/bin), C: the exFAT share (/mnt/share). ver drives pwd ls A:/ ls -l A:/sbin ls -l A:/bin type A:/etc/motd grep tyler A:/etc/passwd # B:, the data disk. cd B: ls type B:/readme.txt dir bin | wc -l cat b:notes/todo.txt | grep -i EXT | wc -l # Files on A: (the root is writable now). echo first line > A:/tmp/out.txt echo second line >> /tmp/out.txt cat < /tmp/out.txt md /tmp/work copy B:/notes/todo.txt /tmp/work touch /tmp/work/empty.txt ls -l A:/tmp/work del /tmp/work/todo.txt /tmp/work/empty.txt /tmp/work # C:, the share: read the README, copy a file in, list, delete. cd C: ls -l type README.TXT copy B:/notes/todo.txt C:/todo.txt cat C:/todo.txt | grep -i ext2 md C:/made-here echo written by Foundry OS > C:/made-here/note.txt type C:/made-here/note.txt ls -l C:/ del C:/todo.txt C:/made-here/note.txt C:/made-here dir C:/ start sleep 1 wait run evil run overflow start spin start spin sysinfo wait # Networking; the 108 KB download goes to the share this time. ifconfig ping -c 3 -i 200 10.0.2.2 fetch http://10.0.2.100/ wget -o C:/seq.txt http://10.0.2.100/big cat C:/seq.txt | wc -l del C:/seq.txt host example.com httpd -n 1 -t 20 # Virtual drivers. ls -l /dev random -n 8 random -d 6 5 getty -1 /dev/hvc0 tile tile -r # The kernel's ABI test programs (on B:, found through PATH). forktest cowtest mmaptest sigtest start spin 1000 kill %1 wait kill -l threads echoserver ptytest nbtest fputest pathtest rawabi # Foundry OS's own C programs and dash. hello-musl fprobe orphan dash /scripts/dash-test.sh /bin dash /scripts/v2-test.sh nosuchprogram cd Q: cd A:/tmp pwd exit 0