/branches/dynload/uspace/srv/loader/include/elf_load.h |
---|
74,8 → 74,8 |
} elf_ld_t; |
int elf_load_file(char *file_name, size_t so_bias, elf_info_t *info); |
void elf_run(elf_info_t *info, void *pcb); |
int elf_create_pcb(elf_info_t *info); |
void elf_run(elf_info_t *info, pcb_t *pcb); |
void elf_create_pcb(elf_info_t *info, pcb_t *pcb); |
#endif |
/branches/dynload/uspace/srv/loader/main.c |
---|
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(); |
/branches/dynload/uspace/srv/loader/elf_load.c |
---|
53,7 → 53,6 |
#include <loader/pcb.h> |
#include "elf.h" |
#include "arch/pcb.h" |
#include "elf_load.h" |
#include "arch.h" |
118,7 → 117,7 |
* |
* @param info Info structure filled earlier by elf_load_file() |
*/ |
void elf_run(elf_info_t *info, void *pcb) |
void elf_run(elf_info_t *info, pcb_t *pcb) |
{ |
program_run(info->entry, pcb); |
127,29 → 126,16 |
/** Create the program control block (PCB). |
* |
* Create and install the program control block, initialising it |
* with program information from @a info. |
* Fills the program control block @a pcb with information from |
* @a info. |
* |
* @param info Program info structure |
* @return EOK on success or negative error code |
*/ |
int elf_create_pcb(elf_info_t *info) |
void elf_create_pcb(elf_info_t *info, pcb_t *pcb) |
{ |
pcb_t *pcb; |
void *a; |
pcb = __pcb_get(); |
a = as_area_create(pcb, sizeof(pcb_t), AS_AREA_READ | AS_AREA_WRITE); |
if (a == (void *)(-1)) { |
printf("elf_create_pcb: memory mapping failed\n"); |
return EE_MEMORY; |
} |
pcb->entry = info->entry; |
pcb->dynamic = info->dynamic; |
return 0; |
} |
/branches/dynload/uspace/srv/loader/arch/ia64/include/pcb.h |
---|
File deleted |
/branches/dynload/uspace/srv/loader/arch/arm32/include/pcb.h |
---|
File deleted |
/branches/dynload/uspace/srv/loader/arch/ppc32/include/pcb.h |
---|
File deleted |
/branches/dynload/uspace/srv/loader/arch/amd64/include/pcb.h |
---|
File deleted |
/branches/dynload/uspace/srv/loader/arch/mips32/include/pcb.h |
---|
File deleted |
/branches/dynload/uspace/srv/loader/arch/ia32/include/pcb.h |
---|
File deleted |