[USER] Init libc with arguments and environment

MESS - execve - Clean up and move earlier
This commit is contained in:
2017-02-13 10:24:01 +01:00
parent 8d1e693884
commit 1693baaf6b
9 changed files with 102 additions and 17 deletions

View File

@@ -12,6 +12,7 @@
#include <syscall.h>
#include <cpuid.h>
int kernel_execve(process_t *p, void *image, char *argv[], char *envp[]);
int kmain(uint64_t multiboot_magic, void *multiboot_data)
{
debug_init();
@@ -29,12 +30,13 @@ int kmain(uint64_t multiboot_magic, void *multiboot_data)
debug_info("Syscall enabled:%d\n", CPUID_FEATURE_SYSCALL);
process_t *p1 = process_spawn(0);
thread_t *th = exec_elf(p1, mboot_data.init);
char *args[] = {"init", "Hello, arg", "5", 0};
char *env[] = {"OS=mittos64", 0};
thread_t *th = exec_elf(p1, mboot_data.init, args, env);
scheduler_insert(th);
procmm_print_map(p1->mmap);
asm("sti");
debug_info("BOOT COMPLETE\n");
schedule();