Skip to content
STIMSMITH

Bare metal runtime

Concept WIKI v1 · 6/6/2026

A bare metal runtime is a lightweight software execution environment that runs directly on hardware without a full operating system. In the context of constrained microcontroller-class SoCs, bare-metal runtimes provide just enough system call interfaces and exception handling to support basic workloads, while advanced parallel ULP MCUs with their small main memories (<1MB) and lack of virtualization or security features typically only support simple bare-metal runtimes. Nexus-AM is a notable example, serving as a lightweight, multi-ISA bare metal runtime test generation environment that implements basic system call interfaces and exception handlers.

Bare metal runtime

Definition

A bare metal runtime is a lightweight software execution environment that executes directly on hardware without the mediation of a full operating system. In contrast to hosted environments that rely on a rich OS kernel with process isolation, virtualization, and security services, a bare-metal runtime supplies only the minimal infrastructure — basic system call interfaces, exception handlers, and device abstractions — needed to run application code on a target processor.

Role on constrained microcontrollers and SoCs

On ultra-low-power (ULP) microcontroller units (MCUs) and other resource-constrained SoCs, a full operating system is often impractical or impossible to deploy. These devices typically combine:

  • Small on-chip main memories (commonly <1 MB),
  • Microcontroller-class CPUs, and
  • The absence of hardware virtualization or security features.

Because of these constraints, such platforms only support simple bare-metal runtimes rather than a Linux- or RTOS-class software stack. The runtime must be compact enough to fit in limited memory and must not depend on features (MMU-mediated isolation, supervisor/user separation, etc.) that the hardware does not provide. As a result, bare-metal runtimes on these targets are commonly used to host single workloads — for example, an ML inference loop, a DSP kernel, or a control task — that run to completion without preemption by an OS scheduler.

Nexus-AM: a reference implementation

Nexus-AM is a prominent example of a bare-metal runtime environment used in computer architecture research. It is described as:

  • A bare metal runtime test generation environment,
  • Light-weight and easy to use,
  • Implementing basic system call interfaces and exception handlers,
  • Supporting multiple ISAs and configurations.

In the XiangShan verification flow, Nexus-AM serves as the standard program loader and runtime for test workloads such as CoreMark. The build flow compiles workloads (e.g., make ARCH=riscv64-xs to produce coremark-riscv64-xs.bin/.elf) against the AM API, and the resulting binaries can be executed directly on the simulated hardware (via NEMU or the XiangShan RTL emulator) without requiring an OS image.

Typical use cases

Bare-metal runtimes such as Nexus-AM are used for:

  1. Functional verification — running real programs (CoreMark, micro-benchmarks, ML kernels) on an RTL or simulated processor to validate ISA-level correctness via co-simulation (e.g., Difftest against a reference simulator such as NEMU).
  2. Performance characterization — collecting execution traces and IPC metrics on isolated workloads without OS-induced noise.
  3. Bring-up and debug — providing a minimal, deterministic environment with full visibility into architectural state, which can be combined with snapshot tools (e.g., LightSSS) and structured waveform databases (e.g., ChiselDB).
  4. Embedded deployment on ULP MCUs that lack the resources for an OS, where the runtime, drivers, and application are statically linked into a single image.

Relationship to other layers

A bare-metal runtime occupies the middle of the software stack on a constrained device, sitting between raw hardware and the application:

Application workload
        │
Bare-metal runtime  (system calls, exception/interrupt handlers, device I/O stubs)
        │
Hardware (CPU, memory, peripherals)

It contrasts with a hosted environment, where the application sits above an OS kernel that provides richer abstractions (processes, virtual memory, file systems, networking). On larger SoCs — such as heterogeneous RISC-V platforms that pair an application-class RV64 host core with an RV32 accelerator cluster — the host core may run Linux while the accelerator cluster executes its tasks under a bare-metal runtime, with the host and accelerator runtimes coexisting safely.

See also

  • Nexus-AM — a concrete bare-metal runtime environment used in the XiangShan / NEMU ecosystem.
  • NEMU — an instruction-set simulator frequently paired with a bare-metal runtime for verification.
  • Difftest — ISA co-simulation framework that compares DUT and reference states while running bare-metal workloads.
  • RISC-V — the ISA family on which many bare-metal runtime examples, including Nexus-AM's RISC-V configurations, are built.

LINKED ENTITIES

1 links

CITATIONS

3 sources
3 citations
[1] A bare metal runtime supplies only the minimal infrastructure — basic system call interfaces, exception handlers, and device abstractions — needed to run application code on a target processor without a full operating system. XiangShan ASPLOS'25 Tutorial — Function Verification
[2] Nexus-AM is a bare metal runtime test generation environment that is light-weight, easy to use, implements basic system call interfaces and exception handlers, and supports multiple ISAs and configurations. XiangShan ASPLOS'25 Tutorial — Function Verification
[3] Advanced parallel ULP MCUs rely on small main memories (<1MB) and microcontroller-class CPUs with no virtualization or security features, and hence only support simple bare-metal runtimes. A Heterogeneous RISC-V based SoC for Secure Nano-UAV Navigation