Skip to content

RMPReal-time kernel — minimal by design

One C file, 1.6 KB of ROM and 432 bytes of RAM at the low end, and fifty-odd build projects from 8-bit AVR to Cortex-M55 and RISC-V. Small enough to reason about — and to run as a guest on RVM.

▶Try it now · Linux & NES demos Build a 32-bit Linux binary or drop RMP.nes into an emulator — the full benchmark output runs without a board.
RMP logo

Verification is still under construction

Formal verification is not finished: stage 1 (a working, portable kernel) is complete, stage 2 (the formal specification and its proofs) is in progress, and stage 3 (a verified rewrite targeting IEC 61508 SIL 4 / ISO 26262 ASIL D) has not started. Today the evidence is 100% branch coverage in white-box tests — pre-certified SIL 2 / EAL 4, not a certificate.

Designed to be minimal ​

1.6 KBROM on STM32F030F4 (Cortex-M0), including the first thread
432 BRAM in the same configuration, including thread stack
52 Bkernel + stripped-down HAL, combined
1 × .Ckernel, memory manager, widgets and FXAA in one file

RMP deliberately provides every basic RTOS primitive and nothing more: threads, semaphores, mailboxes, FIFOs, message queues, blocking message queues, alarms, scheduler locking, and an efficient memory pool. That minimality is not an aesthetic choice — it is what makes the kernel small enough to understand, test to full branch coverage, and eventually prove.

Portable by design ​

Cortex-M0 / M0+Cortex-M3 / M4 / M7Cortex-M23 / M55Cortex-R4 / R5RV32 RISC-VAVRMSP430RL78PIC24 / dsPIC33PIC32 / MIPSC28x DSPMOS 6502Z80unSPx86 Linux

The same kernel source runs on a 32 KB AVR, a 16-bit MSP430, a 32-bit Cortex-R5 and a RISC-V microcontroller. Ports are deliberately kept thin so the abstraction is exercised by real hardware rather than by a simulator. The full list, including every build project and toolchain, is on the ports page.

Graphics without a middleware layer ​

RMP widget toolkit — controls
Widget toolkit: buttons, sliders and dialogs
RMP calculator demo
A calculator built from the built-in widgets
FXAA anti-aliasing
FXAA anti-aliasing, on by a compile switch

Run it without a board ​

RMP ships two ready-to-run demonstrations that need no hardware:

  • x86 Linux — build the 32-bit binary in Project/GCCMF-X86L and watch the benchmark output. RMP runs on top of ptrace and signals, so it is not fast, but every primitive works.
  • Famicom / NES — download RMP.nes and load it into your favourite emulator. The Namco 163 mapper is required: its readable IRQ timer is what RMP uses to measure cycles.
RMP running on a Famicom
RMP benchmark running on a Famicom (Namco 163 cartridge)

One kernel, two roles ​

RMP is a complete bare-metal RTOS, and it is also the reference guest of RVM: the same source tree builds a virtualized variant that runs as an unprivileged virtual machine, with all privileged operations routed through the monitor. The virtualized ports keep the kernel ABI intact, which is why RMP is used to measure the cost of virtualization itself.

PortChipYieldMailSem
ARMv6-MSTM32L071CB400751649
ARMv7-MSTM32F405RG312540448
ARMv7-MSTM32F767IG192352292
RV32IMACCH32V307VC233384336

All values are CPU cycles, GCC, highest optimization. The benchmark page has the complete tables, including the virtualization overhead columns.

A first thread ​

C
void Func_1(void* Param)
{
    RMP_LOG_S("Parameter passed is ");
    RMP_LOG_H((ptr_t)Param);
    RMP_LOG_S("\r\n");
    while(1)
    {
        RMP_Thd_Delay(30000);
        RMP_LOG_S("Delayed 30000 cycles\r\n\r\n");
    };
}

void RMP_Init_Hook(void)
{
    RMP_Thd_Crt(&Thd_1, Func_1, &Stack_1, sizeof(Stack_1),
                (void*)0x12345678, 1, 5);
}

That is the whole "hello world": a thread control block, a stack array, and one call. The getting-started guide walks through compiling a real project and reading its benchmark output.

An official work of EDI, released into the public domain.

GitHub·Discord·QQ 群 1038895132·rtospro.com