pw_kernel#

A Rust-based kernel for embedded systems

Experimental Rust Code Size Impact: ~16-24 kB

pw_kernel is an embedded kernel written in Rust that provides:

  • A core preemptive scheduling and context switch system

  • Synchronization primitives (spinlocks, mutexes, and events)

  • Out-of-tree architecture porting layer

  • In-tree support for RV32, ARMv8-M, and ARMv7-M

  • Capability-based userspace primitives (processes, IPC, interrupts, and wait groups)

  • Robust protection against process faults

  • Shareable .text sections and pw_tokenizer-based logging for reduced binary size

Embedded systems built on top of pw_kernel are a composition of memory-protected userspace apps and drivers. All interactions with the kernel are mediated through unforgeable tokens called handles. The system is defined declaratively, and all allocation is static. Bazel macros are provided for building, linking, and optimizing multiple processes into a single image.

Quickstart

Get a complete, working system powered by pw_kernel up and running in minutes.

Quickstart
Tour

A conceptual overview of the software architecture of an embedded system built on top of pw_kernel.

Tour of pw_kernel
Design

The design philosophy and goals of pw_kernel.

Design
Guides

Unit testing, panic detecting, and other real-world usage topics.

Guides