compiler/
kernel/
lib/
scripts/
seed/
sublime/
test/
acceptance/
boot/
bootstrap/
cycles/
dispatch/
loader/
kernel/
loaded.rad
513 B
machine.ras
711 B
run
1.7 KiB
mmio/
modules/
native/
packages/
pages/
runtime/
scheduling/
shared/
slots/
smp/
sync/
termination/
tests/
trap/
run
2.7 KiB
runner.rad
10.3 KiB
vim/
.gitignore
336 B
.gitsigners
112 B
CONTRIBUTING
2.1 KiB
LICENSE
1.1 KiB
Makefile
10.2 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.5 KiB
std.lib.test
551 B
test/loader/run
raw
| 1 | #!/bin/sh |
| 2 | # Build a kernel fixture and call code produced by its runtime loader. |
| 3 | set -eu |
| 4 | emulator=${RAD_EMULATOR:-emulator} |
| 5 | work=$(mktemp -d) |
| 6 | trap 'rm -rf "$work"' EXIT HUP INT TERM |
| 7 | "$emulator" -memory-size=385024 -data-size=348160 -stack-size=1024 \ |
| 8 | -run bin/radiance.rv64.dev -pkg loaded -mod test/loader/loaded.rad -entry loaded -ril "$work" |
| 9 | "$emulator" -memory-size=385024 -data-size=348160 -stack-size=1024 \ |
| 10 | -run bin/radiance.rv64.dev -pkg loaded -mod test/loader/loaded.rad -entry loaded -o "$work/hosted.rv64" |
| 11 | status=0 |
| 12 | "$emulator" -run "$work/hosted.rv64" || status=$? |
| 13 | test "$status" -eq 43 |
| 14 | cat kernel/kernel.rad > "$work/kernel.rad" |
| 15 | printf '\nexport mod loadinput;\nexport mod loadcheck;\n' >> "$work/kernel.rad" |
| 16 | mkdir "$work/kernel" |
| 17 | cp kernel/kernel/*.rad "$work/kernel/" |
| 18 | cp test/loader/kernel/loadcheck.rad "$work/kernel/" |
| 19 | length=$(wc -c < "$work/loaded.ril") |
| 20 | printf '//! Binary package used by both execution paths.\n/// Complete trusted binary RIL input.\nexport static INPUT: [u8; %s] = [\n' "$length" > "$work/kernel/loadinput.rad" |
| 21 | od -An -v -tu1 "$work/loaded.ril" | awk '{ for (i = 1; i <= NF; i++) printf "%s,", $i; print "" }' >> "$work/kernel/loadinput.rad" |
| 22 | printf '];\n' >> "$work/kernel/loadinput.rad" |
| 23 | sh test/acceptance/compile "$emulator" "$work" |
| 24 | cat test/loader/machine.ras kernel/kernel/*.ras > "$work/loader.ras" |
| 25 | "$emulator" -memory-size=385024 -data-size=348160 -stack-size=1024 \ |
| 26 | -run bin/kernel.build.rv64 -- "$work/std.ril" "$work/kernel.ril" "$work/loader.ras" "$work/loader.rv64" |
| 27 | "$emulator" -machine -memory-size=262144 -max-steps=200000000 -run "$work/loader.rv64" |
| 28 | printf 'runtime loader: hosted and loaded entries agree after workspace release\n' |