kickstart
| Number | 0x07 |
|---|---|
| Signature | (args*) -> 0 or -err |
| Group | task |
| Since | 1.0 |
Mark a FROZEN process as schedulable. Final step of the three-step process spawn sequence:
pspawncreates a new FROZEN process and returns its handle.asinjectfills the new process’s address space with parsed ELF data.kickstartmarks the process as schedulable.
The argument struct has the following form and is in spawn_args.h:
typedef struct
{
uint32_t size; /* sizeof(kickstart_args_t); wrapper sets it */
handle_t task_handle; // handle of the target task
uintptr_t entry; // entry point address in the target task's address space
uintptr_t sp; // stack pointer value for the target task
uint32_t r0_val; // value to set in register r0 of the target task
uint32_t r1_val; // value to set in register r1 of the target task
} kickstart_args_t;
Pitfalls
Do not kickstart a process whose address space has not been filled by asinject, or it takes a prefetch abort and is killed. Ordinary processes cannot call asinject; to spawn a child, message the init process.
Arguments
| Register | Name | Description |
|---|---|---|
r0 | args | Pointer to the argument struct |
Returns
0 on success.
Errors
| Code | Condition |
|---|---|
ERR_BADARG | `size` < `sizeof(kickstart_args_t)` |
ERR_BADPTR | Struct pointer is invalid |
ERR_BADHANDLE | Handle is not a valid task handle |
ERR_BADTYPE | Handle is not a task handle |
ERR_BUSY | Task is not `FROZEN` |