cpus[0] -> cpus[bcpu]
-init.c:
- should while(wait() >= 0);
- not just wait();
-
proc.c:
comment at top of scheduler() should say
via longjmp back to the scheduler
int
main(void)
{
- int pid;
+ int pid, wpid;
if(open("console", O_RDWR) < 0){
mknod("console", T_DEV, 1, 1);
dup(0); // stderr
for(;;){
+ puts("init: starting sh\n");
pid = fork();
if(pid < 0){
puts("init: fork failed\n");
exec("sh", sh_args);
puts("init: exec sh failed\n");
exit();
- } else {
- wait();
}
+ while((wpid=wait()) >= 0 && wpid != pid)
+ ;
}
}