aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/multiboot2.cc15
-rw-r--r--src/boot/multiboot2.hpp2
2 files changed, 10 insertions, 7 deletions
diff --git a/src/boot/multiboot2.cc b/src/boot/multiboot2.cc
index bac1adb..da247ad 100644
--- a/src/boot/multiboot2.cc
+++ b/src/boot/multiboot2.cc
@@ -4,13 +4,12 @@
#include "libs/stdio.hpp"
u32* mb2_find_tag(u32 *mb2_info_addr, char type){
- PAGING_MAP(mb2_info_addr);
- u32 size=(u32)mb2_info_addr[0]; // Todo: check for size
- for(u64 i=0;i<size/8;i++)
- PAGING_MAP(mb2_info_addr+i*4096);
+ PAGE_MAP(mb2_info_addr);
+ u32 size=(u32)VIRT(mb2_info_addr)[0]; // Todo: check for size
+ PAGE_RMAP(mb2_info_addr, size);
- char *location=((char*)mb2_info_addr)+8; // Goto first tag
- char *start=(char*)mb2_info_addr;
+ char *location=((char*)VIRT(mb2_info_addr))+8; // Goto first tag
+ char *start=(char*)VIRT(mb2_info_addr);
while((location-start) < size){
// Goto next 64bit align address
@@ -23,6 +22,10 @@ u32* mb2_find_tag(u32 *mb2_info_addr, char type){
if(cur_type==type){
return (u32*)location;
}
+ if(type > 30){
+ printk("Strange multiboot infos structure...\n");
+ return 0;
+ }
location+=cur_size;
}
diff --git a/src/boot/multiboot2.hpp b/src/boot/multiboot2.hpp
index d36d593..f340269 100644
--- a/src/boot/multiboot2.hpp
+++ b/src/boot/multiboot2.hpp
@@ -16,7 +16,7 @@ typedef struct FRAMEBUFFER {
u32 height;
u8 bpp;
u8 type;
- u64 color_info_addr;
+ u8 reserved;
} __attribute__((packed)) FRAMEBUFFER;
u32* mb2_find_tag(u32 *mb2_info_addr, char type);