kernel/run.sh

35 lines
838 B
Bash
Executable File

#!/bin/bash
# This file is part of noxos and licensed under the MIT open source license
EMUFLAGS="-no-reboot -machine type=q35,accel=kvm -cpu max -m 256M \
-drive file=build/noxos.iso \
-chardev stdio,id=log,logfile=noxos.log -serial chardev:log"
emulate_bios() {
echo "<=====| Emulating |=====>"
qemu-system-x86_64 $EMUFLAGS
}
emulate_uefi() {
echo "<=====| Emulating in UEFI mode |=====>"
qemu-system-x86_64 -bios /usr/share/ovmf/x64/OVMF.fd $EMUFLAGS
}
# qemu will wait for gdb to connect, before booting
emulate_debug() {
echo "<=====| Emulating in debug mode |=====>"
qemu-system-x86_64 -s -S -bios /usr/share/ovmf/x64/OVMF.fd $EMUFLAGS
}
case $1 in
"debug")
emulate_debug
;;
"bios")
emulate_bios
;;
*)
emulate_uefi
;;
esac