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