2018-10-16 11:01:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-05-04 02:51:50 +02:00
|
|
|
[ -z "$SERENITY_QEMU_BIN" ] && SERENITY_QEMU_BIN="qemu-system-i386"
|
|
|
|
|
2019-06-16 14:05:07 +02:00
|
|
|
[ -z "$SERENITY_KERNEL_CMDLINE" ] && SERENITY_KERNEL_CMDLINE="hello"
|
2019-06-02 09:50:18 +02:00
|
|
|
|
2019-11-01 17:46:39 -05:00
|
|
|
[ -z "$SERENITY_RAM_SIZE" ] && SERENITY_RAM_SIZE=128M
|
|
|
|
|
2019-05-01 22:45:17 +03:00
|
|
|
export SDL_VIDEO_X11_DGAMOUSE=0
|
2019-03-27 13:02:29 +01:00
|
|
|
|
2019-03-11 12:43:45 +01:00
|
|
|
if [ "$1" = "b" ]; then
|
|
|
|
# ./run b: bochs
|
|
|
|
bochs -q -f .bochsrc
|
|
|
|
elif [ "$1" = "qn" ]; then
|
|
|
|
# ./run qn: qemu without network
|
2019-11-01 17:46:39 -05:00
|
|
|
$SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
|
2019-04-24 21:06:16 +02:00
|
|
|
$SERENITY_EXTRA_QEMU_ARGS \
|
2019-05-17 18:19:03 +02:00
|
|
|
-d cpu_reset,guest_errors \
|
2019-05-24 14:02:17 +02:00
|
|
|
-device VGA,vgamem_mb=64 \
|
2019-05-23 20:57:32 +02:00
|
|
|
-debugcon stdio \
|
2019-04-24 21:06:16 +02:00
|
|
|
-device e1000 \
|
2019-06-04 22:16:30 +10:00
|
|
|
-kernel kernel \
|
2019-06-16 14:05:07 +02:00
|
|
|
-append "${SERENITY_KERNEL_CMDLINE}" \
|
2019-06-02 18:58:59 +10:00
|
|
|
-hda _disk_image \
|
2019-07-12 19:28:01 +02:00
|
|
|
-soundhw pcspk \
|
|
|
|
-soundhw sb16
|
2019-03-13 03:26:01 +01:00
|
|
|
elif [ "$1" = "qtap" ]; then
|
|
|
|
# ./run qtap: qemu with tap
|
2019-11-01 17:46:39 -05:00
|
|
|
sudo $SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
|
2019-04-24 21:06:16 +02:00
|
|
|
$SERENITY_EXTRA_QEMU_ARGS \
|
2019-10-13 15:07:23 +02:00
|
|
|
-enable-kvm \
|
2019-05-17 18:19:03 +02:00
|
|
|
-d cpu_reset,guest_errors \
|
2019-05-24 14:02:17 +02:00
|
|
|
-device VGA,vgamem_mb=64 \
|
2019-05-23 20:57:32 +02:00
|
|
|
-debugcon stdio \
|
2019-04-24 21:06:16 +02:00
|
|
|
-object filter-dump,id=hue,netdev=br0,file=e1000.pcap \
|
|
|
|
-netdev tap,ifname=tap0,id=br0 \
|
|
|
|
-device e1000,netdev=br0 \
|
2019-06-04 22:16:30 +10:00
|
|
|
-kernel kernel \
|
2019-06-16 14:05:07 +02:00
|
|
|
-append "${SERENITY_KERNEL_CMDLINE}" \
|
2019-06-04 22:16:30 +10:00
|
|
|
-hda _disk_image \
|
2019-07-12 19:28:01 +02:00
|
|
|
-soundhw pcspk \
|
|
|
|
-soundhw sb16
|
2019-06-04 22:16:30 +10:00
|
|
|
elif [ "$1" = "qgrub" ]; then
|
|
|
|
# ./run qgrub: qemu with grub
|
2019-11-01 17:46:39 -05:00
|
|
|
$SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
|
2019-06-04 22:16:30 +10:00
|
|
|
$SERENITY_EXTRA_QEMU_ARGS \
|
2019-10-13 15:07:23 +02:00
|
|
|
-enable-kvm \
|
2019-06-04 22:16:30 +10:00
|
|
|
-d cpu_reset,guest_errors \
|
|
|
|
-device VGA,vgamem_mb=64 \
|
|
|
|
-debugcon stdio \
|
|
|
|
-object filter-dump,id=hue,netdev=breh,file=e1000.pcap \
|
2019-09-09 09:19:43 +02:00
|
|
|
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
|
2019-06-04 22:16:30 +10:00
|
|
|
-device e1000,netdev=breh \
|
2019-06-02 18:58:59 +10:00
|
|
|
-hda _disk_image \
|
2019-05-15 21:40:41 +02:00
|
|
|
-soundhw pcspk
|
2019-10-29 17:41:40 +02:00
|
|
|
elif [ "$1" = "qtext" ]; then
|
2019-11-01 17:46:39 -05:00
|
|
|
$SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
|
2019-10-29 17:41:40 +02:00
|
|
|
$SERENITY_EXTRA_QEMU_ARGS \
|
|
|
|
-d cpu_reset,guest_errors \
|
|
|
|
-device VGA,vgamem_mb=64 \
|
|
|
|
-debugcon stdio \
|
|
|
|
-device e1000 \
|
|
|
|
-kernel kernel \
|
|
|
|
-append "${SERENITY_KERNEL_CMDLINE} text_debug" \
|
|
|
|
-hda _disk_image \
|
|
|
|
-soundhw pcspk \
|
|
|
|
-soundhw sb16
|
2019-03-13 03:26:01 +01:00
|
|
|
else
|
|
|
|
# ./run: qemu with user networking
|
2019-11-01 17:46:39 -05:00
|
|
|
$SERENITY_QEMU_BIN -s -m $SERENITY_RAM_SIZE \
|
2019-04-24 21:06:16 +02:00
|
|
|
$SERENITY_EXTRA_QEMU_ARGS \
|
2019-10-13 15:07:23 +02:00
|
|
|
-enable-kvm \
|
2019-05-17 18:19:03 +02:00
|
|
|
-d cpu_reset,guest_errors \
|
2019-05-24 14:02:17 +02:00
|
|
|
-device VGA,vgamem_mb=64 \
|
2019-05-23 20:57:32 +02:00
|
|
|
-debugcon stdio \
|
2019-03-13 17:17:07 +01:00
|
|
|
-object filter-dump,id=hue,netdev=breh,file=e1000.pcap \
|
2019-09-09 09:19:43 +02:00
|
|
|
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
|
2019-03-13 17:17:07 +01:00
|
|
|
-device e1000,netdev=breh \
|
2019-06-04 22:16:30 +10:00
|
|
|
-kernel kernel \
|
2019-06-16 14:05:07 +02:00
|
|
|
-append "${SERENITY_KERNEL_CMDLINE}" \
|
2019-06-02 18:58:59 +10:00
|
|
|
-hda _disk_image \
|
2019-07-12 19:28:01 +02:00
|
|
|
-soundhw pcspk \
|
|
|
|
-soundhw sb16
|
2018-10-17 16:58:35 +02:00
|
|
|
fi
|
2018-10-16 11:01:38 +02:00
|
|
|
|