feat: refactored some pci code and added pretty print of classes
This commit is contained in:
58
launch-qemu.sh
Executable file
58
launch-qemu.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
ARGS=""
|
||||
KERNEL="-kernel cmake-build-debug/my-kernel.bin"
|
||||
NOHUP=0
|
||||
|
||||
function print_help() {
|
||||
cat <<EOF
|
||||
Usage: $0 [OPTION]...
|
||||
|
||||
Options:
|
||||
-h, --help Print help info
|
||||
-d, --debug Start qemu with halted cpu and GDB port 1234 open. Also print guest errors and interrupts
|
||||
-i [disk], --ide [disk] Use [disk] as a hda on an IDE bus
|
||||
-n, --nohup Run QEMU using nohup and output to /dev/null
|
||||
-m, --max-cpu Run qemu with -m max
|
||||
EOF
|
||||
}
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
key=$1
|
||||
case $key in
|
||||
-d | --debug)
|
||||
ARGS="${ARGS} -S -s -d guest_errors,int"
|
||||
shift
|
||||
;;
|
||||
-i | --ide)
|
||||
ARGS="${ARGS} -hda $2"
|
||||
shift 2
|
||||
;;
|
||||
-s | --sata)
|
||||
ARGS="${ARGS} -drive id=disk1,file=$2,if=none -device ahci,id=ahci -device ide-drive,drive=disk1,bus=ahci.0"
|
||||
shift 2
|
||||
;;
|
||||
-m | --max-cpu)
|
||||
ARGS="${ARGS} -cpu max"
|
||||
shift
|
||||
;;
|
||||
-n | --nophup)
|
||||
NOHUP=1
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Launching with args ${ARGS} ${KERNEL}"
|
||||
|
||||
if [ "$NOHUP" -gt 0 ]; then
|
||||
# shellcheck disable=SC2086
|
||||
nohup qemu-system-i386 ${ARGS} ${KERNEL} >/dev/null &
|
||||
disown
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
qemu-system-i386 ${ARGS} ${KERNEL}
|
||||
fi
|
||||
Reference in New Issue
Block a user