[USER] Load and run ELF module in userspace

This commit is contained in:
2016-11-29 09:16:04 +01:00
parent aa50bbcd0f
commit 63b3c3f2c0
11 changed files with 163 additions and 21 deletions

14
kernel/proc/exec_elf.c Normal file
View File

@@ -0,0 +1,14 @@
#include <elf.h>
#include <stdint.h>
#include <debug.h>
thread_t *exec_elf(process_t *p, void *image)
{
void *entry = load_elf(p, image);
debug("Address:%x\n", entry);
procmm_setup(p);
thread_t *th = new_thread((void *)entry, 1);
process_attach(p, th);
return th;
}