make runDisk.sh and runOver9P.sh uniform

This commit is contained in:
Giacomo Tesio 2017-01-19 22:44:33 +01:00
parent 7be0dbfbed
commit 7d54956ba2
2 changed files with 19 additions and 23 deletions

View File

@ -27,9 +27,6 @@ if [ "$1" = "" ]; then
echo No disk image provided: usage: $0 path/to/disk
exit 1
fi
else
echo No disk image provided: usage: $0 path/to/disk
exit 1
fi
else
export DISK="$1"
@ -46,10 +43,14 @@ esac
#bootDisk="-device ahci,id=ahci -drive id=boot,file=$DISK,index=0,cache=writeback,if=none -device ide-drive,drive=boot,bus=ahci.0"
bootDisk="-global ide-drive.physical_block_size=4096 -drive file=$DISK,if=ide,index=0,media=disk"
if [ "$NCPU" = "" ]; then
NCPU=2
fi
cd $JEHANNE/arch/$ARCH/kern/
read -r cmd <<EOF
$kvmdo qemu-system-x86_64 -s -cpu Haswell -smp 2 -m 2048 $kvmflag \
-serial stdio \
$kvmdo qemu-system-x86_64 -s -cpu Haswell -smp $NCPU -m 2048 $kvmflag \
-no-reboot -serial mon:stdio \
--machine $machineflag \
$bootDisk \
-net nic,model=rtl8139 \
@ -61,13 +62,7 @@ $bootDisk \
EOF
# To enable qemu log:
#-no-reboot -D $JEHANNE/../qemu.log -d int,cpu_reset,in_asm \
# To wait for a gdb connection prepend to -append "waitgdb"
# then from gdb:
# (gdb) target remote :1234
# (gdb) p at=1
# now you can set your breakpoints and continue
#-D $JEHANNE/../qemu.log -d int,cpu_reset,in_asm \
echo $cmd
eval $cmd

View File

@ -6,9 +6,6 @@ if [ "$JEHANNE" = "" ]; then
echo $0 requires the shell started by ./hacking/devshell.sh
exit 1
fi
if [ "$KERNEL" = "" ]; then
KERNEL="jehanne.32bit"
fi
trap : 2
@ -37,9 +34,19 @@ if [ -f $DISK ]; then
usbDev="-drive if=none,id=usbstick,file=$DISK -usb -readconfig /usr/share/doc/qemu-system-x86/common/ich9-ehci-uhci.cfg -device usb-host,bus=usb-bus.0,hostbus=3,hostport=1 -device usb-host,bus=usb-bus.0,hostbus=3,hostport=1 -device usb-storage,bus=ehci.0,drive=usbstick "
fi
cd $JEHANNE/arch/$ARCH/kern/
if [ "$KERNDIR" = "" ]; then
KERNDIR=$JEHANNE/arch/$ARCH/kern/
fi
if [ "$KERNEL" = "" ]; then
KERNEL="jehanne.32bit"
fi
if [ "$NCPU" = "" ]; then
NCPU=4
fi
cd $KERNDIR
read -r cmd <<EOF
$kvmdo qemu-system-x86_64 -s -cpu Haswell -smp 4 -m 2048 $kvmflag \
$kvmdo qemu-system-x86_64 -s -cpu Haswell -smp $NCPU -m 2048 $kvmflag \
-no-reboot -serial mon:stdio \
--machine $machineflag \
$bootDisk \
@ -58,12 +65,6 @@ EOF
# To enable qemu log:
#-D $JEHANNE/../qemu.log -d int,cpu_reset,in_asm \
# To wait for a gdb connection prepend to -append "waitgdb"
# then from gdb:
# (gdb) target remote :1234
# (gdb) p at=1
# now you can set your breakpoints and continue
echo $cmd
eval $cmd