trying to get VGA fb mode to work..
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user