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 is KickstartArgs, defined in spawn_args.h:
typedef struct
{
uint32_t size; /* sizeof(KickstartArgs); wrapper sets it */
Handle taskHandle; // handle of the target task
VirtAddr entry; // entry point address in the target task's address space
VirtAddr 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
} KickstartArgs;
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(KickstartArgs)` |
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` |