Rev 3690 | Rev 3773 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3690 | Rev 3772 | ||
|---|---|---|---|
| Line 223... | Line 223... | ||
| 223 | */ |
223 | */ |
| 224 | static int loader_load(ipc_callid_t rid, ipc_call_t *request) |
224 | static int loader_load(ipc_callid_t rid, ipc_call_t *request) |
| 225 | { |
225 | { |
| 226 | int rc; |
226 | int rc; |
| 227 | 227 | ||
| - | 228 | printf("Load program '%s'\n", pathname); |
|
| - | 229 | ||
| 228 | rc = elf_load_file(pathname, 0, 0, &prog_info); |
230 | rc = elf_load_file(pathname, 0, 0, &prog_info); |
| 229 | if (rc < 0) { |
231 | if (rc < 0) { |
| 230 | printf("Failed to load executable '%s'.\n", pathname); |
232 | printf("Failed to load executable '%s'.\n", pathname); |
| 231 | ipc_answer_0(rid, EINVAL); |
233 | ipc_answer_0(rid, EINVAL); |
| 232 | return 1; |
234 | return 1; |
| 233 | } |
235 | } |
| 234 | 236 | ||
| - | 237 | printf("Create PCB\n"); |
|
| - | 238 | ||
| 235 | elf_create_pcb(&prog_info, &pcb); |
239 | elf_create_pcb(&prog_info, &pcb); |
| 236 | 240 | ||
| - | 241 | printf("Fill args\n"); |
|
| - | 242 | ||
| 237 | pcb.argc = argc; |
243 | pcb.argc = argc; |
| 238 | pcb.argv = argv; |
244 | pcb.argv = argv; |
| 239 | 245 | ||
| - | 246 | printf("Check interp\n"); |
|
| - | 247 | ||
| 240 | if (prog_info.interp == NULL) { |
248 | if (prog_info.interp == NULL) { |
| 241 | /* Statically linked program */ |
249 | /* Statically linked program */ |
| 242 | is_dyn_linked = false; |
250 | is_dyn_linked = false; |
| 243 | ipc_answer_0(rid, EOK); |
251 | ipc_answer_0(rid, EOK); |
| 244 | return 0; |
252 | return 0; |
| Line 280... | Line 288... | ||
| 280 | 288 | ||
| 281 | ipc_answer_0(rid, EOK); |
289 | ipc_answer_0(rid, EOK); |
| 282 | program_run(interp_info.entry, &pcb); |
290 | program_run(interp_info.entry, &pcb); |
| 283 | 291 | ||
| 284 | } else { |
292 | } else { |
| - | 293 | printf("Run static program\n"); |
|
| 285 | /* Statically linked program */ |
294 | /* Statically linked program */ |
| 286 | close_console(); |
295 | close_console(); |
| 287 | ipc_answer_0(rid, EOK); |
296 | ipc_answer_0(rid, EOK); |
| 288 | program_run(prog_info.entry, &pcb); |
297 | program_run(prog_info.entry, &pcb); |
| 289 | } |
298 | } |