Commit graph

150 commits

Author SHA1 Message Date
Jelle Raaijmakers 2e3bff7ab1 Meta: Re-add boot drive to aarch64 run configuration
This broke in c2e24a2fa1 where the boot
drive was removed from `SERENITY_MACHINE`. We now add the boot drive to
the common Qemu arguments, so it gets included in the aarch64 run
configuration as well.
2023-06-08 14:43:14 +02:00
Jelle Raaijmakers c2e24a2fa1 Meta: Use SERENITY_BOOT_DRIVE for aarch64 as well 2023-06-06 06:44:05 -07:00
Jelle Raaijmakers 210e90dab8 Meta: Enable NVME by default
This results in significant performance improvements in both sequential
and random disk reading and writing.
2023-06-06 06:44:05 -07:00
Daniel Bertalan 0cbcdb227f 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.
2023-05-17 01:32:43 -06:00
Tim Schumacher 7ab0de9190 Meta: Only enable the SPICE server when using the SPICE display
Newer versions of QEMU prevent the user from running a GL-rendered
display while a SPICE display is active due to incompatibilities.

Since there is no way to disable QEMUs (apparently implicit) SPICE
display, make sure that we only enable SPICE support if the user
requested running with SPICE specifically. In this case, QEMU picks the
default SPICE client instead of rendering a display using whatever our
default on that platform would be.
2023-05-17 08:53:57 +02:00
Tim Schumacher 9ab598af49 Revert "Kernel/x86: Bake the Prekernel and the Kernel into one image"
Some hardware/software configurations crash KVM as soon as we try to
start Serenity. The exact cause is currently unknown, so just fully
revert it for now.

This reverts commit 897c4e5145.
2023-04-28 23:24:19 +02:00
Liav A 897c4e5145 Kernel/x86: Bake the Prekernel and the Kernel into one image
The new baked image is a Prekernel and a Kernel baked together now, so
essentially we no longer need to pass the Prekernel as -kernel and the
actual  kernel image as -initrd to QEMU, leaving the option to pass an
actual initrd or initramfs module later on with multiboot.
2023-04-28 09:23:30 +02:00
Liav A 9f217222b7 Meta: Run the QEMU ISA-PC machine with a 64-bit capable CPU
When we had 32 bit support in the OS kernel and userland, the very bare
minimum CPU we supported was Pentium 3, but now the CPU is just required
to support x86-64 long mode to be supported, so the exact model is not
very important.

