fixing a bug with fork
This commit is contained in:
parent
3cf6180196
commit
5c9ff18204
2 changed files with 6 additions and 3 deletions
|
@ -185,11 +185,11 @@ static int create_task(tid_t* id, entry_point_t ep, void* arg)
|
|||
mailbox_wait_msg_init(&task_table[i].inbox);
|
||||
memset(task_table[i].outbox, 0x00, sizeof(mailbox_wait_msg_t*)*MAX_TASKS);
|
||||
task_table[i].outbox[per_core(current_task)->id] = &per_core(current_task)->inbox;
|
||||
|
||||
task_table[i].fildes_table[0].node = findnode_fs("/dev/stdin");
|
||||
task_table[i].fildes_table[1].node = findnode_fs("/dev/stdout");
|
||||
task_table[i].fildes_table[2].node = findnode_fs("/dev/stderr");
|
||||
|
||||
|
||||
if (id)
|
||||
*id = i;
|
||||
|
||||
|
@ -257,6 +257,9 @@ int sys_fork(void)
|
|||
child = &((*child)->next);
|
||||
}
|
||||
|
||||
task_table[i].fildes_table[0].node = findnode_fs("/dev/stdin");
|
||||
task_table[i].fildes_table[1].node = findnode_fs("/dev/stdout");
|
||||
task_table[i].fildes_table[2].node = findnode_fs("/dev/stderr");
|
||||
mailbox_wait_msg_init(&task_table[i].inbox);
|
||||
memset(task_table[i].outbox, 0x00, sizeof(mailbox_wait_msg_t*)*MAX_TASKS);
|
||||
task_table[i].outbox[per_core(current_task)->id] = &per_core(current_task)->inbox;
|
||||
|
|
|
@ -119,7 +119,7 @@ static int STDCALL join_test(void* arg)
|
|||
|
||||
int test_init(void)
|
||||
{
|
||||
char* argv[] = {"/bin/hangman", NULL};
|
||||
char* argv[] = {"/bin/tests", NULL};
|
||||
|
||||
sem_init(&producing, 1);
|
||||
sem_init(&consuming, 0);
|
||||
|
@ -131,7 +131,7 @@ int test_init(void)
|
|||
//create_kernel_task(NULL, consumer, NULL);
|
||||
//create_kernel_task(NULL, ping, NULL);
|
||||
//create_user_task(NULL, "/bin/hello", argv);
|
||||
create_user_task(NULL, "/bin/hangman", argv);
|
||||
create_user_task(NULL, "/bin/tests", argv);
|
||||
//create_user_task(NULL, "/bin/jacobi", argv);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue