Hubbry Logo
BareMetalBareMetalMain
Open search
BareMetal
Community hub
BareMetal
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
BareMetal
BareMetal
from Wikipedia
BareMetal
DeveloperReturn Infinity
Written inAssembly
Working stateCurrent
Source modelOpen source
Initial release2008; 18 years ago (2008)
Latest release2025.04 / April 30, 2025; 9 months ago (2025-04-30)[1]
Marketing targetHPCs, HTC, Cloud computing
Available inEnglish
Supported platformsx86-64
Kernel typeExokernel, SASOS
UserlandUnknown
Default
user interface
Command-line
LicenseBSD License[2]
Official websitewww.returninfinity.com

BareMetal is an exokernel-based single address space operating system (OS) created by Return Infinity.

It is written in assembly to achieve high-performance computing with minimal footprint[3][4] with a "just enough operating system" (JeOS) approach.[5] The operating system is primarily targeted towards virtualized environments for cloud computing, or HPCs due to its design as a lightweight kernel (LWK). It could be used as a unikernel.

It was inspired by another OS written in assembly, MikeOS,[2] and it is a recent example of an operating system that is not written in C or C++, nor based on Unix-like kernels.[6]

Overview

[edit]

Hardware requirements

[edit]

Source:[7]

  • AMD/Intel based 64-bit computer
  • Memory: 4 MB (plus 2 MB for every additional core)
  • Hard Disk: 32 MB

Supported devices

[edit]

Source:[8]

  • Bus - PCIe, PCI, xHCI
  • Non-volatile storage - NVMe, AHCI (SATA), ATA, Virtio-Blk
  • Ethernet - Intel 8259x 10-gigabit, Intel 8254x/8257x Gigabit, Realtek 816x/811x Gigabit, Virtio-Net

One task per core

[edit]

Multitasking on BareMetal is unusual for modern operating systems. BareMetal uses an internal work queue that all CPU cores poll. A task added to the work queue will be processed by any available CPU core in the system and will execute until completion, which results in no context switch overhead.[9]

Programming

[edit]

An API is documented[10] but, in line with its philosophy, the OS does not enforce entry points for system calls (e.g.: no call gates or other safety mechanisms).

BareMetal OS has a build script to pull the latest code, make the needed changes, and then compile C code using[11] the Newlib C standard library.[12]

A mostly-complete C++11 Standard Library was designed and developed for working in ring 0.[13] The main goal of such library is providing, on a library level, an alternative to hardware memory protection used in classical OSes, with help of carefully designed classes.[14]

k for BareMetal:[15] a port of k edu from shakti[16] by Jack Andrews. At this stage, it is just a proof of concept and doesn't integrate the BareMetal file system.

A Rust program demonstration was added to the programs in November 2014, demonstrating the ability to write Rust programs for BareMetal OS.[17]

Networking

[edit]

TCP/IP stack

[edit]

A TCP/IP stack was the #1 feature request.[18] A port of lwIP written in C was announced in October 2014.[19]

minIP,[20] a minimalist IP stack in ANSI C able to provide enough functionalities to serve a simple static webpage, is being developed as a proof of concept to learn the fundamentals in preparation for an x86-64 assembly re-write planned for the future.

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
BareMetal is a minimalist 64-bit operating system designed for compatible computers, developed by Return Infinity as an exokernel that serves primarily as a low-level to hardware, enabling direct access to physical or virtualized resources without the overhead of traditional operating systems. The design philosophy of BareMetal emphasizes extreme efficiency and simplicity, aiming to eliminate by providing only the "bare essentials" for a functional kernel, resulting in a core size under 16 kilobytes. This approach contrasts with conventional operating systems like Windows or , which include extensive layers that can hinder performance in resource-intensive environments. As an exokernel, BareMetal delegates most resource management to applications, allowing developers to optimize directly against hardware for maximum speed and predictability. Key features include support for symmetric multiprocessing (SMP) to utilize multiple CPU cores, basic networking capabilities, and drive access through its , all implemented in pure for x86-64 . Recent updates as of 2025 include booting, NVMe storage support, Virtio network and block drivers, and xHCI with USB keyboard support. It boots from a hard drive or via (PXE), and supports modern hardware extensions such as VT-x and AMD-V for . Applications can be developed in assembly, C/C++, or , with the kernel providing foundational services like and interrupt handling. BareMetal targets high-performance applications, including in supercomputers, low-latency systems, and enterprise where minimizing software overhead is critical. The project, initiated by Return Infinity to optimize server environments, is actively developed with all openly available on for inspection and contribution.

