PrOSess/run.sh

19 lines
635 B
Bash
Executable file

#!/bin/sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
bear --output "$SCRIPT_DIR/compile_commands.json" -- make -C "$SCRIPT_DIR/kernel" all || exit 1
mkdir -p "$SCRIPT_DIR/testenv/dist"
cp "$SCRIPT_DIR/kernel/output/kernel.iso" "$SCRIPT_DIR/testenv/dist/kernel.iso"
if [ ! -f "$SCRIPT_DIR/testenv/image_file" ]; then
truncate -s 64M "$SCRIPT_DIR/testenv/image_file"
fi
cd "$SCRIPT_DIR/testenv" || exit 1
CPU="-cpu Opteron_G1-v1,pdpe1gb=on"
if [ "$1" = "debug" ]; then
qemu-system-x86_64 -nodefaults -readconfig qemuConfig.cfg $CPU -s -S -daemonize
else
qemu-system-x86_64 -nodefaults -readconfig qemuConfig.cfg $CPU
fi