I chose the QEMU64 virtual CPU model, because the whole concept of the
QEMU ISA-PC machine is that it checks how the kernel handles arbitrarily
old hardware setup.
2023-04-09 10:25:20 +02:00
Andrew Kaster 875c3d109f Meta: Check if SERENITY_USE_SDCARD is set before checking its value
This avoids a bash complaint for the new option
2023-04-02 13:07:31 -06:00
Marco Cutecchia f7608ba269 Meta: Add SERENITY_USE_SDCARD to boot from an SD card 2023-04-02 12:43:17 -06:00
Jelle Raaijmakers e18c87c60c Meta: Make audio hardware configurable through environment variable
The new environment variable `SERENITY_AUDIO_HARDWARE` accepts the
values `ac97` and `intelhda` (default).
2023-03-25 21:27:03 +01:00
Jelle Raaijmakers dd0a25de4d Meta: Use more aptly named variable for PC speaker configuration 2023-03-25 21:27:03 +01:00
Marco Cutecchia f3363c1088 Meta: Run aarch64 with the disk image in the SD card slot
Co-authored-by: Timon Kruiper <timonkruiper@gmail.com>
Co-authored-by: Ollrogge <nils-ollrogge@outlook.de>
2023-03-25 16:50:36 +00:00
Liav A c66f7f2e7c 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.
2023-03-19 00:19:06 +00:00
Pankaj Raghav a1f2f08764 Meta: Use the correct boot device addressing mode for NVMe devices
Commit: 2c84466ad8 ("Kernel/Storage: Introduce new boot device
addressing modes") changed the way we pass the boot device parameter.

That commit missed updating boot parameter in the run.sh script for NVMe
boot devices.
2023-03-11 13:15:00 +00:00
kleines Filmröllchen bd1cecb991 Meta: Lower QEMU DirectSound driver timer period to 2ms
10ms (the default) is ridiculous and causes all kinds of glitches if we
actually want to have a low-latency queue.
<https://gitlab.com/qemu-project/qemu/-/issues/1076#note_996636777>
suggests 2ms (and no lower than 1ms). This improves audio glitch
resistance at our current 512 sample buffer size, but going lower is
still not possible.
2023-02-26 22:27:42 +01:00
Liav A 55f17fff36 Meta: Remove i686 target 2022-12-28 11:53:41 +01:00
Nico Weber 15ce757f12 Meta: Disable gdbstub when running under HVF on macOS
Without this, `serenity.sh run` fails with

    gdbstub: current accelerator doesn't support guest debugging

on an intel mac.
2022-12-18 17:46:29 -07:00
implicitfield 9665f41979 Kernel: Ignore an invalid QEMU multiboot entry
This was introduced in the QEMU commit 8504f12 and was causing the
kernel to fail to boot on the q35 machine.

Fixes #14952.
2022-12-14 17:05:06 +00:00
Gunnar Beutner 3287aa20b1 Meta: Don't try to enable GDB support on Windows
This probably didn't work before either but the option
was silently ignored by GDB. Unfortunately 7.2.0-rc0 isn't so kind.
2022-11-15 07:27:00 -05:00
Tim Schumacher 4ee0737d10 Meta: Default to the SDL QEMU frontend on SerenityOS
We don't yet have anything else than SDL, and certainly not GTK.
2022-10-24 15:52:42 +02:00
Andrew Kaster 376425639d Meta: Force -machine pc-i440fx-7.0 when using QEMU >= 7.1
Until the root cause behind #14952 is found, this workaround should stem
the tide of users in discord asking why their system crashes on startup.
2022-10-03 09:57:45 +01:00
Liav A a40f289ee5 Meta: Add isa-vga device to ISA-PC and microvm machine types
With this device being added, we can now boot into graphics mode on
these platforms too. For ISA-PC machine this is basically the only
viable option to use, but in the future, we should remove this device
for the microvm machine type as it should allow us to determine better
options and detect them by using a given device tree blob.
2022-09-20 19:05:13 +01:00
Liav A 94e39308e3 Meta: Remove an unnecessary instance of AHCI controller in the Q35 setup
We don't need this AHCI controller to be present as we already have one
in the Q35 machine. This will help using the correct boot device in GRUB
setups later on.
2022-09-02 23:36:08 +01:00
Timon Kruiper 93cf7d42d9 Meta: Remove check for QEMU < 7.0 on aarch64 build
With the previous commit, we can now run our aarch64 kernel with QEMU
7.x :^)
2022-08-23 09:23:27 -04:00
Timon Kruiper a4dadaeb00 Meta: Disallow running with QEMU >= 7.x on aarch64 build
This is currently broken upstream, and our aarch64 Kernel only runs with
QEMU 6.x.
2022-08-17 15:44:38 +01:00
Nathan Wallace 0c0a760aad Meta+Documentation: Bump required QEMU version
This commit bumps the required QEMU version to 6.2 and updates the
version checking logic in Meta/run.sh to support checking against
major and minor version numbers instead of checking against the major
version only
2022-05-24 06:30:57 -04:00
Liav A c246d86867 Meta: Use VMWare SVGA adapter if running QEMU Q35 machine
This let us test the VMWare SVGA adapter easily. We already use the std
vga (which is compatible with bochs-display that only lacks VGA support)
on the i440FX QEMU machine so we keep testing it there too, and on the
Q35 machine we use a bochs-display device as secondary display.
2022-05-06 18:04:57 +02:00
kleines Filmröllchen a67bbf1ac4 Meta: Re-enable automatic virtualization detection on Windows
Before, we wouldn't enable virtualization on Windows anymore unless
SERENITY_VIRTUALIZATION_SUPPORT was set explicitly. As far as we know,
there's no automatic way of detecting whether WHPX is enabled or not. So
we'll just enable virtualization on Windows by default, and if that
doesn't work the user can still disable it manually with
SERENITY_VIRTUALIZATION_SUPPORT=0.
2022-04-26 22:42:38 +02:00
kleines Filmröllchen 60ff054b02 Meta: Rename SERENITY_KVM_SUPPORT -> SERENITY_VIRTUALIZATION_SUPPORT 2022-04-23 13:39:13 +02:00
kleines Filmröllchen 67d99f80b9 Meta: Use SERENITY_KVM_SUPPORT to also toggle virtualization on Windows
It's sometimes nice to turn off virtualization, even on Windows :^)
2022-04-23 13:39:13 +02:00
Tim Schumacher ec6016fa2c Meta: Allow setting a host IP address to bind to 2022-04-20 14:12:34 +02:00
Tim Schumacher 1878488c04 Meta: Commonize network device settings 2022-04-20 14:12:34 +02:00
Pankaj Raghav 820a653725 Meta: Use 4k logical and physical blocks for nvme in QEMU
4k logical blocks are better for block devices in QEMU as they align
with the underlying filesystem which typically has 4k logical blocks
such as our EXT2 filesystem.
2022-03-30 19:31:12 +03:00
Nico Weber 681fac07ed Meta: Always disable kvm on aarch64 hosts for now
run.sh builds i686 by default, and the aarch64 port of serenity
isn't very far along yet.

