1 2 #include <stdio.h> 3 #include <syscall.h> 4 int main(int argc,const char * argv[])5main(int argc, const char *argv[]) 6 { 7 uint64_t status; 8 9 fputs("Init spawning shell\n", stdout); 10 11 const char *args[] = { "/bin/shell", NULL }; 12 status = OSSpawn("/bin/shell", &args[0]); 13 if (status > 100) { 14 printf("init: Could not spawn shell %016lx\n", status); 15 } 16 17 #if 0 18 while (1) { 19 status = OSWait(0); 20 printf("init: Zombie process exited (%016lx)\n", status); 21 } 22 #else 23 for (;;) 24 ; 25 #endif 26 } 27 28