Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3100 → Rev 3101

/branches/dynload/uspace/app/iloader/main.c
32,6 → 32,15
*/
/**
* @file
* @brief Loads and runs programs from VFS.
*
* The program loader is a special init binary. Its image is used
* to create a new task upon a @c task_spawn syscall. The syscall
* returns the id of a phone connected to the newly created task.
*
* The caller uses this phone to send the pathname and various other
* information to the loader. This is normally done by the C library
* and completely hidden from applications.
*/
 
#include <stdio.h>
47,10 → 56,20
#include <elf_load.h>
#include <pcb.h>
 
/**
* Bias used for loading the dynamic linker. This will be soon replaced
* by automatic placement.
*/
#define RTLD_BIAS 0x80000
 
/** Pathname of the file that will be loaded */
static char *pathname = NULL;
 
/** Receive a call setting pathname of the program to execute.
*
* @param rid
* @param request
*/
void iloader_set_pathname(ipc_callid_t rid, ipc_call_t *request)
{
// ipc_callid_t callid;
86,6 → 105,12
pathname = name_buf;
}
 
/** Load and run the previously selected program.
*
* @param rid
* @param request
* @return 0 on success, !0 on error.
*/
int iloader_run(ipc_callid_t rid, ipc_call_t *request)
{
int rc;
132,6 → 157,11
return 0;
}
 
/** Program loader main function.
*
* Receive and carry out commands (of which the last one should be
* to execute the loaded program).
*/
int main(int argc, char *argv[])
{
ipc_callid_t callid;