rusty_rtos_kernel-core
The pure no_std core of
rusty_rtos_kernel: the whole
FreeRTOS scheduler as types, traits and algorithms, with no CPU, no allocator
and no operating system. #![forbid(unsafe_code)].
- What is in here: tasks and the tick, the context-switch decision, ready/delayed/suspended lists, queues, semaphores, mutexes with priority inheritance, task notifications, software timers and their daemon, event groups, and stream and message buffers.
- What is not: the switch itself. A stack swap is
unsafe, which this family allows only inrusty_rtos_port-<arch>. This crate fires the sameTASK_SWITCHED_OUT/_INpair the C kernel fires and a port acts on it.
Known gaps. No SMP, no MPU, no static allocation, no co-routines.
Conformance
19 conformance scenarios produce traces byte-identical to the C kernel's at 100,000 ticks each, on host, ARMv7-M, RV32 and Xtensa LX7 — the last on silicon. Separately, 26 unmodified C demo files from the FreeRTOS distribution run against this kernel through the C ABI.
The full table, the open AbortDelay contract question and every defect the
corpus found are in the
repository README.
Using it
use ;
// The geometry is the declaration: no allocator, and the `.bss` cost is
// exactly what was asked for.
system!
Feature ladder: std ⊃ alloc ⊃ core-only. Build with
--no-default-features for bare metal.
Performance
Cortex-M3 PendSV |
instructions |
|---|---|
| FreeRTOS | 19 |
| Kairos | 19 — exact parity |
The list this kernel walks costs 34.22 instructions per operation, 1.533×
list.c, by callgrind with both arms printing the same checksum. Full method
in the repository README.
Portability
Builds and tests on host; compiles for thumbv7m-none-eabi,
riscv32imac-unknown-none-elf and xtensa-esp32s3-none-elf with
--no-default-features. The corpus runs on all four.
Part of Remade With Rust
This crate is part of Kairos —
FreeRTOS remade in memory-safe Rust, as independent packages that expose the API
a FreeRTOS developer already knows and prove every scheduling decision against
the C kernel's own trace. The family:
rusty_rtos_core,
rusty_rtos_kernel,
rusty_rtos_port,
rusty_rtos_heap. Also check out the
rest of github.com/remade-with-rust.
About Mata Network
Mata Network builds sovereign, self-hostable infrastructure. Remade With Rust is our open-source home for the permissively-licensed building blocks that work depends on.
License
MIT OR Apache-2.0, at your option. FreeRTOS is MIT-licensed by Amazon.com, Inc. or its affiliates; this crate remakes its API and behaviour from the published sources and links no FreeRTOS code.