Load a very simple ELF and launch it in usermode

This commit is contained in:
Jeremy Soller 2016-09-07 21:16:30 -06:00
parent 398838dc1b
commit 850792bbf1
11 changed files with 201 additions and 59 deletions

View file

@ -133,6 +133,9 @@ pub extern fn kmain() {
let pid = syscall::getpid();
println!("BSP: {:?}", pid);
let elf = elf::Elf::from(include_bytes!("../init/main")).expect("could not load elf");
elf.run();
/*
if let Ok(_context_lock) = context::contexts_mut().spawn(context_test) {
print!("Spawned context\n");
@ -143,7 +146,7 @@ pub extern fn kmain() {
print!("Main halt\n");
*/
loop {
unsafe { interrupt::enable_and_halt(); }
}