PMM: Map the page bitmap to kernel heap once the PMM and VMM are both initialized
This commit is contained in:
parent
5d8b825659
commit
8f310dd307
@ -20,4 +20,8 @@ namespace PMM
|
|||||||
uint64_t get_free();
|
uint64_t get_free();
|
||||||
uint64_t get_used();
|
uint64_t get_used();
|
||||||
uint64_t get_reserved();
|
uint64_t get_reserved();
|
||||||
|
|
||||||
|
uint64_t get_bitmap_size();
|
||||||
|
|
||||||
|
void map_bitmap_to_virtual();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#define MODULE "init"
|
||||||
|
|
||||||
#include "init/Init.h"
|
#include "init/Init.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "bootboot.h"
|
#include "bootboot.h"
|
||||||
@ -57,6 +59,8 @@ void Init::early_init()
|
|||||||
|
|
||||||
Mersenne::init();
|
Mersenne::init();
|
||||||
|
|
||||||
|
kdbgln("Page bitmap uses %ld bytes of memory", PMM::get_bitmap_size());
|
||||||
|
|
||||||
__stack_chk_guard = Mersenne::get();
|
__stack_chk_guard = Mersenne::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ void MemoryManager::init()
|
|||||||
{
|
{
|
||||||
PMM::init();
|
PMM::init();
|
||||||
kernelVMM.init();
|
kernelVMM.init();
|
||||||
|
PMM::map_bitmap_to_virtual();
|
||||||
}
|
}
|
||||||
|
|
||||||
void* MemoryManager::get_mapping(void* physicalAddress, int flags)
|
void* MemoryManager::get_mapping(void* physicalAddress, int flags)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "bootboot.h"
|
#include "bootboot.h"
|
||||||
#include "memory/Memory.h"
|
#include "memory/Memory.h"
|
||||||
#include "memory/MemoryManager.h"
|
#include "memory/MemoryManager.h"
|
||||||
|
#include "misc/utils.h"
|
||||||
#include "std/string.h"
|
#include "std/string.h"
|
||||||
|
|
||||||
extern BOOTBOOT bootboot;
|
extern BOOTBOOT bootboot;
|
||||||
@ -170,3 +171,14 @@ uint64_t PMM::get_reserved()
|
|||||||
{
|
{
|
||||||
return reserved_mem;
|
return reserved_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t PMM::get_bitmap_size()
|
||||||
|
{
|
||||||
|
return bitmap_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PMM::map_bitmap_to_virtual()
|
||||||
|
{
|
||||||
|
virtual_bitmap_addr =
|
||||||
|
(char*)MemoryManager::get_unaligned_mappings(bitmap_addr, Utilities::get_blocks_from_size(4096, bitmap_size));
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user