From 9070d1747710e64bfdb59eee6ca439f88f2bb05d Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 16 Oct 2022 09:58:13 +0200 Subject: [PATCH] wait before letting the fork run for now still is not working why --- kernel/src/sys/exec.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/src/sys/exec.cpp b/kernel/src/sys/exec.cpp index bf559a19..231edd40 100644 --- a/kernel/src/sys/exec.cpp +++ b/kernel/src/sys/exec.cpp @@ -32,12 +32,13 @@ void sys_fork(Context* context) child->address_space = parent->address_space.clone(); - child->regs.rsp += (2 * sizeof(uintptr_t)); + child->regs.rsp += sizeof(uintptr_t) * 2; child->regs.rax = 0; context->rax = child->id; - child->state = child->Running; + child->state = child->Sleeping; + child->task_sleep = 1000; kinfoln("fork(): parent RIP %lx, child RIP %lx, parent RSP %lx, child RSP %lx", parent->regs.rip, child->regs.rip, parent->regs.rsp, child->regs.rsp);