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.
Where this sits for Mata. Kairos is the real-time layer on the device
itself, and rusty_rtos_mqtt is the way out of it.
Paired with the MATA distributed cloud, robotics and sensor data has two
routes — read it on the machine, or reach it through the cloud — with the same
memory-safe crates at both ends.
The family:
rusty_rtos_core (the shared vocabulary),
rusty_rtos_kernel (the scheduler),
rusty_rtos_port (the architecture seam),
rusty_rtos_heap (the allocators),
rusty_rtos_json (coreJSON),
rusty_rtos_sntp (coreSNTP),
rusty_rtos_mqtt (coreMQTT),
rusty_rtos_backoff (backoffAlgorithm),
rusty_rtos-capi (the C ABI) and
rusty_rtos_demo (the conformance corpus).
All ten are on crates.io. Also check out
the rest of github.com/remade-with-rust.
About Mata Network
Mata Network builds sovereign, self-hostable privacy infrastructure — "stop sacrificing your privacy for convenience": wallet & identity, a password manager, a contact manager, and a browser extension that stops your information leaking as you browse.
Remade With Rust is our open-source home for the permissively-licensed building blocks that work depends on — including remade_ffmpeg_rs (the FFmpeg alternative) and FFAI (the AI media toolkit).
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.