WIP: Add fork() #13

Closed
apio wants to merge 8 commits from fork into main
Showing only changes of commit 9070d17477 - Show all commits

View File

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