feature: vbe can now display pixels to the screen 🥳
This commit is contained in:
parent
daf510687a
commit
738b285e62
@ -1,6 +1,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "commands.h"
|
||||
#include "debug.h"
|
||||
#include "kpanic.h"
|
||||
#include "memory.h"
|
||||
@ -30,22 +31,20 @@ static void init_mmap(multiboot_info_t *mbd_virt, size_t *pt_index)
|
||||
|
||||
static void init_vbe(multiboot_info_t *mbd_virt)
|
||||
{
|
||||
const uint32_t framebuffer_size = mbd_virt->framebuffer_height *
|
||||
mbd_virt->framebuffer_width *
|
||||
CEIL(mbd_virt->framebuffer_bpp, 4);
|
||||
const uint32_t framebuffer_size =
|
||||
mbd_virt->framebuffer_height * mbd_virt->framebuffer_pitch;
|
||||
uint32_t i = 0;
|
||||
for (; i < CEIL(framebuffer_size, PAGE_SIZE); i++) {
|
||||
if (i % 1024 == 0)
|
||||
page_directory[800 + i / 1024] =
|
||||
((uint32_t)vbe_page_table - HEAP_END) | 0x03;
|
||||
vbe_page_table[i % 1024] =
|
||||
((mbd_virt->framebuffer_addr + i * PAGE_SIZE) & PAGE_MASK) |
|
||||
INIT_FLAGS;
|
||||
}
|
||||
display.buff = (uint32_t *)GET_PAGE_ADDR(800 + i - 1 / 1024, 0) +
|
||||
page_directory[800] = ((uint32_t)vbe_page_table - HEAP_END) | 0x03;
|
||||
display.buff = (uint32_t *)GET_PAGE_ADDR(800, 0) +
|
||||
(mbd_virt->framebuffer_addr % PAGE_SIZE);
|
||||
display.height = mbd_virt->framebuffer_height;
|
||||
display.width = mbd_virt->framebuffer_width;
|
||||
display.pitch = mbd_virt->framebuffer_pitch;
|
||||
display.bpp = mbd_virt->framebuffer_bpp;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user