Compare commits
2 Commits
9c89433db5
...
c9a92819b4
Author | SHA1 | Date | |
---|---|---|---|
c9a92819b4 | |||
f75e121251 |
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
u16 fork(void)
|
u16 fork(void)
|
||||||
{
|
{
|
||||||
|
if (current_task->esp == current_task->esp0 + STACK_SIZE)
|
||||||
|
scheduler();
|
||||||
cli();
|
cli();
|
||||||
struct task *child = create_task(current_task->uid);
|
struct task *child = create_task(current_task->uid);
|
||||||
if (!child)
|
if (!child)
|
||||||
@ -16,5 +18,5 @@ u16 fork(void)
|
|||||||
asm("movl %%esp, %0" : "=m"(daddy_esp));
|
asm("movl %%esp, %0" : "=m"(daddy_esp));
|
||||||
child->esp = child->esp0 + (daddy_esp - current_task->esp0);
|
child->esp = child->esp0 + (daddy_esp - current_task->esp0);
|
||||||
toris();
|
toris();
|
||||||
return current_task == child ? 0 : child->uid;
|
return current_task == child ? 0 : child->pid;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user