[boot] Build the kernel mem map from the UEFI one

Created kernel args memory map structure, looping through UEFI's memory
map to copy and condense.

Tags: boot memory
This commit is contained in:
Justin C. Miller
2020-05-10 16:26:17 -07:00
parent 21b0b08908
commit c713f4ff6f
4 changed files with 142 additions and 4 deletions

View File

@@ -32,14 +32,38 @@ enum class mode : uint8_t {
debug
};
#pragma pack(push, 1)
struct module {
void *location;
size_t size;
mod_type type;
mod_flags flags;
}
__attribute__((packed));
enum class mem_type : uint32_t {
free,
args,
kernel,
module,
table,
acpi,
uefi_runtime,
mmio,
persistent
};
/// Structure to hold an entry in the memory map.
struct mem_entry
{
uintptr_t start;
size_t pages;
mem_type type;
uint32_t attr;
}
__attribute__((packed));
struct header {
uint32_t magic;
uint16_t version;