#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" IMAGE="${1:-$PROJECT_ROOT/build/x86_64/redbear-mini/harddrive.img}" BIOS="${OVMF_BIOS:-/usr/share/edk2/x64/OVMF_CODE.4m.fd}" RAM="${QEMU_RAM:-8192}" if [ ! -f "$IMAGE" ]; then echo "ERROR: Image not found at $IMAGE" >&2 echo " Run 'make all CONFIG_NAME=redbear-mini' first." >&2 exit 1 fi if [ ! -f "$BIOS" ]; then echo "ERROR: OVMF firmware not found at $BIOS" >&2 echo " Install edk2-ovmf or set OVMF_BIOS to the correct path." >&2 exit 1 fi exec qemu-system-x86_64 \ -m "${RAM}" \ -drive if=pflash,format=raw,readonly=on,file="$BIOS" \ -drive file="$IMAGE",format=raw \ -serial mon:stdio