trying to get VGA fb mode to work..

This commit is contained in:
2026-07-14 00:07:50 -05:00
parent 5c7febbbf0
commit 454de8feed
17 changed files with 567 additions and 300 deletions

View File

@@ -97,12 +97,23 @@ void load_root_program(const char* path) {
void kmain(uint32_t magic, multiboot_info* mbi) {
disable_interrupts();
if (!(mbi->flags & (1 << 6))) {
vga_init(mbi->framebuffer_addr,
mbi->framebuffer_width,
mbi->framebuffer_height,
mbi->framebuffer_pitch,
mbi->framebuffer_bpp);
if (magic != 0x2BADB002) {
return;
}
// need mmap and fb info
if (!(mbi->flags & (1 << 6)) || !(mbi->flags & (1 << 12))) {
return;
}
vga_init();
return;
uint32_t mmap_virtual_addr = mbi->mmap_addr + 0xC0000000;
init_pmm((void*)mmap_virtual_addr, mbi->mmap_length);
kprintf("memory detection complete. total free memory: %dMB\n", total_free_memory() / 1024 / 1024);