Skip to main content

Crate rusty_rtos_core

Crate rusty_rtos_core 

Source
Expand description

rusty_rtos_core — the shared vocabulary of the Kairos family.

Kairos is FreeRTOS remade in memory-safe Rust. This crate is Layer 0: the handful of no_std types every other package speaks at its boundary, so a task handle, a tick count, a priority or an error crosses from the kernel to a port to a library with no conversion and no copy.

The laws it encodes (mission plan §2.5):

  1. Handles are indices, never pointers. Every kernel object lives in an arena::Arena; a handle::Handle is a generational index and a stale one is Error::Gone, not a use-after-free.
  2. The list is index-linked. list::Lists remakes FreeRTOS’s list.cvListInsert, vListInsertEnd, uxListRemove, the round-robin cursor — over indices, so the scheduler core needs no pointer and no unsafe.
  3. Time is a value. tick::Tick is a monotonic count whose width is a type parameter mirroring configTICK_TYPE_WIDTH_IN_BITS.
  4. One Copy error. Error has no String; it maps onto the C kernel’s pdPASS / pdFAIL / errQUEUE_* codes for the C ABI.
  5. The config is a type. config::Config is FreeRTOSConfig.h as associated constants; config::DefaultConfig mirrors the upstream template configuration value for value.
  6. Four seams, traits only. port::Port, heap::Heap, trace::Trace and hooks::Hooks are the only way the kernel touches a CPU, memory, an observer or the application.
  7. The ISR side is a type. isr::Isr is the proof a *FromISR variant demands; the wrong variant does not compile.

forbid(unsafe). No allocator, no arch, no product type. Feature ladder stdalloc ⊃ core-only; CI holds the bare rungs on Cortex-M and RISC-V on every push.

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

arena
A fixed-capacity, generational arena: where every kernel object lives.
config
FreeRTOSConfig.h as a type.
error
One Copy error for the whole family.
handle
Generational handles: the family’s answer to TaskHandle_t and friends.
heap
The Heap seam: the only way the kernel allocates.
hooks
The application hooks as a trait.
isr
The interrupt side as a type.
list
list.c remade over indices: the scheduler’s ready, delayed, suspended and event lists without a pointer.
port
The Port seam: the only way the kernel touches a CPU.
prelude
The names a kernel, a port or a firmware wants in scope.
priority
Task priorities, bounded at construction.
tick
The tick count, with its width as a type.
time
Durations and timeouts in the units a caller thinks in.
trace
The Trace seam: the oracle instrument.

Constants§

FORMAT_VERSION
The version of every byte format this family emits (the trace line format, the C ABI struct layouts). Readers refuse a version they do not know; the bump discipline is the mission plan’s §2.5.
VERSION
Crate version, for manifests and logs.