9#ifndef MAXOS_PROCESSES_ELF_H
10#define MAXOS_PROCESSES_ELF_H
19namespace MaxOS::processes {
22 constexpr char ELF_MAGIC[4] = { 0x7F,
'E',
'L',
'F' };
71 ProcessorSpecificLow = 0xFF0,
72 ProcessorSpecificHigh = 0xFFF
141 TableProcessorSpecificLow = 0x70000000,
142 TableProcessorSpecificHigh = 0x7FFFFFFF
150 ELFExecute = (1 << 0),
173 } elf_64_program_header_t;
211 } elf_64_section_header_t;
219 uintptr_t m_elf_header_address;
221 void load_program_headers()
const;
224 explicit ELF64(uintptr_t elf_header_address);
228 [[nodiscard]]
bool is_valid()
const;
Handles the loading and parsing of 64-bit ELF files.
elf_64_header_t * header() const
Gets the header of the elf file.
static uint64_t to_vmm_flags(uint32_t type)
Converts elf flags to vmm flags.
~ELF64()
Destructor for the ELF64 class.
elf_64_program_header_t * get_program_header(size_t index) const
Gets a program header from the elf file.
void load()
Loads the elf program into memory if a valid elf file.
elf_64_section_header_t * get_section_header(size_t index) const
Gets a section header from the elf file.
bool is_valid() const
Checks if the elf file is valid for MaxOS runtime.
ELFType
The type of the ELF file (executable, shared object, etc.)
constexpr char ELF_MAGIC[4]
The expected ELF magic number at the start of the file.
ELFMachine
The target architecture of the ELF file.
ELFSectionType
The type of a section in the ELF file.
ELFProgramType
The type of a program header in the ELF file.
ELFProgramFlags
The flags of a program header in the ELF file.
ELFIdentification
The indexes of the ELF identification array.
ELFData
The data encoding of the ELF file (little-endian or big-endian)
ELFVersion
The version of the ELF file.
ELFClass
The class of the ELF file (32-bit or 64-bit)
Defines classes for memory input and output operations of various bit widths (8, 16,...
Defines a MemoryManager class for handling memory allocation and deallocation.