Allow exec, emulate clone by pretending to be child

This commit is contained in:
Jeremy Soller 2016-09-11 18:03:10 -06:00
parent 2fffe3ee77
commit f0431f4de1
6 changed files with 33 additions and 13 deletions

View file

@ -133,7 +133,15 @@ pub extern fn kmain() {
let pid = syscall::getpid();
println!("BSP: {:?}", pid);
context::contexts_mut().spawn(userspace_init).expect("failed to spawn userspace_init");
match context::contexts_mut().spawn(userspace_init) {
Ok(context_lock) => {
let mut context = context_lock.write();
context.blocked = false;
},
Err(err) => {
panic!("failed to spawn userspace_init: {:?}", err);
}
}
unsafe { context::switch(); }