pub struct ScarletAbi;
Implementations§
Source§impl ScarletAbi
impl ScarletAbi
Sourcefn setup_arguments_on_stack(
&self,
task: &mut Task,
argv: &[&str],
envp: &[&str],
initial_sp: usize,
) -> Result<(usize, usize), &'static str>
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 forargv
- Command line argumentsenvp
- Environment variablesinitial_sp
- Initial stack pointer from setup_user_stack
§Returns
Tuple of (new stack pointer, argv array pointer)
Sourcefn write_to_stack_memory(
&self,
task: &mut Task,
vaddr: usize,
data: &[u8],
) -> Result<(), &'static str>
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
Sourcefn write_string_to_stack(
&self,
task: &mut Task,
vaddr: usize,
string: &str,
) -> Result<(), &'static str>
fn write_string_to_stack( &self, task: &mut Task, vaddr: usize, string: &str, ) -> Result<(), &'static str>
Write a null-terminated string to stack memory
Sourcefn normalize_path_to_absolute_scarlet(&self, path_value: &str) -> String
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
impl AbiModule for ScarletAbi
fn name() -> &'static str
fn get_name(&self) -> String
Source§fn clone_boxed(&self) -> Box<dyn AbiModule>
fn clone_boxed(&self) -> Box<dyn AbiModule>
Clone this ABI module into a boxed trait object Read more
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>
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>
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>)
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>)
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>
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
Setup shared resources accessible across all ABIs Read more
Source§fn initialize_from_existing_handles(
&self,
_task: &mut Task,
) -> Result<(), &'static str>
fn initialize_from_existing_handles( &self, _task: &mut Task, ) -> Result<(), &'static str>
Handle conversion when switching ABIs
Source§fn get_default_cwd(&self) -> &str
fn get_default_cwd(&self) -> &str
Get default working directory for this ABI
Source§impl Clone for ScarletAbi
impl Clone for ScarletAbi
Source§fn clone(&self) -> ScarletAbi
fn clone(&self) -> ScarletAbi
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for ScarletAbi
impl Default for ScarletAbi
Source§fn default() -> ScarletAbi
fn default() -> ScarletAbi
Returns the “default value” for a type. Read more
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 Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)