mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
Kernel: Make BochsVGADevice a BlockDevice and support mmapping it.
Currently you can only mmap the entire framebuffer. Using this when starting up the WindowServer gets us yet another step closer towards it moving into userspace. :^)
This commit is contained in:
parent
2dc7c5a7b0
commit
799177feda
15 changed files with 155 additions and 26 deletions
|
@ -16,7 +16,21 @@ void WindowServer_main()
|
|||
|
||||
dbgprintf("Screen is %ux%ux%ubpp\n", info.width, info.height, info.bpp);
|
||||
|
||||
WSScreen screen((dword*)info.framebuffer, info.width, info.height);
|
||||
int bxvga_fd = current->sys$open("/dev/bxvga", O_RDWR);
|
||||
ASSERT(bxvga_fd >= 0);
|
||||
|
||||
Syscall::SC_mmap_params params;
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
params.fd = bxvga_fd;
|
||||
params.prot = PROT_READ | PROT_WRITE;
|
||||
params.flags = MAP_SHARED;
|
||||
params.size = info.width * info.height * sizeof(RGBA32) * 2;
|
||||
params.offset = 0;
|
||||
kprintf("Calling sys$mmap in WS\n");
|
||||
void* framebuffer = current->sys$mmap(¶ms);
|
||||
ASSERT(framebuffer && framebuffer != (void*)-1);
|
||||
|
||||
WSScreen screen((dword*)framebuffer, info.width, info.height);
|
||||
|
||||
WSWindowManager::the();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue