From 2dbbec66e4c0f9f282425f7e6505c5defc507208 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 21 Jan 2022 16:25:38 +0200 Subject: [PATCH] Meta: Add option to run SerenityOS on a QEMU ISA-PC machine The ISA-PC machine type provides no PCI bus support, no IOAPIC support and other modern PC features of our generation. This is mainly a good environment for testing abstractions in the kernel space, and can help with improving on them for the sake of porting the OS to other chipsets and CPU architectures. --- Meta/run.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Meta/run.sh b/Meta/run.sh index 90322c9c6c..a137908f1f 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -277,6 +277,17 @@ if [ "$SERENITY_ARCH" != "aarch64" ]; then fi fi +[ -z "$SERENITY_COMMON_QEMU_ISA_PC_ARGS" ] && SERENITY_COMMON_QEMU_ISA_PC_ARGS=" +$SERENITY_EXTRA_QEMU_ARGS +-m $SERENITY_RAM_SIZE +-cpu pentium3 +-machine isapc +-d guest_errors +-chardev stdio,id=stdout,mux=on +-device isa-debugcon,chardev=stdout +$SERENITY_BOOT_DRIVE +" + [ -z "$SERENITY_COMMON_QEMU_Q35_ARGS" ] && SERENITY_COMMON_QEMU_Q35_ARGS=" $SERENITY_EXTRA_QEMU_ARGS -m $SERENITY_RAM_SIZE @@ -373,6 +384,17 @@ elif [ "$SERENITY_RUN" = "q35" ]; then -kernel Kernel/Prekernel/Prekernel \ -initrd Kernel/Kernel \ -append "${SERENITY_KERNEL_CMDLINE}" +elif [ "$SERENITY_RUN" = "isapc" ]; then + # Meta/run.sh q35: qemu (q35 chipset) with SerenityOS + echo "Starting SerenityOS with QEMU ISA-PC machine, Commandline: ${SERENITY_KERNEL_CMDLINE}" + "$SERENITY_QEMU_BIN" \ + $SERENITY_COMMON_QEMU_ISA_PC_ARGS \ + $SERENITY_VIRT_TECH_ARG \ + -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 \ + -device ne2k_isa,netdev=breh \ + -kernel Kernel/Prekernel/Prekernel \ + -initrd Kernel/Kernel \ + -append "${SERENITY_KERNEL_CMDLINE}" elif [ "$SERENITY_RUN" = "q35grub" ]; then # Meta/run.sh q35grub: qemu (q35 chipset) with SerenityOS, using a grub disk image "$SERENITY_QEMU_BIN" \