Struct ScarletAbi

Source
pub struct ScarletAbi;

Implementations§

Source§

impl ScarletAbi

Source

fn setup_arguments_on_stack( &self, task: &mut Task, argv: &[&str], envp: &[&str], initial_sp: usize, ) -> Result<(usize, usize), &'static str>

Setup argc, argv, and envp on the user stack following Unix conventions

Standard Unix stack layout (from high to low addresses):

[high addresses]
envp strings (null-terminated)
argv strings (null-terminated)  
envp[] array (null-terminated pointer array)
argv[] array (null-terminated pointer array)
argc (integer)
[low addresses - returned stack pointer]
§Arguments
  • task - The task to set up arguments for
  • argv - Command line arguments
  • envp - Environment variables
  • initial_sp - Initial stack pointer from setup_user_stack
§Returns

Tuple of (new stack pointer, argv array pointer)

Source

fn write_to_stack_memory( &self, task: &mut Task, vaddr: usize, data: &[u8], ) -> Result<(), &'static str>

Write bytes to stack memory using virtual memory translation

Source

fn write_string_to_stack( &self, task: &mut Task, vaddr: usize, string: &str, ) -> Result<(), &'static str>

Write a null-terminated string to stack memory

Source

fn normalize_path_to_absolute_scarlet(&self, path_value: &str) -> String

Normalize path string to absolute Scarlet namespace format

This ensures all paths in PATH-like variables are absolute and in the proper Scarlet namespace format.

Trait Implementations§

Source§

impl AbiModule for ScarletAbi

Source§

fn name() -> &'static str

Source§

fn get_name(&self) -> String

Source§

fn clone_boxed(&self) -> Box<dyn AbiModule>

Clone this ABI module into a boxed trait object Read more
Source§

fn handle_syscall( &mut self, trapframe: &mut Trapframe, ) -> Result<usize, &'static str>

Source§

fn can_execute_binary( &self, file_object: &KernelObject, file_path: &str, current_abi: Option<&dyn AbiModule>, ) -> Option<u8>

Determine if a binary can be executed by this ABI and return confidence Read more
Source§

fn execute_binary( &self, file_object: &KernelObject, argv: &[&str], envp: &[&str], task: &mut Task, trapframe: &mut Trapframe, ) -> Result<(), &'static str>

Binary execution (each ABI supports its own binary format) Read more
Source§

fn normalize_env_to_scarlet(&self, envp: &mut Vec<String>)

Convert environment variables from this ABI to Scarlet canonical format (in-place) Read more
Source§

fn denormalize_env_from_scarlet(&self, envp: &mut Vec<String>)

Convert environment variables from Scarlet canonical format to this ABI’s format (in-place) Read more
Source§

fn setup_overlay_environment( &self, target_vfs: &Arc<VfsManager>, base_vfs: &Arc<VfsManager>, system_path: &str, config_path: &str, ) -> Result<(), &'static str>

Setup overlay environment for this ABI (read-only base + writable layer) Read more
Source§

fn setup_shared_resources( &self, target_vfs: &Arc<VfsManager>, base_vfs: &Arc<VfsManager>, ) -> Result<(), &'static str>

Setup shared resources accessible across all ABIs Read more
Source§

fn initialize_from_existing_handles( &self, _task: &mut Task, ) -> Result<(), &'static str>

Handle conversion when switching ABIs
Source§

fn get_default_cwd(&self) -> &str

Get default working directory for this ABI
Source§

impl Clone for ScarletAbi

Source§

fn clone(&self) -> ScarletAbi

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ScarletAbi

Source§

fn default() -> ScarletAbi

Returns the “default value” for a type. Read more
Source§

impl Copy for ScarletAbi

Auto Trait Implementations§

§

impl Freeze for ScarletAbi

§

impl RefUnwindSafe for ScarletAbi

§

impl Send for ScarletAbi

§

impl Sync for ScarletAbi

§

impl Unpin for ScarletAbi

§

impl UnwindSafe for ScarletAbi

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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.