[tools] Add qemu.sh options

Changes to qemu.sh:

- Now takes the -l/--log option to create the qemu log in jsix.log,
  otherwise does not ask qemu to log. (Way faster operations.)
- Remove the debug-isa-exit device when starting with the --debug flag,
  so that we can inspect panics
- Changed from 512M to 4G of ram
This commit is contained in:
Justin C. Miller
2022-01-23 19:36:53 -08:00
parent a30ef5b3dc
commit 0a07a7af01

14
qemu.sh
View File

@@ -3,9 +3,11 @@
build="$(dirname $0)/build" build="$(dirname $0)/build"
assets="$(dirname $0)/assets" assets="$(dirname $0)/assets"
debug="" debug=""
isaexit='-device isa-debug-exit,iobase=0xf4,iosize=0x04'
debugtarget="${build}/jsix.elf" debugtarget="${build}/jsix.elf"
gfx="-nographic" gfx="-nographic"
vga="-vga none" vga="-vga none"
log=""
kvm="" kvm=""
cpu="Broadwell,+pdpe1gb" cpu="Broadwell,+pdpe1gb"
smp=4 smp=4
@@ -19,6 +21,7 @@ while true; do
;; ;;
-d | --debug) -d | --debug)
debug="-s -S" debug="-s -S"
isaexit=""
shift shift
;; ;;
-g | --gfx) -g | --gfx)
@@ -38,6 +41,10 @@ while true; do
-c | --cpus) -c | --cpus)
smp=$2 smp=$2
shift 2 shift 2
;;
-l | --log)
log="-d mmu,int,guest_errors -D jsix.log"
shift
;; ;;
*) *)
if [ -d "$1" ]; then if [ -d "$1" ]; then
@@ -77,15 +84,12 @@ exec qemu-system-x86_64 \
-drive "if=pflash,format=raw,readonly,file=${assets}/ovmf/x64/ovmf_code.fd" \ -drive "if=pflash,format=raw,readonly,file=${assets}/ovmf/x64/ovmf_code.fd" \
-drive "if=pflash,format=raw,file=${build}/ovmf_vars.fd" \ -drive "if=pflash,format=raw,file=${build}/ovmf_vars.fd" \
-drive "format=raw,file=${build}/jsix.img" \ -drive "format=raw,file=${build}/jsix.img" \
-device "isa-debug-exit,iobase=0xf4,iosize=0x04" \
-monitor telnet:localhost:45454,server,nowait \ -monitor telnet:localhost:45454,server,nowait \
-serial stdio \ -serial stdio \
-serial telnet:localhost:45455,server,nowait \ -serial telnet:localhost:45455,server,nowait \
-smp "${smp}" \ -smp "${smp}" \
-m 512 \ -m 4096 \
-d mmu,int,guest_errors \
-D jsix.log \
-cpu "${cpu}" \ -cpu "${cpu}" \
-M q35 \ -M q35 \
-no-reboot \ -no-reboot \
$gfx $vga $kvm $debug $isaexit $log $gfx $vga $kvm $debug