diff options
Diffstat (limited to 'src/kernel/syscall')
-rw-r--r-- | src/kernel/syscall/actions/sys_exec.c | 1 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_fork.c | 5 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_wait.c | 3 | ||||
-rw-r--r-- | src/kernel/syscall/syscall.c | 1 |
4 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel/syscall/actions/sys_exec.c b/src/kernel/syscall/actions/sys_exec.c index 049d085..99c6539 100644 --- a/src/kernel/syscall/actions/sys_exec.c +++ b/src/kernel/syscall/actions/sys_exec.c @@ -1,5 +1,6 @@ #include <stdint.h> #include <tasks/process.h> +#include <io/io.h> u32 sys_exec(char *path) { diff --git a/src/kernel/syscall/actions/sys_fork.c b/src/kernel/syscall/actions/sys_fork.c index f0a5711..084659e 100644 --- a/src/kernel/syscall/actions/sys_fork.c +++ b/src/kernel/syscall/actions/sys_fork.c @@ -4,16 +4,19 @@ #include <tasks/process.h> #include <lib/lib.h> #include <system.h> +#include <io/io.h> u32 sys_fork(struct regs *r) { + cli(); struct page_directory *dir = paging_copy_user_directory(current_proc->cr3); struct process *proc = process_make_new(); proc->cr3 = dir; memcpy(&proc->registers, r, sizeof(struct regs)); proc->registers.eax = proc->pid; - proc->pid = current_proc->pid; + proc->pid = current_proc->pid + 1; + sti(); process_spawn(proc); return 0; diff --git a/src/kernel/syscall/actions/sys_wait.c b/src/kernel/syscall/actions/sys_wait.c index 7cea24f..6015b8b 100644 --- a/src/kernel/syscall/actions/sys_wait.c +++ b/src/kernel/syscall/actions/sys_wait.c @@ -1,7 +1,10 @@ +#include <stdint.h> #include <tasks/process.h> +#include <io/io.h> u32 sys_wait(u32 pid, u32 *status, u32 options) { + sti(); u32 ret; if (pid < 0) { // Wait for any process in gid to die diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c index f1ee003..a5048ef 100644 --- a/src/kernel/syscall/syscall.c +++ b/src/kernel/syscall/syscall.c @@ -40,7 +40,6 @@ void syscall_handler(struct regs *r) r->eax = location(r); else r->eax = location(r->ebx, r->ecx, r->edx, r->esi, r->edi); - sti(); } |