The problem is parent process in xv6 system doesn't enter the exit() function after waiting child to execute. I also made a change to exec() where I mapped the shared structures so that parent and child process points to same page directory (share memory). After that change I cannot close parent process properly.
I don't really know what to do, should I make changes inside wait or exit function ? I just want the program to finish normally. Console output enters the trap like when exit() doesn't exists.
if (argc == 1 && (strcmp(argv[0], "dalle") == 0)){
int pid2 = fork();
if (pid2 < 0) {
printf("dalle: neuspesno kreiranje drugog child procesa\n");
exit();
}else if (pid2 == 0) {
// pokrećemo liSa proces
char *argv2[] = {"liSa", 0};
exec("/bin/liSa", argv2);
printf("dalle: neuspesno pokretanje liSa procesa\n");
exit();
}
wait();
printf("dalle: ovde sam\n"); // never prints
exit(); // never enters
}