![]() |
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_into_memory (memory::VirtualMemoryManager *vmm) const |
| 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 65 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 83 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 54 of file elf.cpp.
Referenced by get_program_header(), get_section_header(), is_valid(), and MaxOS::processes::Process::Process().
| bool ELF64::is_valid | ( | ) | const |
Checks if the elf file is valid for MaxOS runtime.
Definition at line 102 of file elf.cpp.
References MaxOS::processes::ELF_MAGIC, and header().
Referenced by load_into_memory(), and MaxOS::processes::GlobalScheduler::load_multiboot_elfs().
| void ELF64::load_into_memory | ( | memory::VirtualMemoryManager * | vmm | ) | const |
Loads the elf program into memory if a valid elf file.
| vmm | Which address space to load the elf into |
Definition at line 42 of file elf.cpp.
References is_valid().
Referenced by MaxOS::processes::Process::Process().
|
static |
Converts elf flags to vmm flags.
| type | The elf flags of the program header |
Definition at line 176 of file elf.cpp.
References MaxOS::memory::NO_EXECUTE, MaxOS::memory::PRESENT, MaxOS::memory::USER, and MaxOS::memory::WRITE.