kickstart

Number0x07
Signature(args*) -> 0 or -err
Grouptask
Since1.0

Mark a FROZEN process as schedulable. Final step of the three-step process spawn sequence:

  1. pspawn creates a new FROZEN process and returns its handle.
  2. asinject fills the new process’s address space with parsed ELF data.
  3. kickstart marks 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

RegisterNameDescription
r0argsPointer to the argument struct

Returns

0 on success.

Errors

CodeCondition
ERR_BADARG`size` < `sizeof(kickstart_args_t)`
ERR_BADPTRStruct pointer is invalid
ERR_BADHANDLEHandle is not a valid task handle
ERR_BADTYPEHandle is not a task handle
ERR_BUSYTask is not `FROZEN`

See also