Clean and document header files.

- Add missing doc comments to header files
- Move allocate_kernel_args to main.cpp
- Split functions out into pointer_manipulation.h
This commit is contained in:
Justin C. Miller
2020-05-10 01:42:22 -07:00
parent 9aa749e877
commit 10c8f6e4b5
11 changed files with 191 additions and 102 deletions

View File

@@ -1,15 +1,22 @@
/// \file loader.h
/// Definitions for loading the kernel into memory
#pragma once
namespace boot {
namespace loader {
/// Structure to hold information about loaded binary image.
struct loaded_elf
{
void *data;
uintptr_t vaddr;
uintptr_t entrypoint;
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);
} // namespace loader