diff options
| author | Miguel <m.i@gmx.at> | 2018-08-17 21:41:21 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-17 21:41:21 +0200 |
| commit | c15925a24efe14f437d8a2699500241a58fdc8f9 (patch) | |
| tree | c0db3a7d2a4f857324735df35e9cc1f0539c5f24 /kernel/usermode.c | |
| parent | 6fd78c2ff950310d8372ec0353553cc4a5a43e72 (diff) | |
cleanup and working on fifo pipes
Diffstat (limited to 'kernel/usermode.c')
| -rw-r--r-- | kernel/usermode.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/kernel/usermode.c b/kernel/usermode.c index db4ac9f..2455ba6 100644 --- a/kernel/usermode.c +++ b/kernel/usermode.c @@ -4,6 +4,10 @@ #include "syscalls.h" #include "kmalloc.h" +#include "asm/syscall.h" +#include "asm/usermode.h" +#include "kernel/config.h" + #include "lib/logger/log.h" #include <stddef.h> @@ -22,17 +26,15 @@ void install_tss(int cpu_no){ // sys_tss.iomap = ( unsigned short ) sizeof( tss_struct ); } -void switch_to_user_mode() +// THIS IS THE FUNCTION TO BE RUN IN RING 3 // USER MODE +static void userfunc() { - asm_usermode(); + syscall(SYSCALL_EXECVE,BIN_INIT,NULL,NULL); + while(1); // we should never get here. } -char *argv_init[]={"/bin/init",NULL}; -char *env_init[]={"var1=dupa","var2=mundl",NULL}; - -// THIS WILL BE RUN IN RING 3! -void userfunc() +void switch_to_user_mode() { - syscall(SYSCALL_EXECVE,"/bin/init",argv_init,env_init); - while(1); // we should never get here. + usermode(&userfunc); } + |
