⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

EnhancedElfLoader

Struct EnhancedElfLoader 

Source
pub struct EnhancedElfLoader { /* private fields */ }
Expand description

ELF loader for user space programs

Implementations§

Source§

impl EnhancedElfLoader

Source

pub fn new(data: Vec<u8>) -> Result<Self, KernelError>

Create a new ELF loader from file data

Source

pub fn load(&self, process: &Process) -> Result<VirtualAddress, KernelError>

Load program into memory

Source

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]

Source

pub fn entry_point(&self) -> VirtualAddress

Get entry point address

Source

pub fn requires_dynamic_linking(&self) -> bool

Check if binary requires dynamic linking

Source

pub fn interpreter(&self) -> Option<&str>

Get interpreter path if dynamic

Source

pub fn segments(&self) -> &[Elf64ProgramHeader]

Get segment information for a given type

Source

pub fn raw_data(&self) -> &[u8]

Get the raw ELF file data for segment copying.

Source

pub fn memory_size(&self) -> usize

Get total memory size needed

Auto Trait Implementations§

§

impl Freeze for EnhancedElfLoader

§

impl RefUnwindSafe for EnhancedElfLoader

§

impl Send for EnhancedElfLoader

§

impl Sync for EnhancedElfLoader

§

impl Unpin for EnhancedElfLoader

§

impl UnwindSafe for EnhancedElfLoader

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.