[memory] Rework memory_initialize for new loader

Created a new `memory_initialize()` function that uses the new-style
kernel args structure from the new bootloader.

Additionally:
* Fixed a hard-coded interrupt EOI address that didn't work with new
  memory locations
* Make the `page_manager::fault_handler()` automatically grant pages
  in the kernel heap

Tags: boot page fault
This commit is contained in:
Justin C. Miller
2020-05-24 16:27:48 -07:00
parent fc3d919f25
commit 35b1d37df0
6 changed files with 95 additions and 222 deletions

View File

@@ -175,8 +175,6 @@ private:
frame_allocator &m_frames;
bool m_memory_initialized;
friend class memory_bootstrap;
page_manager(const page_manager &) = delete;
};
@@ -208,10 +206,11 @@ page_table_align(T p)
return ((p - 1) & ~0x1fffffull) + 0x200000;
}
namespace kernel {
namespace args {
struct header;
}
}
/// Bootstrap the memory managers.
void memory_initialize(
uint16_t scratch_pages,
const void *memory_map,
size_t map_length,
size_t desc_length);
void memory_initialize(kernel::args::header *mem_map);