The task registry is informational. There is no scheduler or context switching in the current release. Task states are updated by the kernel itself; you cannot forcibly suspend or resume a task through this API.
Constants
Types
task_state_t
An enumeration of all possible task execution states.
task_info_t
A snapshot of a single registered task.
uint32_t
A kernel-assigned numeric identifier that is unique within a single boot session. PIDs are assigned sequentially and are never reused.
uint8_t
A priority hint in the range
[0, 255], where higher values indicate higher priority. Because there is no preemptive scheduler in the current release, this field is informational only.task_state_t
The current execution state. Use
task_state_name() to convert this value to a printable string.uint64_t
The value of the kernel tick counter at the moment the task was registered. Use this to determine task age relative to other tasks or to the current tick.
char[24]
A null-terminated display name assigned at registration. Maximum usable length is 23 characters.
Functions
task_init
created_tick is anchored to a meaningful timestamp.
uint64_t
required
The current kernel tick at the time of initialisation. Typically this is the tick value read from the hardware timer immediately before calling
task_init.task_count
TASK_UNUSED).
uint32_t
The number of active task entries, in the range
[0, TASK_MAX].task_list
TASK_UNUSED are included.
task_info_t *
required
Pointer to an array of
task_info_t that will receive the task records. The array must be large enough to hold at least capacity elements.uint32_t
required
The maximum number of records to write. Pass
TASK_MAX to guarantee that every active task is captured.uint32_t
The number of records written to
tasks. This is min(task_count(), capacity).task_state_name
task_state_t
required
Any
task_state_t value.const char *
A pointer to a null-terminated static string:
"UNUSED", "RUNNING", "READY", "SLEEPING", or "STOPPED". Returns "UNKNOWN" for unrecognised values. Do not free or modify the returned pointer.Shell Command
The built-inps shell command prints a formatted table of every registered task, showing its PID, priority, state, creation tick, and name: