[USER] Load and run ELF module in userspace
This commit is contained in:
14
kernel/proc/exec_elf.c
Normal file
14
kernel/proc/exec_elf.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user