I've been implementing the FORK system call and I am currently debugging the do_fork() function.
Code: Select all
void init()
{
pid_t pid;
if ((pid = do_fork()) == -1) panic("FORK failed");
else if (pid > 0) { while(1) printf("parent\n"); }
while(1) printf("child\n");
}
So I am asking you now if you have an idea what might be the bug. My procedure is simple: do_fork() copies the stack and creates a new context for the child. This context sets EBP to the parent's EBP and EIP to the function fork_out:
Code: Select all
fork_out:
mov eax, 0
leave
ret
thanks and best regards,
Alexander
edit: Note that I didn't implement FORK as a system call yet, I am trying to debug the do_fork() function at first.
[attachment deleted by admin]