aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/syscall/actions/sys_fork.c
diff options
context:
space:
mode:
authorMarvin Borner2020-05-07 18:10:22 +0200
committerMarvin Borner2020-05-07 18:10:22 +0200
commit4286b14839c0c4ec016d816e426660f6685ae349 (patch)
treeccfefa4313d012fb78d8252cff98d27dfd187dc8 /src/kernel/syscall/actions/sys_fork.c
parent130121dd61a9adf70d1800ceb03007275bfb589d (diff)
Fixed many bugs with wait() and fork()
This also adds many race conditions which really need to be fixed..
Diffstat (limited to 'src/kernel/syscall/actions/sys_fork.c')
-rw-r--r--src/kernel/syscall/actions/sys_fork.c5
1 files changed, 4 insertions, 1 deletions
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;