summaryrefslogtreecommitdiff
path: root/Meta/run.sh
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2023-03-08 21:18:02 +0200
committerLinus Groh <mail@linusgroh.de>2023-03-19 00:19:06 +0000
commitc66f7f2e7cb75de6a1bc0d62d688b6a58ac6b670 (patch)
tree641c294186f0a7f3fdb953fbedcf202d430a7f96 /Meta/run.sh
parentfdab8a24f588b645975e6f8883962a7bb469d119 (diff)
downloadserenity-c66f7f2e7cb75de6a1bc0d62d688b6a58ac6b670.zip
Meta: Use non-VGA VirtIO GPU variants when running on macOS
It appears that QEMU on macOS doesn't have the VirtIO GPU variants that support VGA functionality. Those variants are not especially important to us, because we don't use any kind of VGA functionality in our kernel anyway. Therefore, for macOS, we could decide to use virtio-gpu-gl-pci and virtio-gpu-pci devices instead.
Diffstat (limited to 'Meta/run.sh')
-rwxr-xr-xMeta/run.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/Meta/run.sh b/Meta/run.sh
index da3d69cd3f..ffba395508 100755
--- a/Meta/run.sh
+++ b/Meta/run.sh
@@ -200,12 +200,26 @@ fi
SERENITY_GL="${SERENITY_GL:-0}"
if [ -z "$SERENITY_QEMU_DISPLAY_DEVICE" ]; then
if [ "$SERENITY_GL" = "1" ]; then
- SERENITY_QEMU_DISPLAY_DEVICE="virtio-vga-gl "
+ # QEMU appears to not support the GL backend for VirtIO GPU variant on macOS.
+ if [ "$(uname)" = "Darwin" ]; then
+ die "SERENITY_GL is not supported since there's no GL backend on macOS"
+ else
+ SERENITY_QEMU_DISPLAY_DEVICE="virtio-vga-gl "
+ fi
+
if [ "$SERENITY_SCREENS" -gt 1 ]; then
die "SERENITY_GL and multi-monitor support cannot be setup simultaneously"
fi
elif [ "$SERENITY_SCREENS" -gt 1 ]; then
- SERENITY_QEMU_DISPLAY_DEVICE="virtio-vga,max_outputs=$SERENITY_SCREENS "
+ # QEMU appears to not support the virtio-vga VirtIO GPU variant on macOS.
+ # To ensure we can still boot on macOS with VirtIO GPU, use the virtio-gpu-pci
+ # variant, which lacks any VGA compatibility (which is not relevant for us anyway).
+ if [ "$(uname)" = "Darwin" ]; then
+ SERENITY_QEMU_DISPLAY_DEVICE="virtio-gpu-pci,max_outputs=$SERENITY_SCREENS "
+ else
+ SERENITY_QEMU_DISPLAY_DEVICE="virtio-vga,max_outputs=$SERENITY_SCREENS "
+ fi
+
# QEMU appears to always relay absolute mouse coordinates relative to the screen that the mouse is
# pointed to, without any way for us to know what screen it was. So, when dealing with multiple
# displays force using relative coordinates only