Cleanup path usage
This commit is contained in:
parent
941200b658
commit
9d879f95ed
5 changed files with 12 additions and 12 deletions
|
@ -91,13 +91,13 @@ pub fn cpu_count() -> usize {
|
|||
/// Initialize userspace by running the initfs:bin/init process
|
||||
/// This function will also set the CWD to initfs:bin and open debug: as stdio
|
||||
pub extern fn userspace_init() {
|
||||
assert_eq!(syscall::chdir(b"initfs:bin"), Ok(0));
|
||||
assert_eq!(syscall::chdir(b"initfs:"), Ok(0));
|
||||
|
||||
assert_eq!(syscall::open(b"debug:", syscall::flag::O_RDONLY).map(FileHandle::into), Ok(0));
|
||||
assert_eq!(syscall::open(b"debug:", syscall::flag::O_WRONLY).map(FileHandle::into), Ok(1));
|
||||
assert_eq!(syscall::open(b"debug:", syscall::flag::O_WRONLY).map(FileHandle::into), Ok(2));
|
||||
|
||||
syscall::exec(b"initfs:bin/init", &[]).expect("failed to execute initfs:init");
|
||||
syscall::exec(b"initfs:/bin/init", &[]).expect("failed to execute initfs:init");
|
||||
|
||||
panic!("initfs:init returned")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue