pub struct EnhancedElfLoader { /* private fields */ }Expand description
ELF loader for user space programs
Implementations§
Source§impl EnhancedElfLoader
impl EnhancedElfLoader
Sourcepub fn new(data: Vec<u8>) -> Result<Self, KernelError>
pub fn new(data: Vec<u8>) -> Result<Self, KernelError>
Create a new ELF loader from file data
Sourcepub fn load(&self, process: &Process) -> Result<VirtualAddress, KernelError>
pub fn load(&self, process: &Process) -> Result<VirtualAddress, KernelError>
Load program into memory
Sourcepub fn setup_args(
&self,
process: &Process,
args: &ProgramArgs,
) -> Result<(), KernelError>
pub fn setup_args( &self, process: &Process, args: &ProgramArgs, ) -> Result<(), KernelError>
Set up program arguments on stack Format on stack (growing downward): [padding for alignment] [env string N] … [env string 0] [arg string argc-1] … [arg string 0] [NULL] (envp terminator) [envp[N]] … [envp[0]] [NULL] (argv terminator) [argv[argc-1]] … [argv[0]] [argc]
Sourcepub fn entry_point(&self) -> VirtualAddress
pub fn entry_point(&self) -> VirtualAddress
Get entry point address
Sourcepub fn requires_dynamic_linking(&self) -> bool
pub fn requires_dynamic_linking(&self) -> bool
Check if binary requires dynamic linking
Sourcepub fn interpreter(&self) -> Option<&str>
pub fn interpreter(&self) -> Option<&str>
Get interpreter path if dynamic
Sourcepub fn segments(&self) -> &[Elf64ProgramHeader]
pub fn segments(&self) -> &[Elf64ProgramHeader]
Get segment information for a given type
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
Get total memory size needed