1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:45:07 +00:00

Kernel: Much improved BochsVGA (BXVGA) support.

Instead of cowboy-calling the VESA BIOS in the bootloader, find the emulator
VGA adapter by scanning the PCI bus. Then set up the desired video mode by
sending device commands.
This commit is contained in:
Andreas Kling 2019-02-06 10:17:26 +01:00
parent e9f6508ada
commit 731fc5a7c8
16 changed files with 298 additions and 114 deletions

View file

@ -6,6 +6,7 @@
#include <WindowServer/WSMessageLoop.h>
#include <WindowServer/WSWindow.h>
#include <WindowServer/WSWindowManager.h>
#include <Kernel/BochsVGADevice.h>
//#define LOG_GUI_SYSCALLS
@ -271,3 +272,22 @@ void Process::destroy_all_windows()
}
m_windows.clear();
}
DisplayInfo Process::set_video_resolution(int width, int height)
{
DisplayInfo info;
info.width = width;
info.height = height;
info.bpp = 32;
info.pitch = width * 4;
size_t framebuffer_size = width * height * 4;
if (!m_display_framebuffer_region) {
auto framebuffer_vmo = VMObject::create_framebuffer_wrapper(BochsVGADevice::the().framebuffer_address(), framebuffer_size);
m_display_framebuffer_region = allocate_region_with_vmo(LinearAddress(0xe0000000), framebuffer_size, move(framebuffer_vmo), 0, "framebuffer", true, true);
}
info.framebuffer = m_display_framebuffer_region->laddr().as_ptr();
BochsVGADevice::the().set_resolution(width, height);
return info;
}