I tagged this as bare metal because this has implications on bare metal, especially in the case where a BIOS/firmware might provide no assistance for configuring PCI BAR windows at all.
I simply added the following line to the run.sh
script, in the SERENITY_COMMON_QEMU_Q35_ARGS
setting:
-bios /usr/share/qemu/qboot.rom
Trying to boot with qboot on the Q35 machine yields the following crash:
0.145 [#0 init_stage2(1:1)]: VMWare SVGA @ PCI [0000:00:01:00], 0x000000200bdff120
0.145 [#0 init_stage2(1:1)]: VMWare SVGA @ PCI [0000:00:01:00]: Accepted version 2415919106
0.145 [#0 init_stage2(1:1)]: VMWare SVGA capabilities (raw 90000002):
0.149 [#0 init_stage2(1:1)]: Rect copy
0.149 [#0 init_stage2(1:1)]: VMWare SVGA @ PCI [0000:00:01:00]: framebuffer size 2415919106 bytes, FIFO size 2415919106 bytes @ P0000000000000000
0.172 [init_stage2(1:1)]: RegionTree: Failed to allocate anywhere: size=2415923200, alignment=4096
0.183 [#0 init_stage2(1:1)]: Failed to initialize device PCI [0000:00:01:00], due to Error(errno=12)
[init_stage2(1:1)]: ASSERTION FAILED: bucket.get_buddy_bit(index) == true
[init_stage2(1:1)]: ./Kernel/Memory/PhysicalZone.cpp:110 in AK::Optional<short int> Kernel::Memory::PhysicalZone::allocate_block_impl(size_t)
[init_stage2(1:1)]: KERNEL PANIC! :^(
[init_stage2(1:1)]: Aborted
[init_stage2(1:1)]: at ./Kernel/Arch/x86_64/CPU.cpp:35 in void abort()
[init_stage2(1:1)]: Kernel + 0x000000000162869f Kernel::__panic(char const*, unsigned int, char const*) +0x16f
[init_stage2(1:1)]: Kernel + 0x0000000001629bb1 abort.localalias +0x35a
[init_stage2(1:1)]: Kernel + 0x0000000001629857 abort.localalias +0x0
[init_stage2(1:1)]: Kernel + 0x0000000000d2201e Kernel::Memory::PhysicalZone::allocate_block_impl(unsigned long) [clone .localalias] +0xdfe
[init_stage2(1:1)]: Kernel + 0x0000000000d239e5 Kernel::Memory::PhysicalZone::allocate_block(unsigned long) +0x75
[init_stage2(1:1)]: Kernel + 0x0000000000d1392d Kernel::Memory::PhysicalRegion::take_free_page() +0x15d
[init_stage2(1:1)]: Kernel + 0x0000000000ccfd1c Kernel::Memory::MemoryManager::find_free_physical_page(bool) [clone .localalias] +0x54c
[init_stage2(1:1)]: Kernel + 0x0000000000cd551c Kernel::Memory::MemoryManager::allocate_committed_physical_page(AK::Badge<Kernel::Memory::CommittedPhysicalPageSet>, Kernel::Memory::MemoryManager::ShouldZeroFill) [clone .localalias] +0x6c
[init_stage2(1:1)]: Kernel + 0x0000000000cd963c Kernel::Memory::CommittedPhysicalPageSet::take_one() +0xdc
[init_stage2(1:1)]: Kernel + 0x0000000000d9b121 Kernel::Memory::SharedFramebufferVMObject::SharedFramebufferVMObject(AK::FixedArray<AK::RefPtr<Kernel::Memory::PhysicalPage> >&&, Kernel::Memory::CommittedPhysicalPageSet, Kernel::Memory::AnonymousVMObject&) [clone .localalias] +0x4f1
[init_stage2(1:1)]: Kernel + 0x0000000000da43cc Kernel::Memory::SharedFramebufferVMObject::try_create_for_physical_range(PhysicalAddress, unsigned long) +0x37c
[init_stage2(1:1)]: Kernel + 0x0000000000360ace Kernel::DisplayConnector::allocate_framebuffer_resources(unsigned long) [clone .localalias] +0x2fe
[init_stage2(1:1)]: Kernel + 0x00000000003669f2 Kernel::DisplayConnector::after_inserting() [clone .localalias] +0xd32
[init_stage2(1:1)]: Kernel + 0x00000000003457e8 AK::ErrorOr<AK::NonnullLockRefPtr<Kernel::QEMUDisplayConnector>, AK::Error> Kernel::DeviceManagement::try_create_device<Kernel::QEMUDisplayConnector, PhysicalAddress&, unsigned long&, Kernel::Memory::TypedMapping<Kernel::BochsDisplayMMIORegisters volatile> >(PhysicalAddress&, unsigned long&, Kernel::Memory::TypedMapping<Kernel::BochsDisplayMMIORegisters volatile>&&) +0x508
[init_stage2(1:1)]: Kernel + 0x000000000033c3b6 Kernel::QEMUDisplayConnector::must_create(PhysicalAddress, unsigned long, Kernel::Memory::TypedMapping<Kernel::BochsDisplayMMIORegisters volatile>) +0x86
[init_stage2(1:1)]: Kernel + 0x00000000018f2641 Kernel::BochsGraphicsAdapter::initialize_adapter(Kernel::PCI::DeviceIdentifier const&) [clone .localalias] +0xb81
[init_stage2(1:1)]: Kernel + 0x00000000018f5d5f Kernel::BochsGraphicsAdapter::create(Kernel::PCI::DeviceIdentifier const&) +0x42f
[init_stage2(1:1)]: Kernel + 0x00000000018faeb2 Kernel::GraphicsManagement::determine_and_initialize_graphics_device(Kernel::PCI::DeviceIdentifier const&) [clone .localalias] +0x712
[init_stage2(1:1)]: Kernel + 0x000000000039ff82 AK::Function<void (Kernel::PCI::DeviceIdentifier const&)>::CallableWrapper<Kernel::GraphicsManagement::initialize()::{lambda(Kernel::PCI::DeviceIdentifier const&)#2}>::call(Kernel::PCI::DeviceIdentifier const&) +0x2c2
[init_stage2(1:1)]: Kernel + 0x0000000000037cfe Kernel::PCI::Access::fast_enumerate(AK::Function<void (Kernel::PCI::DeviceIdentifier const&)>&) const +0x9de
[init_stage2(1:1)]: Kernel + 0x000000000004eac1 Kernel::PCI::enumerate(AK::Function<void (Kernel::PCI::DeviceIdentifier const&)>) +0x71
[init_stage2(1:1)]: Kernel + 0x00000000018fde8c Kernel::GraphicsManagement::initialize() +0x66c
[init_stage2(1:1)]: Kernel + 0x00000000000034ee Kernel::init_stage2(void*) +0xa4e
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too