Skip to main content

Crate rusty_esp_rtos

Crate rusty_esp_rtos 

Source
Expand description

The RTOS seam: the Kairos kernel’s port, pinned once for the family.

Every Janus firmware that runs on rusty_rtos reaches it through this crate and never names rusty_rtos_port-* itself. Same rule, and same reason, as rusty_esp_alloc: the pin, the compatibility window and the startup shape are decided here once rather than in every firmware.

This crate declares no scheduler and starts nothing. It hands out the port and states what that port requires; the deliverable’s own main does the starting, exactly as it declares its own global allocator.

§The window, and why it is narrow

The Xtensa port’s context switch runs inside a software interrupt so that xtensa-lx-rt’s exception entry spills the register windows — which is how FreeRTOS and esp-rtos do it, and what a hand-written spill from task context could not do. That makes xtensa-lx-rt a hard joint between the port and esp-hal, and it is a links crate: exactly one version may exist in a dependency graph, so the port and esp-hal must agree or the build fails outright rather than misbehaving.

Checked on 2026-09-20, and the news is good:

  rusty_rtos_port-xtensa 0.1.0  pins xtensa-lx-rt 0.23  (to match esp-hal 1.2.1)
  janus xiao-s3-probe           resolves xtensa-lx-rt 0.23.0
  janus xiao-s3-keys            resolves xtensa-lx-rt 0.23.0

The joint already lines up. See compat for the rest of the window.

§What this cannot do yet

Host the Wi-Fi/BLE blob. esp-radio reaches a scheduler through the esp-radio-rtos-driver interface, and as of 2026-09-20 the Kairos ports document that interface but do not implement it — it is the Kairos half of K5. Until then a Janus firmware with a radio keeps esp-rtos, and this seam carries the pin so that the day the ports implement it, the change on our side is one feature flag rather than six manifests.

The integration contract, written for the Kairos side, is docs/plans/janus-rtos.md in the Kairos umbrella.

Modules§

compat
The compatibility window this seam guarantees, as facts a build can check against rather than prose someone has to remember.

Functions§

port_name
The Kairos port for the target being built, or None where there is none — a host build, or an architecture Kairos has not ported.