Overview

Core Concepts

BareMetal is an exokernel-based (SASOS) developed by ReturnInfinity, designed to run directly on physical or virtualized hardware for (HPC), (HTC), and cloud environments. It was developed by ReturnInfinity and released under the BSD License, emphasizing open-source accessibility to encourage contributions and learning from its codebase. The core of BareMetal's architecture lies in its exokernel design, which implements a minimal kernel that securely multiplexes hardware resources—such as CPU, , and I/O—directly to applications without imposing traditional operating system abstractions like file systems or management. This approach, inspired by foundational exokernel research, allows applications to manage resources at a low level, enabling customization for specific workloads while the kernel handles only protection and secure allocation to prevent interference between tasks. By avoiding layered abstractions, BareMetal reduces latency and overhead associated with conventional kernel mediation. As a single address space operating system (SASOS), or Simple Abstracted System on a System, BareMetal places all code and data— including the kernel and applications—into one flat, protected 64-bit address space, simplifying memory access and eliminating the need for address translation or copying during inter-component communication. This design minimizes context switching costs and system call overheads, as applications can directly reference global memory without kernel intervention for data transfer. The one-task-per-core model further supports this by assigning dedicated processor cores to individual tasks, promoting efficient parallel execution on multiprocessor systems. Overall, BareMetal's high-level goals center on maximizing raw hardware performance by stripping away unnecessary OS layers, making it suitable for environments where low-level control and are paramount, such as in HPC clusters or virtualized cloud instances running on architectures, with ongoing development and releases as of 2025.

Key Features

BareMetal employs a unique concurrency model where each CPU core executes a single task without preemption or context switching, ensuring deterministic by eliminating traditional scheduling overhead. This approach leverages through an internal work queue that all cores poll, allowing one application to span multiple cores for parallel execution while maintaining simplicity in . As a result, the system achieves low-latency task handling, particularly beneficial for compute-intensive workloads. The kernel maintains a minimal footprint, with its bootable image measuring just 16 KB and implemented primarily in assembly language to optimize efficiency and reduce resource consumption. It eschews conventional features like process scheduling and management, focusing instead on providing protected raw hardware access to applications. This exokernel design enables applications to interact directly with hardware resources—such as network interfaces and storage—through user-level library calls rather than costly system calls, facilitating rapid I/O operations and high computational throughput. Released as under the BSD License, BareMetal's source code has been publicly available on since its inception, allowing developers to inspect, modify, and contribute to the project. The system targets parallel workloads in (HPC) environments, such as cluster nodes for number-crunching tasks, and (HTC) scenarios where predictable, low-latency resource access is essential for algorithm experimentation and scientific simulations.

History

Development Origins

Return Infinity was founded by Ian Seyler, with an initial emphasis on developing innovative operating system designs tailored for performance-critical applications, particularly in environments requiring minimal overhead and direct hardware access. The development of BareMetal originated in the late 2000s as a response to the inefficiencies of traditional operating systems, such as , in (HPC) contexts, where kernel mediation introduced unnecessary latency and resource contention that limited application performance on hardware. Inspired by foundational exokernel research from MIT's Parallel and Distributed Operating Systems group, including the secure kernel and the ExOS library operating system, which demonstrated the benefits of unprivileged to enable applications to handle hardware directly while maintaining protection, Return Infinity sought to create a modern implementation suited for contemporary computing demands. Initial design goals centered on producing a , 64-bit operating system that minimizes kernel intervention, granting applications near-complete control over hardware resources in a model to optimize for compute-intensive tasks like testing and . Early prototypes emerged from broader experiments with simplified OS structures, drawing inspiration from 16-bit systems like MikeOS—a hobbyist real-mode OS that Seyler contributed to—before evolving into a protected-mode, 64-bit framework that abandoned dependencies and adopted a low-level . This shift marked the transition to the (Single Address Space Operating System) paradigm, aligning with exokernel principles to prioritize efficiency over traditional abstractions. Development was primarily a solo effort led by Ian Seyler, leveraging his five years of x86 assembly expertise at the time, with the core kernel implemented entirely in to ensure compactness and performance; occasional input from a small IRC-based provided bug reports and supplementary tools, but the foundational work remained under Return Infinity's direct control.

Release Timeline

BareMetal's first public releases occurred in 2010, marking the introduction of its basic exokernel and (SASOS) design targeted at architectures. This foundational version established the project's core principles of minimalism and assembly-language implementation, evolving from early hobbyist experimentation inspired by simpler systems like MikeOS. Throughout the , BareMetal saw incremental updates focused on expanding hardware compatibility, including the addition of initial device drivers such as support in version 0.5.1, released on , 2010. PCIe functionality was progressively integrated during this period to enable broader peripheral support, laying groundwork for advanced storage and networking capabilities. These enhancements shifted the project from purely experimental roots toward more robust system-level operations. The versioning scheme adopted YYYY.MM format, with comprehensive change tracking beginning in the official repository in 2012, facilitating community contributions and transparent development. In the 2010s, networking received significant attention, highlighted by the integration of the lightweight TCP/IP stack in 2014 through a dedicated port that demonstrated proof-of-concept web server functionality atop the exokernel. This period also emphasized optimizations for efficiency, aligning with (HPC) use cases where low-overhead resource management is critical. The latest stable release, 2025.04 on April 30, 2025, incorporated refinements to language support for applications alongside improved NVMe drivers for high-speed storage, enhancing compatibility with modern PCIe-based peripherals. These updates reflect an ongoing transition to production-ready status for HPC environments, supported by active open-source contributions that prioritize performance and hardware directness. Earlier releases in 2025, such as 2025.06, introduced networking improvements including multi-interface support and receive mechanisms. Subsequent releases, such as 2025.10 on October 29, 2025, continued this momentum with further enhancements.

Architecture

Exokernel and SASOS Design

BareMetal's exokernel is fundamentally minimalist, focusing solely on securely binding physical hardware resources—such as CPU cores, regions, and I/O devices—directly to applications without imposing traditional abstractions like file systems, processes, or management. This design draws from the principles of exokernels developed at MIT, where the kernel's role is limited to low-level protection mechanisms, allowing applications to implement their own tailored policies. In BareMetal, implemented entirely in assembly, this approach ensures that the kernel footprint remains extremely small, typically around 16 KB for the bootable image, enabling direct hardware access with negligible mediation. The exokernel design facilitates efficient resource access by sharing a flat 64-bit address space, allowing seamless interactions between kernel and applications while using hardware protection features like page tables and descriptors to enforce boundaries. Resource allocation in BareMetal occurs via a simple API where applications request direct access to hardware capabilities, such as setting up DMA transfers for I/O devices, with the kernel verifying security constraints like access permissions before granting control. This contrasts sharply with monolithic kernels, which bundle mechanisms and policies into a single layer, or microkernels, which enforce strict message-passing for inter-component communication; instead, BareMetal offloads all policy decisions—such as scheduling or caching strategies—to the applications themselves, promoting customization at the cost of requiring developer expertise. The exokernel design yields significant performance benefits, particularly in reducing latency for I/O-bound workloads by avoiding overheads, making BareMetal suitable for real-time scenarios where predictability and low are critical. For instance, direct hardware binding minimizes intervention in transfer paths, allowing applications to achieve near-native speeds on multi-core systems. This prioritizes efficiency over generality, aligning with exokernel goals of application-level resource optimization. As of 2025, the project is under active development.

Concurrency and Resource Management

BareMetal implements concurrency through a one task per core model, dedicating each CPU core to a single application task without support for intra-core multitasking or interrupt-driven scheduling, thereby achieving zero overhead. This limited multi-tasking assigns one application to each available core in a (SMP) configuration, enabling the distribution of workload across multiple cores for a single program. Resource management follows exokernel principles, where applications handle their own threading and using user-space libraries, while the kernel provides secure arbitration for inter-core shared resources such as and hardware peripherals. Inter-core communication is supported via mechanisms, ensuring efficient data exchange without kernel-mediated of resources. Synchronization relies on lightweight primitives, including hardware atomic operations available in the instruction set and for coordinating tasks across cores, obviating the need for a traditional OS scheduler or heavy locking constructs. This architecture scales effectively on multi-core systems by statically pinning tasks to specific cores at boot time, promoting high throughput in scenarios like workloads. Despite these strengths, the absence of dynamic scheduling renders BareMetal unsuitable for interactive or preemptive applications requiring responsive task switching or real-time interrupts.

Hardware Support

