diff options
author | Roland McGrath <roland@gnu.org> | 1999-10-28 20:51:36 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-10-28 20:51:36 +0000 |
commit | febab894f78d6cf509544872e075c3204d35b9d6 (patch) | |
tree | 9bfe9674f675e1078c8b25f7c64ff1ef6ac1e421 /serverboot/load.c | |
parent | 1a4ef01d300a7ad85cd44f2cba7528fb2e00ebfb (diff) |
1999-10-28 Roland McGrath <roland@baalperazim.frob.com>
* file_io.h: Include <errno.h>.
(FS_* macros): Define these to equivalent errno codes.
* def_pager_setup.c (add_paging_file): Put strerror of result code in
error messages.
* bootstrap.c (parse_script): Likewise.
* load.c (boot_script_exec_cmd): Include NAMEBUF in error messages,
and use strerror to format result code.
* panic.c (panic): Use program_invocation_name in message.
Diffstat (limited to 'serverboot/load.c')
-rw-r--r-- | serverboot/load.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/serverboot/load.c b/serverboot/load.c index 3898eac6..a4f48ba3 100644 --- a/serverboot/load.c +++ b/serverboot/load.c @@ -273,7 +273,7 @@ boot_script_exec_cmd (task_t user_task, result = open_file(bootstrap_master_device_port, namebuf, &file); if (result != 0) { - panic("openi %d", result); + panic ("%s: %s", namebuf, strerror (result)); } env_len = 0; @@ -308,6 +308,7 @@ boot_script_exec_cmd (task_t user_task, st.user_task = user_task; st.aout_symtab_size = 0; st.aout_strtab_size = 0; +printf("serverboot loading %s\n", file_name); result = exec_load(prog_read, prog_read_exec, &st, &info); #ifdef GZIP if (result) @@ -360,7 +361,7 @@ boot_script_exec_cmd (task_t user_task, } #endif BZIP2 if (result) - panic("(serverboot) exec_load %s: error %d", namebuf, result); + panic ("cannot load %s: %s", namebuf, strerror (result)); #if 0 printf("(serverboot): loaded %s; entrypoint %08x\n", namebuf, info.entry); #endif @@ -370,9 +371,11 @@ boot_script_exec_cmd (task_t user_task, */ result = thread_create (user_task, &user_thread); if (result) - panic ("can't create user thread for %s: %x", namebuf, result); + panic ("can't create user thread for %s: %s", namebuf, + strerror (result)); arg_pos = set_regs(user_task, user_thread, &info, arg_len); +printf("set up user thread\n"); /* * Read symbols from the executable file. */ @@ -451,15 +454,19 @@ boot_script_exec_cmd (task_t user_task, /* * Then the strings and string pointers for each argument */ - for (i = 0; i < arg_count; i++) + for (i = 0; i < arg_count; i++) { + printf("\targv[%d] = %s\n", i, argv[i]); *k_ap++ = argv[i] - argstrings + u_cp; + } *k_ap++ = (char *)0; bcopy (argstrings, k_cp, argslen); k_cp += argslen; u_cp += argslen; - for (i = 0; i < envc; i++) + for (i = 0; i < envc; i++) { + printf("\tenviron[%d] = %s\n", i, environ[i]); *k_ap++ = environ[i] - environ[0] + u_cp; + } *k_ap = (char *)0; bcopy (environ[0], k_cp, env_len); @@ -481,6 +488,7 @@ boot_script_exec_cmd (task_t user_task, */ close_file(&file); +printf ("resume user thread...\n"); /* Resume the thread. */ thread_resume (user_thread); mach_port_deallocate (mach_task_self (), user_thread); |