foundry
Foundry OS: the operating system built on the Rustbelt kernel
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 | #!/usr/bin/env bash
# Boot the Foundry OS image interactively on the pinned Rustbelt kernel:
# a QEMU window (or add NOGRAPHIC=1 for serial only).
# CONTRACT=v2 (default via make): only our image; init starts rbsh on the
# console and on hvc0. Writes go to a temporary overlay (snapshot) and
# are thrown away at exit; set KEEP=1 to write to the image for real.
# CONTRACT=v1: our image as disk 0 (B:), the kernel's test disks as C:,
# D:, E:, like the kernel's `cargo run`.
# The hvc0 console is on the unix socket OUT/hvc0.sock:
# socat - UNIX-CONNECT:out/hvc0.sock (v1: then `getty /dev/hvc0 &` in Foundry)
#
# Usage: scripts/run-qemu.sh IMAGE KERNEL_BOOTIMAGE KERNEL_TARGET OUT_DIR
IMAGE= IMG= KT= OUT=
display=()
snap=,snapshot=on
[ && snap=
if [; then
disks=(-drive file="",format=raw,if=virtio)
else
disks=(-drive file="",format=raw,if=virtio,snapshot=on)
for; do disks+=(-drive file="/.img",format=raw,if=virtio,snapshot=on); done
fi
[ && display=(-display none)
|