Minimum Requirements

BareMetal requires a 64-bit processor from or to operate, supporting single-core configurations with scalability to multiple cores for enhanced performance through . The minimum memory allocation consists of 4 MiB of RAM, which includes structures, drivers, buffers, and CPU stacks for multi-core operation, enabling efficient utilization in low-resource environments. Storage needs are modest for the kernel image and essential drivers; the system supports from USB drives or over a network, facilitating flexible deployment without reliance on large storage volumes. Initial relies on standard PC or firmware, and no dedicated GPU or advanced peripherals are necessary for fundamental functionality, keeping the setup accessible for basic hardware platforms. The overall installation footprint remains compact, with the kernel occupying less than 32 KiB, allowing for modular expansion through optional drivers as needed.

Compatible Devices and Peripherals

BareMetal supports a range of expansion buses and interfaces to enable hardware integration for I/O and add-in cards. It provides full compatibility with PCIe for high-speed peripherals and legacy PCI for older expansion cards, allowing direct access to attached devices through the exokernel's low-level abstraction. Additionally, xHCI controllers are supported for USB 3.0 interfaces, facilitating basic connectivity without a complete USB protocol stack. For storage devices, BareMetal includes drivers for modern and legacy block I/O protocols. NVMe drives are supported via a dedicated driver for high-performance solid-state storage, while AHCI enables SATA connections for contemporary hard drives and SSDs. Virtio-Blk provides block device access in virtualized setups like QEMU or VirtualBox. Network interfaces in BareMetal focus on Ethernet controllers for packet transmission. Supported hardware includes Intel 8254x Gigabit Ethernet (e1000 driver), Intel 8257x Gigabit (e1000e), Intel 8259x 10-Gigabit (ixgbe), and Virtio-Net is available for efficient networking in virtual environments, with updates enabling multiple NIC configurations for advanced setups as of version 2025.08. Other peripherals are limited to essentials for input and virtualized operations. Basic keyboard and support is provided through PS/2 ports, with USB keyboards accessible via the xHCI driver, though no broader USB mass storage or device classes are implemented. Basic graphics output is available via (80x25 characters, 16 colors) or Linear (LFB) with 1024x768 resolution at 32 bits per pixel as a fallback. Virtio interfaces extend compatibility to virtualized peripherals beyond networking and storage. The driver model in BareMetal emphasizes minimalism, with assembly-language drivers loaded during the boot process via or . These drivers handle direct hardware interaction without higher-level abstractions, and community contributions for additional peripherals are hosted on , allowing extensions through open-source pull requests.

Programming

Application Programming Interface

BareMetal employs a library-based (API) rather than traditional system calls, enabling applications to bind directly to hardware resources through thin wrappers around kernel exports. This approach aligns with the exokernel by delegating policy decisions—such as and scheduling—to the application level, while the kernel provides only essential mechanisms for . The facilitates direct access to CPU cores, regions, and I/O ports, promoting efficiency in a single environment. Documentation for the is maintained in the project's repository under the /doc directory, including assembly-language headers that detail low-level usage for developers. Central to the API are functions for hardware binding and . Applications can pin tasks to specific CPU cores to support with dedicated execution contexts and minimal overhead. Physical memory regions can be mapped into the application's address space for efficient data sharing and hardware interaction. I/O operations allow direct read/write access to device ports, bypassing intermediary layers. (IRQ) handling supports direct vector registration, enabling applications to install custom handlers for hardware events and enhancing responsiveness in performance-critical scenarios. These mechanisms support core allocation, memory mapping, and peripheral integration without invoking traditional syscalls. The API's design philosophy underscores minimal intervention, treating kernel exports as foundational that applications extend with their own logic, thereby maximizing control and minimizing latency. Error handling relies on lightweight mechanisms suitable for performance-oriented code. This structure encourages developers to implement robust policy at the while leveraging the kernel's bare-essentials footprint.

Supported Languages

