wip: fork and wait are almost working (missing child's stack)
This commit is contained in:
@ -3,7 +3,15 @@
|
||||
|
||||
u16 wait(void)
|
||||
{
|
||||
if (current_task->child == NULL)
|
||||
return -1;
|
||||
cli();
|
||||
if (current_task->child->status == ZOMBIE)
|
||||
current_task->child->status = STOPPED;
|
||||
else
|
||||
current_task->status = WAIT;
|
||||
u16 child_pid = current_task->child->pid;
|
||||
toris();
|
||||
return 0;
|
||||
scheduler();
|
||||
return child_pid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user