Fix implementation of clone and exec. Now the init process can load and execute the pci driver
This commit is contained in:
parent
b01a918556
commit
33e098c124
1 changed files with 230 additions and 75 deletions
|
|
@ -61,8 +61,11 @@ impl<'a> Elf<'a> {
|
|||
let mut context = context_lock.write();
|
||||
|
||||
// Unmap previous image and stack
|
||||
println!("Clear image");
|
||||
context.image.clear();
|
||||
println!("Drop heap");
|
||||
drop(context.heap.take());
|
||||
println!("Drop stack");
|
||||
drop(context.stack.take());
|
||||
|
||||
for segment in self.segments() {
|
||||
|
|
@ -112,6 +115,7 @@ impl<'a> Elf<'a> {
|
|||
}
|
||||
|
||||
// Go to usermode
|
||||
println!("Execute {:X}", self.entry());
|
||||
unsafe { usermode(self.entry(), arch::USER_STACK_OFFSET + arch::USER_STACK_SIZE - 256); }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue