WIP: Exec
This commit is contained in:
parent
a490ff13ae
commit
49739d47e8
1 changed files with 23 additions and 8 deletions
|
|
@ -2,9 +2,20 @@
|
|||
|
||||
use arch::interrupt::halt;
|
||||
|
||||
use super::{convert_slice, Result};
|
||||
|
||||
pub fn exit(status: usize) -> ! {
|
||||
println!("Exit {}", status);
|
||||
loop {
|
||||
unsafe { halt() };
|
||||
}
|
||||
}
|
||||
|
||||
pub fn exec(path: &[u8], args: &[[usize; 2]]) -> Result<usize> {
|
||||
print!("Exec {:?}", ::core::str::from_utf8(path));
|
||||
for arg in args {
|
||||
print!(" {:?}", ::core::str::from_utf8(convert_slice(arg[0] as *const u8, arg[1])?));
|
||||
}
|
||||
println!("");
|
||||
Ok(0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue