mirror of
https://github.com/justinian/jsix.git
synced 2025-12-11 08:54:31 -08:00
[boot] Set up initial page tables
Set up initial page tables for both the offset-mapped area and the loaded kernel code and data. * Got rid of the `loaded_elf` struct - the loader now runs after the initial PML4 is created and maps the ELF sections itself. * Copied in the `page_table` and `page_table_indices` from the kernel, still need to clean this up and extract it into shared code. * Added `page_table_cache` to the kernel args to pass along free pages that can be used for initial page tables. Tags: paging
This commit is contained in:
@@ -2,22 +2,22 @@
|
||||
/// Definitions for loading the kernel into memory
|
||||
#pragma once
|
||||
|
||||
#include <uefi/boot_services.h>
|
||||
|
||||
#include "kernel_args.h"
|
||||
|
||||
namespace boot {
|
||||
namespace loader {
|
||||
|
||||
/// Structure to hold information about loaded binary image.
|
||||
struct loaded_elf
|
||||
{
|
||||
void *data; ///< Start of the kernel in memory
|
||||
uintptr_t vaddr; ///< Virtual address to map to
|
||||
uintptr_t entrypoint; ///< (Virtual) address of the kernel entrypoint
|
||||
};
|
||||
|
||||
/// Parse and load an ELF file in memory into a loaded image.
|
||||
/// \arg data The start of the ELF file in memory
|
||||
/// \arg size The size of the ELF file in memory
|
||||
/// \returns A `loaded_elf` structure defining the loaded image
|
||||
loaded_elf load(const void *data, size_t size, uefi::boot_services *bs);
|
||||
/// \arg args The kernel args, used for modifying page tables
|
||||
/// \returns A descriptor defining the loaded image
|
||||
kernel::entrypoint load(
|
||||
const void *data, size_t size,
|
||||
kernel::args::header *args,
|
||||
uefi::boot_services *bs);
|
||||
|
||||
} // namespace loader
|
||||
} // namespace boot
|
||||
|
||||
Reference in New Issue
Block a user