57,7 → 57,6 |
|
#include <elf.h> |
#include <elf_load.h> |
#include <arch/pcb.h> |
|
/** |
* Bias used for loading the dynamic linker. This will be soon replaced |
68,6 → 67,9 |
/** Pathname of the file that will be loaded */ |
static char *pathname = NULL; |
|
/** The Program control block */ |
static pcb_t pcb; |
|
/** Receive a call setting pathname of the program to execute. |
* |
* @param rid |
113,7 → 115,6 |
static int iloader_run(ipc_callid_t rid, ipc_call_t *request) |
{ |
int rc; |
pcb_t *pcb; |
|
elf_info_t prog_info; |
elf_info_t interp_info; |
128,10 → 129,7 |
} |
|
// printf("Create PCB\n"); |
if (elf_create_pcb(&prog_info) < 0) { |
ipc_answer_0(rid, ENOMEM); |
return 1; |
} |
elf_create_pcb(&prog_info, &pcb); |
|
if (prog_info.interp == NULL) { |
/* Statically linked program */ |
139,7 → 137,7 |
// printf("entry point: 0x%llx\n", prog_info.entry); |
ipc_answer_0(rid, EOK); |
close_console(); |
elf_run(&prog_info, __pcb_get()); |
elf_run(&prog_info, &pcb); |
return 0; |
} |
|
154,9 → 152,8 |
/* |
* Provide dynamic linker with some useful data |
*/ |
pcb = (pcb_t *)PCB_ADDRESS; |
pcb->rtld_dynamic = interp_info.dynamic; |
pcb->rtld_bias = RTLD_BIAS; |
pcb.rtld_dynamic = interp_info.dynamic; |
pcb.rtld_bias = RTLD_BIAS; |
|
printf("run dynamic linker\n"); |
printf("entry point: 0x%llx\n", interp_info.entry); |
163,9 → 160,9 |
close_console(); |
|
ipc_answer_0(rid, EOK); |
elf_run(&interp_info, __pcb_get()); |
elf_run(&interp_info, &pcb); |
|
/* Not reached(?) */ |
/* Not reached */ |
return 0; |
} |
|
227,8 → 224,9 |
phone_hash = call.in_phone_hash; |
|
/* |
* FIXME: up until now no async calls can be used!!! |
* (Which means e.g. printf() cannot be used) |
* Up until now async must not be used as it couldn't |
* handle incoming requests. (Which means e.g. printf() |
* cannot be used) |
*/ |
async_new_connection(phone_hash, 0, NULL, loader_connection); |
async_manager(); |