From 0cbcdb227f5c3318170235c3cd20bfdc5ada4086 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 15 May 2023 07:55:39 +0200 Subject: [PATCH] Meta: Make `SERENITY_RUN=ci` work with AArch64 This in turn enables `./Meta/serenity.sh test aarch64` and the CI scripts to work with the AArch64 port. As the RPi doesn't have a debugcon-like device, we create two serial devices. The system console, UART0 is redirected to `debug.log`, while UART1 is made available to the userspace and is used as the stdout for the test runner script. We are not yet able to run the full test suite, as the kernel panics due to some unimplemented features. Note that Qemu `master` or our patched Qemu build is required for `SystemServer` to recognize the `system_mode=self-test` parameter. --- Meta/run.sh | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/Meta/run.sh b/Meta/run.sh index 0115adc726..09a8512664 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -513,21 +513,38 @@ elif [ "$SERENITY_RUN" = "limine" ]; then elif [ "$SERENITY_RUN" = "ci" ]; then # Meta/run.sh ci: qemu in text mode echo "Running QEMU in CI" - "$SERENITY_QEMU_BIN" \ - $SERENITY_EXTRA_QEMU_ARGS \ - $SERENITY_VIRT_TECH_ARG \ - -m $SERENITY_RAM_SIZE \ - -cpu $SERENITY_QEMU_CPU \ - -d guest_errors \ - -no-reboot \ - -smp ${SERENITY_CPUS} \ - -drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk \ - -device ich9-ahci \ - -nographic \ - -display none \ - -debugcon file:debug.log \ - $SERENITY_KERNEL_AND_INITRD \ - -append "${SERENITY_KERNEL_CMDLINE}" + if [ "$SERENITY_ARCH" = "aarch64" ]; then + "$SERENITY_QEMU_BIN" \ + $SERENITY_EXTRA_QEMU_ARGS \ + $SERENITY_VIRT_TECH_ARG \ + -M raspi3b \ + -d guest_errors \ + -no-reboot \ + -drive file=${SERENITY_DISK_IMAGE},if=sd,format=raw \ + -nographic \ + -monitor none \ + -display none \ + -serial file:debug.log \ + -serial stdio \ + $SERENITY_KERNEL_AND_INITRD \ + -append "${SERENITY_KERNEL_CMDLINE}" + else + "$SERENITY_QEMU_BIN" \ + $SERENITY_EXTRA_QEMU_ARGS \ + $SERENITY_VIRT_TECH_ARG \ + -m $SERENITY_RAM_SIZE \ + -cpu $SERENITY_QEMU_CPU \ + -d guest_errors \ + -no-reboot \ + -smp ${SERENITY_CPUS} \ + -drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk \ + -device ich9-ahci \ + -nographic \ + -display none \ + -debugcon file:debug.log \ + $SERENITY_KERNEL_AND_INITRD \ + -append "${SERENITY_KERNEL_CMDLINE}" + fi else # Meta/run.sh: qemu with user networking "$SERENITY_QEMU_BIN" \