iterating over getModule in case we have more than 1 module
This commit is contained in:
@@ -61,10 +61,18 @@ void PageFrameAllocator::init(){
|
||||
memory_map_entry = memory_map_entry->getNext();
|
||||
}
|
||||
|
||||
Multiboot::Module* mod = Multiboot::getModule(0);
|
||||
for (size_t i = 0; i < Multiboot::getModuleCount(); ++i) {
|
||||
Multiboot::Module* mod = Multiboot::getModule(i);
|
||||
if (!mod) continue;
|
||||
|
||||
mark_pageframes((uintptr_t)mod, (uintptr_t)mod + 1, false);
|
||||
mark_pageframes((uintptr_t)mod->getStartAddress(), (uintptr_t)mod->getEndAddress(), false);
|
||||
mark_pageframes((uintptr_t)mod->getStartAddress(),
|
||||
(uintptr_t)mod->getEndAddress(),
|
||||
false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//mark other known regions as unavailable
|
||||
mark_pageframes((uintptr_t)&___KERNEL_START___, (uintptr_t)&___KERNEL_END___, false);
|
||||
|
||||
Reference in New Issue
Block a user