RustForge

foundry

Foundry OS: the operating system built on the Rustbelt kernel

foundry / root / scripts / selftest.sh
2060 bytes ยท raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# 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