BareMetal supports the development of applications in Assembly, C, C++, and Rust, enabling developers to leverage different levels of abstraction while interfacing with the exokernel's API. The operating system itself, including the kernel and drivers, is written entirely in x86-64 Assembly language, which serves as the primary language for low-level core functionality and utilizes direct hardware intrinsics for performance-critical operations. C language support is provided through a dedicated port of the Newlib lightweight C standard library, which supplies essential functions like printf and memcpy without relying on a full hosted environment. Applications in C are compiled using a GCC cross-compiler targeting x86-64, with includes from Newlib headers (-I newlib-3.3.0/newlib/libc/include/) and linkage against the built libc.a library as well as BareMetal-specific headers for API access. The compilation process on a host Linux system involves running a build script (./build-newlib.sh) to generate the library, followed by linking with a custom linker script (e.g., ld -T app.ld -o app crt0.o app.o libc.a), resulting in standalone executables with no external runtime dependencies beyond the kernel's API. C++ support extends from the C foundation, allowing compilation of C++ code with the same GCC toolchain and Newlib integration, but limited to features and subsets of the due to the exokernel's single constraints, which preclude full STL components requiring dynamic allocation or hosted runtime support; emphasis is placed on low-level features such as templates for development. Rust integration enables no_std applications, where crates operate without the standard library by interfacing with BareMetal's API through foreign function interfaces (FFI). Applications are cross-compiled using the Rust toolchain for x86-64 targets, linked similarly to C programs against any necessary kernel libraries, and run with minimal dependencies confined to the exokernel's services. Across all supported languages, the general compilation workflow involves cross-compiling on a host operating system (typically Linux), statically linking against provided libraries like Newlib for C/C++ or core crates for Rust, and producing flat binaries that load directly into the single address space without additional runtime overhead. As of March 2025, BareMetal remains in active development, with recent additions including NVMe and UEFI support that may enhance hardware access for applications, though core programming interfaces are based on established documentation.

Networking

TCP/IP Implementation

BareMetal OS implements its networking stack through a port of the (Lightweight IP) library, a compact TCP/IP protocol suite optimized for resource-constrained environments. This core stack provides support for TCP, UDP, and ICMP protocols, enabling reliable data transmission, , and basic network diagnostics, respectively. The integration maintains a minimal footprint, typically under 100 KB for code and tens of kilobytes for runtime memory, aligning with BareMetal's exokernel philosophy of low overhead. Key features include full IPv4 support for addressing and routing, alongside a basic socket-like API exposed through BareMetal's libraries for application integration. Unlike traditional systems, it eschews a complete BSD sockets interface to preserve the exokernel's direct hardware access model, instead favoring lwIP's raw or netconn APIs for efficiency. Performance is enhanced via direct hardware DMA for packet processing, leveraging supported network controllers to bypass unnecessary copying and reduce latency. This integrates seamlessly with BareMetal's concurrency model, assigning one task per core to handle networking operations in parallel across multiple processors for high-throughput applications. Configuration occurs primarily through compile-time options in lwIP's lwipopts.h file, allowing tuning of stack sizes, buffer allocations, and protocol modules; it supports both DHCP for dynamic addressing and static IP assignment.

Network Hardware Integration

BareMetal integrates network hardware primarily through low-level, assembly-language drivers that provide direct access to Ethernet controllers without intermediate layers beyond the exokernel's resource management. The supported drivers encompass Intel's 8254x series (e1000), 8257x series (e1000e), and 82598/82599 series (ixgbe) adapters, as well as Realtek's RTL816x/811x family (rtl8169). Additionally, a Virtio-Net driver handles paravirtualized networking devices. These drivers expose transmit and receive buffers directly to the networking stack via simple mappings defined by the exokernel, enabling efficient raw hardware interaction in a single environment. The lightweight TCP/IP stack interfaces with these drivers through a custom port that leverages BareMetal's for buffer management and device control, allowing the stack to perform direct memory operations on packet data. In operation, applications bind to network interfaces by invoking BareMetal's with parameters such as , subnet mask, and gateway, after which the exokernel routes hardware interrupts to specific CPU cores for processing. This setup supports for parallel handling of network events, optimizing throughput in multi-core configurations. For virtualized deployments, the Virtio-Net driver facilitates compatibility with hypervisors including and , presenting a standardized interface for virtual Ethernet devices in cloud and scenarios. This integration ensures that BareMetal can operate within emulated environments while maintaining direct access to virtualized network resources. The networking prioritizes wired, high-speed Ethernet connections for maximum , omitting support for wireless interfaces or advanced features like protocols. Testing is facilitated through bootable disk images in the project repository, which demonstrate core functionalities such as ICMP ping responsiveness and basic TCP servers (e.g., an HTTP server application) in -based simulations with inter-instance connectivity.
Add your contribution
Related Hubs
User Avatar
No comments yet.