diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-29 15:01:54 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-29 15:01:54 +0200 |
| commit | f37f5d86b74870e878f69bd41a3c70a59c4ce1c1 (patch) | |
| tree | 65620f0504fea111ba870457f32bc072dc27fe7a /src/boot/multiboot2.cc | |
| parent | fde8a1ab65d5e33d90123a3aaa9b5c15e249689f (diff) | |
Debug memory
Diffstat (limited to 'src/boot/multiboot2.cc')
| -rw-r--r-- | src/boot/multiboot2.cc | 15 |
1 files changed, 9 insertions, 6 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; } |
