![]() |
Max OS 0.3
|
Handles the loading and parsing of 64-bit ELF files. More...
#include <elf.h>
Public Member Functions | |
| ELF64 (uintptr_t elf_header_address) | |
| Constructor for the ELF64 class. | |
| ~ELF64 () | |
| Destructor for the ELF64 class. | |
| void | load () |
| Loads the elf program into memory if a valid elf file. | |
| bool | is_valid () const |
| Checks if the elf file is valid for MaxOS runtime. | |
| elf_64_header_t * | header () const |
| Gets the header of the elf file. | |
| elf_64_program_header_t * | get_program_header (size_t index) const |
| Gets a program header from the elf file. | |
| elf_64_section_header_t * | get_section_header (size_t index) const |
| Gets a section header from the elf file. | |
Static Public Member Functions | |
| static uint64_t | to_vmm_flags (uint32_t type) |
| Converts elf flags to vmm flags. | |
|
explicit |
| elf_64_program_header_t * ELF64::get_program_header | ( | size_t | index | ) | const |
Gets a program header from the elf file.
| index | The index of the program header |
Definition at line 63 of file elf.cpp.
References header(), and MaxOS::processes::ELFHeader64::program_header_offset.
| elf_64_section_header_t * ELF64::get_section_header | ( | size_t | index | ) | const |
Gets a section header from the elf file.
| index | The index of the section header |
Definition at line 81 of file elf.cpp.
References header(), and MaxOS::processes::ELFHeader64::section_header_offset.
| elf_64_header_t * ELF64::header | ( | ) | const |
Gets the header of the elf file.
Definition at line 52 of file elf.cpp.
Referenced by get_program_header(), get_section_header(), and is_valid().
| bool ELF64::is_valid | ( | ) | const |
Checks if the elf file is valid for MaxOS runtime.
Definition at line 100 of file elf.cpp.
References MaxOS::processes::ELF_MAGIC, and header().
Referenced by load(), and MaxOS::processes::GlobalScheduler::load_multiboot_elfs().
| void ELF64::load | ( | ) |
Loads the elf program into memory if a valid elf file.
Definition at line 38 of file elf.cpp.
References is_valid().
|
static |
Converts elf flags to vmm flags.
| type | The elf flags of the program header |
Definition at line 173 of file elf.cpp.
References MaxOS::memory::NO_EXECUTE, MaxOS::memory::PRESENT, MaxOS::memory::USER, and MaxOS::memory::WRITE.