diff --git a/Kernel/Graphics/BochsGraphicsAdapter.cpp b/Kernel/Graphics/BochsGraphicsAdapter.cpp index 0070bcff98..1fc792bb89 100644 --- a/Kernel/Graphics/BochsGraphicsAdapter.cpp +++ b/Kernel/Graphics/BochsGraphicsAdapter.cpp @@ -65,6 +65,11 @@ UNMAP_AFTER_INIT BochsGraphicsAdapter::BochsGraphicsAdapter(PCI::Address pci_add auto id = PCI::get_id(pci_address); if (id.vendor_id == 0x80ee && id.device_id == 0xbeef) m_io_required = true; + + // FIXME: Although this helps with setting the screen to work on some cases, + // we need to check we actually can access the VGA MMIO remapped ioports before + // doing the unblanking. + unblank(); set_safe_resolution(); } @@ -82,6 +87,14 @@ GraphicsDevice::Type BochsGraphicsAdapter::type() const return Type::Bochs; } +void BochsGraphicsAdapter::unblank() +{ + auto registers = map_typed_writable(m_mmio_registers); + full_memory_barrier(); + registers->vga_ioports[0] = 0x20; + full_memory_barrier(); +} + void BochsGraphicsAdapter::set_safe_resolution() { VERIFY(m_framebuffer_console); diff --git a/Kernel/Graphics/BochsGraphicsAdapter.h b/Kernel/Graphics/BochsGraphicsAdapter.h index deef1bb4ca..d9ace020a1 100644 --- a/Kernel/Graphics/BochsGraphicsAdapter.h +++ b/Kernel/Graphics/BochsGraphicsAdapter.h @@ -46,6 +46,7 @@ private: explicit BochsGraphicsAdapter(PCI::Address); void set_safe_resolution(); + void unblank(); bool validate_setup_resolution(size_t width, size_t height); u32 find_framebuffer_address();