[boot][kernel] Replace frame allocator with bitmap-based one
The previous frame allocator involved a lot of splitting and merging linked lists and lost all information about frames while they were allocated. The new allocator is based on an array of descriptor structures and a bitmap. Each memory map region of allocatable memory becomes one or more descriptors, each mapping up to 1GiB of physical memory. The descriptors implement two levels of a bitmap tree, and have a pointer into the large contiguous bitmap to track individual pages.
This commit is contained in:
@@ -37,8 +37,8 @@ extern void __kernel_assert(const char *, unsigned, const char *);
|
||||
|
||||
/// Bootstrap the memory managers.
|
||||
void setup_pat();
|
||||
void memory_initialize_pre_ctors(kernel::args::header *kargs);
|
||||
void memory_initialize_post_ctors(kernel::args::header *kargs);
|
||||
void memory_initialize_pre_ctors(kernel::args::header &kargs);
|
||||
void memory_initialize_post_ctors(kernel::args::header &kargs);
|
||||
|
||||
using namespace kernel;
|
||||
|
||||
@@ -92,9 +92,9 @@ kernel_main(args::header *header)
|
||||
gdt_init();
|
||||
interrupts_init();
|
||||
|
||||
memory_initialize_pre_ctors(header);
|
||||
memory_initialize_pre_ctors(*header);
|
||||
run_constructors();
|
||||
memory_initialize_post_ctors(header);
|
||||
memory_initialize_post_ctors(*header);
|
||||
|
||||
for (size_t i = 0; i < header->num_modules; ++i) {
|
||||
args::module &mod = header->modules[i];
|
||||
|
||||
Reference in New Issue
Block a user