62,11 → 62,13 |
*/ |
void *program_loader = NULL; |
|
/** Create a program using an existing address space. |
/** Create new task with 1 thread and run it |
* |
* @param as Address space containing a binary program image. |
* @param entry_addr Program entry-point address in program address space. |
* @param p Buffer for storing program information. |
* @param as Address space containing a binary program image. |
* @param entry_addr Program entry-point address in program address space. |
* @param name Program name. |
* |
* @return Task of the running program or NULL on error. |
*/ |
void program_create(as_t *as, uintptr_t entry_addr, program_t *p) |
{ |
98,16 → 100,15 |
ASSERT(p->main_thread); |
} |
|
/** Parse an executable image in the kernel memory. |
/** Parse an executable image in the physical memory. |
* |
* If the image belongs to a program loader, it is registered as such, |
* (and *task is set to NULL). Otherwise a task is created from the |
* executable image. The task is returned in *task. |
* |
* @param image_addr Address of an executable program image. |
* @param p Buffer for storing program info. If image_addr |
* points to a loader image, p->task will be set to |
* NULL and EOK will be returned. |
* @param program_addr Address of program executable image. |
* @param name Program name. |
* @param task Where to store the pointer to the newly created task. |
* |
* @return EOK on success or negative error code. |
*/ |
140,8 → 141,10 |
|
/** Create a task from the program loader image. |
* |
* @param p Buffer for storing program info. |
* @return EOK on success or negative error code. |
* @param name Program name. |
* @param t Buffer for storing pointer to the newly created task. |
* |
* @return Task of the running program or NULL on error. |
*/ |
int program_create_loader(program_t *p) |
{ |
166,11 → 169,11 |
return EOK; |
} |
|
/** Make program ready. |
/** Make task ready. |
* |
* Switch program's main thread to the ready state. |
* Switch task's thread to the ready state. |
* |
* @param p Program to make ready. |
* @param ta Task to make ready. |
*/ |
void program_ready(program_t *p) |
{ |
177,7 → 180,7 |
thread_ready(p->main_thread); |
} |
|
/** Syscall for creating a new loader instance from userspace. |
/** Syscall for creating a new task from userspace. |
* |
* Creates a new task from the program loader image, connects a phone |
* to it and stores the phone id into the provided buffer. |