Without this change, `run.sh` without arguments unceremoniously
fails with:

    [0/1] cd .../serenity/Build/i686 && /usr...
          ENITY_ARCH=i686 /home/thakis/src/serenity/Meta/run.sh
    qemu-system-i386: invalid accelerator kvm

That's because /dev/kvm exists, but that's no good on a non-intel host.
2022-03-20 19:53:47 -07:00
Jakub V. Flasar 6d2c298b66 Kernel: Move aarch64 Prekernel into Kernel
As there is no need for a Prekernel on aarch64, the Prekernel code was
moved into Kernel itself. The functionality remains the same.

SERENITY_KERNEL_AND_INITRD in run.sh specifies a kernel and an inital
ramdisk to be used by the emulator. This is needed because aarch64
does not need a Prekernel and the other ones do.
2022-03-12 14:54:12 -08:00
Sahan Fernando 04849c9561 Meta: Add SERENITY_GL environment variable to run.sh 2022-03-09 14:58:48 +03:30
Jelle Raaijmakers ae2591657d Meta: Add "SerenityOS" to the QEMU window title
Just a small quality of life improvement :^)
2022-03-03 11:47:18 +01:00
Liav A 629eed3a4c Meta: Add option to run SerenityOS on a QEMU MicroVM machine
The microvm machine type is a modern tool for kernel and firmware
developers to test their software against features like FDTs, second
IOAPIC, lack of legacy devices by default, the ability of using PCIe
without using PCI x86 IO ports, etc.

We can boot into such machine but we are limited in the functionality we
support currently for this type of virtual machine.
2022-03-02 18:41:54 +01:00
Liav A 2dbbec66e4 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.
2022-03-02 18:41:54 +01:00
Sviatoslav Peleshko 9399698aaa Meta: Add "vdagent" character device for both qemu-vdagent and spicevmc
Previously we added it only if spice was available, but it's possible to
build qemu with --disable-spice --enable-spice-protocol, which provides
qemu-vdagent but no spicevmc. In such case we still configured
qemu-vdagent to use "vdagent" device, but never actually defined it, so
the qemu-vdagent was never working.
2022-02-20 20:32:22 -08:00
czapek1337 64ff8af074 Meta: Add support for the Limine bootloader 2022-02-14 11:52:07 +01:00
serenityosrocks 7371d16b03 Meta: Fix "Meta/serenity.sh run x86_64 Clang" on M1 Macs
QEMU crashes on M1 Macs when using `--accel hvf` option.

To solve this, detect the host's architecture and only add the
`--accel hvf` parameter if we are running on a "x86_64" machine.
This will allow "arm64" machines like M1 Macs to work correctly.
2022-02-07 02:25:32 +00:00
Andrew Pietila 3758dffd16 Meta: Don't override SERENITY_QEMU_DISPLAY_DEVICE if it is already set 2022-02-06 18:29:25 +00:00
Idan Horowitz fcdd56633b Meta: Set correct boot drive when running with SERENITY_NVME_ENABLE 2022-01-28 19:05:52 +02:00
Dmitry Petrov 1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
serenityosrocks 689fe7ddff Meta: Make "Meta/serenity.sh run aarch64" work on macOS 2022-01-09 12:25:23 +01:00
Liav A 168063819d Meta: Remove explicit IDE attached drive from q35 setup
Use $SERENITY_BOOT_DRIVE to determine it for us.
2022-01-07 12:35:25 +01:00
Tom 2bb32a87f9 Meta: Rename SERINITY_NVME_ENABLE variable to SERENITY_NVME_ENABLE 2022-01-01 21:05:44 +00:00
Pankaj Raghav 344cfa0db4 Meta: Enable attaching NVMe storage devices to qemu
Add an option to enable NVMe storage device as the boot
drive.

To enable NVMe support, run the following:

$ SERENITY_NVME_ENABLE=1 Meta/serenity.sh run i686 root=/dev/nvme0n1
2022-01-01 14:55:58 +01:00