[boot] Restructure boot paging and program loading

Restructuring paging into an object that carries its page cache with it
and makes for simpler code. Program loading is also changed to not copy
the pages loaded from the file into new pages - we can impose a new
constraint that anything loaded by boot have a simple, page-aligned
layout so that we can just map the existing pages into the right
addresses. Also included are some linker script changes to help
accommodate this.
This commit is contained in:
Justin C. Miller
2023-02-05 22:02:41 -08:00
parent aba45b9b67
commit ab31825ab3
16 changed files with 406 additions and 301 deletions

View File

@@ -17,6 +17,11 @@ namespace bootproto {
}
namespace boot {
namespace paging {
class pager;
}
namespace memory {
/// Struct that represents UEFI's memory map. Contains a pointer to the map data
@@ -56,7 +61,7 @@ util::counted<bootproto::mem_entry> build_kernel_map(efi_mem_map &map);
util::counted<bootproto::frame_block> build_frame_blocks(const util::counted<bootproto::mem_entry> &kmap);
/// Map the frame allocation maps to the right spot and fix up pointers
void fix_frame_blocks(bootproto::args *args);
void fix_frame_blocks(bootproto::args *args, paging::pager &pager);
} // namespace boot
} // namespace memory