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 <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "commands.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "kpanic.h"
|
#include "kpanic.h"
|
||||||
#include "memory.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)
|
static void init_vbe(multiboot_info_t *mbd_virt)
|
||||||
{
|
{
|
||||||
const uint32_t framebuffer_size = mbd_virt->framebuffer_height *
|
const uint32_t framebuffer_size =
|
||||||
mbd_virt->framebuffer_width *
|
mbd_virt->framebuffer_height * mbd_virt->framebuffer_pitch;
|
||||||
CEIL(mbd_virt->framebuffer_bpp, 4);
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
for (; i < CEIL(framebuffer_size, PAGE_SIZE); i++) {
|
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] =
|
vbe_page_table[i % 1024] =
|
||||||
((mbd_virt->framebuffer_addr + i * PAGE_SIZE) & PAGE_MASK) |
|
((mbd_virt->framebuffer_addr + i * PAGE_SIZE) & PAGE_MASK) |
|
||||||
INIT_FLAGS;
|
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);
|
(mbd_virt->framebuffer_addr % PAGE_SIZE);
|
||||||
display.height = mbd_virt->framebuffer_height;
|
display.height = mbd_virt->framebuffer_height;
|
||||||
display.width = mbd_virt->framebuffer_width;
|
display.width = mbd_virt->framebuffer_width;
|
||||||
|
display.pitch = mbd_virt->framebuffer_pitch;
|
||||||
display.bpp = mbd_virt->framebuffer_bpp;
|
display.bpp = mbd_virt->framebuffer_bpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user