--- Gnu-Mach/kern/bootstrap.c 2020/09/02 04:47:23 1.1.1.5 +++ Gnu-Mach/kern/bootstrap.c 2020/09/02 04:49:48 1.1.1.6 @@ -719,13 +719,14 @@ boot_script_exec_cmd (void *hook, task_t thread_t thread; struct user_bootstrap_info info = { mod, argv, 0, }; simple_lock_init (&info.lock); - simple_lock (&info.lock); err = thread_create ((task_t)task, &thread); assert(err == 0); + simple_lock (&info.lock); thread->saved.other = &info; thread_start (thread, user_bootstrap); - thread_resume (thread); + err = thread_resume (thread); + assert(err == 0); /* We need to synchronize with the new thread and block this main thread until it has finished referring to our local state. */ @@ -734,6 +735,8 @@ boot_script_exec_cmd (void *hook, task_t thread_sleep ((event_t) &info, simple_lock_addr(info.lock), FALSE); simple_lock (&info.lock); } + simple_unlock (&info.lock); + thread_deallocate (thread); printf ("\n"); } @@ -768,6 +771,7 @@ static void user_bootstrap(void) simple_lock (&info->lock); assert (!info->done); info->done = 1; + simple_unlock (&info->lock); thread_wakeup ((event_t) info); /* @@ -820,10 +824,18 @@ boot_script_task_resume (struct cmd *cmd int boot_script_prompt_task_resume (struct cmd *cmd) { +#if ! MACH_KDB char xx[5]; +#endif + + printf ("Pausing for %s...\n", cmd->path); - printf ("Hit return to resume %s...", cmd->path); +#if ! MACH_KDB + printf ("Hit to resume bootstrap."); safe_gets (xx, sizeof xx); +#else + SoftDebugger("Hit `c' to resume bootstrap."); +#endif return boot_script_task_resume (cmd); } @@ -833,6 +845,7 @@ boot_script_free_task (task_t task, int { if (aborting) task_terminate (task); + task_deallocate (task); } int