[task] Drop debug output for fork stacks (that's all cleared up)

This commit is contained in:
Kevin Lange 2011-04-18 15:04:27 -05:00
parent 3017ffb8e7
commit c430668e8a
2 changed files with 16 additions and 14 deletions

View File

@ -135,7 +135,7 @@ fork() {
new_task->esp = esp + (new_task->stack - current_task->stack);
new_task->ebp = ebp - (current_task->stack - new_task->stack);
}
kprintf("old: %x new: %x; end: %x %x\n", esp, new_task->esp, current_task->stack, new_task->stack);
// kprintf("old: %x new: %x; end: %x %x\n", esp, new_task->esp, current_task->stack, new_task->stack);
memcpy((void *)(new_task->stack - KERNEL_STACK_SIZE), (void *)(current_task->stack - KERNEL_STACK_SIZE), KERNEL_STACK_SIZE);
new_task->eip = eip;
__asm__ __volatile__ ("sti");

View File

@ -10,19 +10,21 @@ int main(int argc, char ** argv) {
syscall_print(x);
syscall_print("\n");
int i = syscall_getpid();
syscall_fork();
if (syscall_getpid() != i) {
syscall_print("Herp!\n");
char * bin = "/bin/echo";
char * args = "von derpington";
char * argv_[] = {
bin,
args,
0
};
syscall_execve(bin, argv_, 0);
} else {
syscall_print("Awe shucks\n");
for (int j = 0; j < 5; ++j) {
syscall_fork();
if (syscall_getpid() != i) {
syscall_print("[Forked]\n");
char * bin = "/bin/echo";
char * args = "Executed echo.";
char * argv_[] = {
bin,
args,
0
};
syscall_execve(bin, argv_, 0);
} else {
syscall_print("(hello from parent)\n");
}
}
return 0;
}