From 78579419442f22641368db777120d7e75cbaee94 Mon Sep 17 00:00:00 2001 From: Aleksa Vuckovic Date: Tue, 9 Aug 2022 09:05:02 +0200 Subject: map on page fault --- kernel/src/boot/multiboot2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kernel/src/boot') diff --git a/kernel/src/boot/multiboot2.c b/kernel/src/boot/multiboot2.c index 75a1f8d..9c2998f 100644 --- a/kernel/src/boot/multiboot2.c +++ b/kernel/src/boot/multiboot2.c @@ -3,6 +3,7 @@ #include #include +#include #define KERNEL_VMA 0xc0000000 @@ -20,7 +21,6 @@ void init_fb(mb2_tag_header* multiboot_bootinfo, uint32_t multiboot_magic) // skip first 8 bytes (total_size + reserved) mb2_tag_header* tag_header = (mb2_tag_header*)((char*)multiboot_bootinfo + 8 + KERNEL_VMA); - bochs_breakpoint(); while (tag_header->type != MB2_TAG_END) { // process tag_type @@ -41,4 +41,8 @@ void init_fb(mb2_tag_header* multiboot_bootinfo, uint32_t multiboot_magic) main_fb.height = tag_fb->framebuffer_height; main_fb.pitch = tag_fb->framebuffer_pitch; main_fb.bpp = tag_fb->framebuffer_bpp; + + // identity map framebuffer address + map_addr(main_fb.addr, main_fb.addr, FLAG_PRESENT + FLAG_WRITABLE + FLAG_HUGE); + map_addr(main_fb.addr + PAGE_SIZE, main_fb.addr + PAGE_SIZE, FLAG_PRESENT + FLAG_WRITABLE + FLAG_HUGE); } -- cgit v1.2.3