Memory Protection & Isolation¶
Revera’s differentiator. See also Memory Management and Footprint and Safety, Security, and Compliance.
The criterion. How cleanly does the RTOS use the hardware (MPU / MMU / bus) to keep a fault or a compromise in one thread — or one whole scheduling domain — from reaching another’s memory, and to separate privileged from unprivileged execution? On most kernels this boundary holds only by convention.
How Revera answers it¶
Isolation is Revera’s headline. It is a ladder — you enable exactly the rung your target’s hardware supports, and each rung is enforced by the CPU, not by convention:
a software stack canary on any target (post-hoc overflow detection),
a hardware stack guard that faults an overflow at the offending instruction,
unprivileged threads behind a syscall boundary, with kernel-owned handles so a forged handle from an unprivileged thread is rejected, never dereferenced (the property that makes unprivileged threads safe),
full-lockdown placement of each thread’s stack and the kernel’s own RAM in fenced regions,
a per-island supervisor fence that binds even privileged kernel code — island A’s kernel cannot reach island B’s RAM — proven across five protection mechanisms and two classes (region MPUs and paging), and
TrustZone-AMP worlds (Secure / Non-secure) on the system bus.
Ask the kernel what boundary a build actually enforces with tk_kernel_isolation() →
TK_ISOLATION_NONE / _THREAD / _INSTANCE; asking for a boundary the arch can’t enforce fails loud at
compile time, never silently degrades.
The ladder — what it enforces · how to turn it on · how to use it · where it works¶
Rung |
Enforces |
Enable with |
Use these APIs |
Mechanism · architectures |
|---|---|---|---|---|
Stack canary |
Detects a stack overflow at the next context switch (software, any target) |
|
|
software — all targets |
MPU stack guard |
Faults an overflow in hardware, at the overflowing write |
|
|
region MPU/PMP — Cortex-M (v7/v8-M), RISC-V, AURIX |
Unprivileged threads |
App threads run in user mode; reach the kernel only through the SVC / ecall / trap syscall boundary |
|
|
Cortex-M (v7/v8-M), RISC-V S-mode, AURIX |
Full-lockdown isolation |
Each thread’s stack + kernel RAM in MPU-fenced sections — touching a peer stack or kernel RAM faults |
|
|
region MPU/PMP — same as above |
Supervisor fence (per island) |
Binds even the KERNEL: island A’s privileged code cannot reach island B’s RAM |
|
|
region MPU (v8-M, Cortex-R, AURIX) + paging (RISC-V Sv32, ARM VMSA) |
TrustZone-AMP worlds |
Secure / Non-secure domains attributed at the system bus |
|
|
ARM v8-M TrustZone + system-side bus (e.g. MCXN947 AHBSC) |
Boundary query |
Report the boundary this build enforces (honest, runtime) |
— |
|
all |
For the full signature and contract of any symbol above, see the API reference (Threads · Kernel lifecycle & instances · Synchronization sections).
Limits & roadmap¶
Not every target can enforce it. ARM Cortex-M0/M0+ (v6-M), TI C2000, and MSP430 have no privilege-binding protection unit — there an “island” or “thread boundary” is a scheduling + convention partition, not a hardware safety boundary. Revera says so at compile time rather than pretending.
The fence is a memory boundary, not a covert-channel or timing defense, and the software stack canary is post-hoc (it catches the overflow at the next switch, not at the instruction — that’s the MPU guard’s job).
On the roadmap: the secondary-core (Non-secure) system-side fence is proven on MCXN947 hardware but not yet grafted into the portable kernel; see ADR 0005.
Learn more¶
How it works: per-thread stack isolation · kernel-RAM isolation · kernel-owned sync · ADRs 0003 / 0004 / 0005.
The full API: API reference.
Run it:
examples/isolation,examples/isolation_reject,examples/fault_contain, theexamples/fence_*demos, andexamples/amp_kernel_fence— each builds on a listed board.Per-target maturity: the readiness dashboard isolation section.