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);