Kernel: Use an environment variable to set the memory size in the run script

This commit is contained in:
Conrad Pankoff 2019-06-11 21:11:31 +10:00 committed by Andreas Kling
parent f0ce0910ab
commit 8df44b476d
Notes: sideshowbarker 2024-07-19 13:38:48 +09:00

View file

@ -5,14 +5,13 @@
SERENITY_KERNEL_CMDLINE="hello" SERENITY_KERNEL_CMDLINE="hello"
export SDL_VIDEO_X11_DGAMOUSE=0 export SDL_VIDEO_X11_DGAMOUSE=0
ram_size=128
if [ "$1" = "b" ]; then if [ "$1" = "b" ]; then
# ./run b: bochs # ./run b: bochs
bochs -q -f .bochsrc bochs -q -f .bochsrc
elif [ "$1" = "qn" ]; then elif [ "$1" = "qn" ]; then
# ./run qn: qemu without network # ./run qn: qemu without network
$SERENITY_QEMU_BIN -s -m $ram_size \ $SERENITY_QEMU_BIN -s -m ${SERENITY_RAM_SIZE:-128} \
$SERENITY_EXTRA_QEMU_ARGS \ $SERENITY_EXTRA_QEMU_ARGS \
-d cpu_reset,guest_errors \ -d cpu_reset,guest_errors \
-device VGA,vgamem_mb=64 \ -device VGA,vgamem_mb=64 \
@ -23,7 +22,7 @@ elif [ "$1" = "qn" ]; then
-soundhw pcspk -soundhw pcspk
elif [ "$1" = "qtap" ]; then elif [ "$1" = "qtap" ]; then
# ./run qtap: qemu with tap # ./run qtap: qemu with tap
sudo $SERENITY_QEMU_BIN -s -m $ram_size \ sudo $SERENITY_QEMU_BIN -s -m ${SERENITY_RAM_SIZE:-128} \
$SERENITY_EXTRA_QEMU_ARGS \ $SERENITY_EXTRA_QEMU_ARGS \
-d cpu_reset,guest_errors \ -d cpu_reset,guest_errors \
-device VGA,vgamem_mb=64 \ -device VGA,vgamem_mb=64 \
@ -36,7 +35,7 @@ elif [ "$1" = "qtap" ]; then
-soundhw pcspk -soundhw pcspk
elif [ "$1" = "qgrub" ]; then elif [ "$1" = "qgrub" ]; then
# ./run qgrub: qemu with grub # ./run qgrub: qemu with grub
$SERENITY_QEMU_BIN -s -m $ram_size \ $SERENITY_QEMU_BIN -s -m ${SERENITY_RAM_SIZE:-128} \
$SERENITY_EXTRA_QEMU_ARGS \ $SERENITY_EXTRA_QEMU_ARGS \
-d cpu_reset,guest_errors \ -d cpu_reset,guest_errors \
-device VGA,vgamem_mb=64 \ -device VGA,vgamem_mb=64 \
@ -48,7 +47,7 @@ elif [ "$1" = "qgrub" ]; then
-soundhw pcspk -soundhw pcspk
else else
# ./run: qemu with user networking # ./run: qemu with user networking
$SERENITY_QEMU_BIN -s -m $ram_size \ $SERENITY_QEMU_BIN -s -m ${SERENITY_RAM_SIZE:-128} \
$SERENITY_EXTRA_QEMU_ARGS \ $SERENITY_EXTRA_QEMU_ARGS \
-d cpu_reset,guest_errors \ -d cpu_reset,guest_errors \
-device VGA,vgamem_mb=64 \ -device VGA,vgamem_mb=64 \