mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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:
@@ -278,7 +278,7 @@ build_frame_blocks(const util::counted<bootproto::mem_entry> &kmap)
|
||||
}
|
||||
|
||||
void
|
||||
fix_frame_blocks(bootproto::args *args)
|
||||
fix_frame_blocks(bootproto::args *args, paging::pager &pager)
|
||||
{
|
||||
util::counted<frame_block> &blocks = args->frame_blocks;
|
||||
|
||||
@@ -290,8 +290,7 @@ fix_frame_blocks(bootproto::args *args)
|
||||
uintptr_t addr = reinterpret_cast<uintptr_t>(blocks.pointer);
|
||||
|
||||
// Map the frame blocks to the appropriate address
|
||||
paging::map_pages(args, addr,
|
||||
bootproto::mem::bitmap_offset, pages, true, false);
|
||||
pager.map_pages(addr, bootproto::mem::bitmap_offset, pages, true, false);
|
||||
|
||||
uintptr_t offset = bootproto::mem::bitmap_offset - addr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user