Recent from talks
Nothing was collected or created yet.
BareMetal
View on WikipediaThis article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
| BareMetal | |
|---|---|
| Developer | Return Infinity |
| Written in | Assembly |
| Working state | Current |
| Source model | Open source |
| Initial release | 2008 |
| Latest release | 2025.04 / April 30, 2025[1] |
| Marketing target | HPCs, HTC, Cloud computing |
| Available in | English |
| Supported platforms | x86-64 |
| Kernel type | Exokernel, SASOS |
| Userland | Unknown |
| Default user interface | Command-line |
| License | BSD License[2] |
| Official website | www |
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]
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]- ^ Seyler, Ian. "Releases · ReturnInfinity/BareMetal". BareMetal OS GitHub repository. Retrieved May 19, 2025.
- ^ a b Voorsanger, Conrad (June 2, 2011). "Interview With Baremetal OS' Ian Seyler". OSNews. Retrieved May 26, 2014.
- ^ Adams, David (July 14, 2010). "BareMetal OS". OSNews. Retrieved May 26, 2014.
- ^ Benchoff, Brian (May 27, 2011). "64-bit OS written entirely in assembly". Hack A Day. Retrieved May 26, 2014.
- ^ Seyler, Ian. "Return Infinity (home page), The BareMetal advantage". Return Infinity. Retrieved February 2, 2015.
- ^ Smith, Jesse (July 19, 2010). "DistroWatch Weekly, Issue 363". DistroWatch. Retrieved May 26, 2014.
- ^ "BareMetal OS Requirements". Return Infinity (archived copy at Wayback Machine). Archived from the original on September 6, 2014. Retrieved September 6, 2014.
- ^ Seyler, Ian. "Supported Hardware". BareMetal OS GitHub repository. Retrieved May 19, 2025.
- ^ "BareMetal OS Queue". Retrieved April 28, 2015.
- ^ Seyler, Ian. "API documentation". BareMetal OS GitHub repository. Retrieved June 26, 2015.
- ^ Seyler, Ian (January 17, 2014). "Newlib build script". BeareMetal OS Google Group. Retrieved February 2, 2015.
- ^ Seyler, Ian. "newlib.sh". Build scripts for BareMetal OS and its related utilities, GitHub repository. Retrieved February 2, 2015.
- ^ Lodyagin, Sergei (November 17, 2013). "Bare C++ library". BeareMetal OS Google Group. Retrieved February 2, 2015.
- ^ Lodyagin, Sergei. "The Bare C++ library". The Bare C++ library GitHub repository. Retrieved February 2, 2015.
- ^ Andrews, Jack (December 10, 2024). "ReturnInfinity/kbm: k for BareMetal". BeareMetal OS port of k edu. Retrieved May 19, 2025.
- ^ Whitney, Arthur. "shakti". k edu at shakti. Retrieved May 19, 2025.
- ^ Seyler, Ian. "Add Rust example". BareMetal OS GitHub repository (legacy version). Retrieved March 18, 2018.
- ^ Seyler, Ian (August 22, 2013). "TCP/IP". BeareMetal OS Google Group. Retrieved February 2, 2015.
- ^ Seyler, Ian (October 31, 2014). "BareMetal and lwIP". BeareMetal OS Google Group. Retrieved February 2, 2015.
- ^ Seyler, Ian. "minIP - A minimalist IP stack written in ANSI C". BareMetal OS GitHub repository. Retrieved May 24, 2017.
External links
[edit]- ReturnInfinity on GitHub
- BareMetal OS Google Group discussion forum
BareMetal
View on GrokipediaOverview
Core Concepts
BareMetal is an exokernel-based single address space operating system (SASOS) developed by ReturnInfinity, designed to run directly on physical or virtualized x86-64 hardware for high-performance computing (HPC), high-throughput computing (HTC), and cloud environments.[2][3] It was developed by ReturnInfinity and released under the BSD License, emphasizing open-source accessibility to encourage contributions and learning from its codebase.[5] The core of BareMetal's architecture lies in its exokernel design, which implements a minimal kernel that securely multiplexes hardware resources—such as CPU, memory, and I/O—directly to applications without imposing traditional operating system abstractions like file systems or virtual memory management.[2] 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.[6] 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.[2] 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.[3] 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 efficiency are paramount, such as in HPC clusters or virtualized cloud instances running on x86-64 architectures, with ongoing development and releases as of 2025.[2][3]Key Features
BareMetal employs a unique concurrency model where each CPU core executes a single task without preemption or context switching, ensuring deterministic performance by eliminating traditional scheduling overhead.[5] This approach leverages symmetric multiprocessing through an internal work queue that all cores poll, allowing one application to span multiple cores for parallel execution while maintaining simplicity in resource allocation.[7] 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 x86-64 assembly language to optimize efficiency and reduce resource consumption.[3] It eschews conventional features like process scheduling and virtual memory management, focusing instead on providing protected raw hardware access to applications.[5] 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.[7] Released as open-source software under the BSD License, BareMetal's source code has been publicly available on GitHub since its inception, allowing developers to inspect, modify, and contribute to the project.[5][3] The system targets parallel workloads in high-performance computing (HPC) environments, such as cluster nodes for number-crunching tasks, and high-throughput computing (HTC) scenarios where predictable, low-latency resource access is essential for algorithm experimentation and scientific simulations.[5][7]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 Linux, in high-performance computing (HPC) contexts, where kernel mediation introduced unnecessary latency and resource contention that limited application performance on x86-64 hardware.[1] Inspired by foundational exokernel research from MIT's Parallel and Distributed Operating Systems group, including the Aegis secure kernel and the ExOS library operating system, which demonstrated the benefits of unprivileged resource management to enable applications to handle hardware directly while maintaining protection, Return Infinity sought to create a modern implementation suited for contemporary computing demands.[8] Initial design goals centered on producing a lightweight, 64-bit operating system that minimizes kernel intervention, granting applications near-complete control over hardware resources in a single address space model to optimize for compute-intensive tasks like algorithm testing and data processing. 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 BIOS dependencies and adopted a low-level abstraction layer. This shift marked the transition to the SASOS (Single Address Space Operating System) paradigm, aligning with exokernel principles to prioritize efficiency over traditional abstractions.[5] 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 assembly language to ensure compactness and performance; occasional input from a small IRC-based community provided bug reports and supplementary tools, but the foundational work remained under Return Infinity's direct control.[5]Release Timeline
BareMetal's first public releases occurred in 2010, marking the introduction of its basic exokernel and single address space operating system (SASOS) design targeted at x86-64 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.[5] Throughout the 2010s, BareMetal saw incremental updates focused on expanding hardware compatibility, including the addition of initial device drivers such as Gigabit Ethernet support in version 0.5.1, released on March 3, 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.[7] The versioning scheme adopted YYYY.MM format, with comprehensive change tracking beginning in the official GitHub repository in 2012, facilitating community contributions and transparent development. In the 2010s, networking received significant attention, highlighted by the integration of the lwIP 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 high-performance computing (HPC) use cases where low-overhead resource management is critical.[3][9][10] The latest stable release, 2025.04 on April 30, 2025, incorporated refinements to Rust 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 zero-copy receive mechanisms. Subsequent releases, such as 2025.10 on October 29, 2025, continued this momentum with further enhancements.[11][4][12]Architecture
Exokernel and SASOS Design
BareMetal's exokernel architecture is fundamentally minimalist, focusing solely on securely binding physical hardware resources—such as CPU cores, memory regions, and I/O devices—directly to applications without imposing traditional abstractions like file systems, processes, or virtual memory management.[13][3] 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 resource management policies. In BareMetal, implemented entirely in x86-64 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.[3] 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.[3] 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.[13] The exokernel design yields significant performance benefits, particularly in reducing latency for I/O-bound workloads by avoiding abstraction overheads, making BareMetal suitable for real-time high-performance computing scenarios where predictability and low jitter are critical.[3] For instance, direct hardware binding minimizes intervention in data transfer paths, allowing applications to achieve near-native speeds on multi-core x86-64 systems.[3] This architecture prioritizes efficiency over generality, aligning with exokernel goals of application-level resource optimization.[13] As of 2025, the project is under active development.[4]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 context switch overhead. This limited multi-tasking assigns one application to each available core in a symmetric multiprocessing (SMP) configuration, enabling the distribution of workload across multiple cores for a single program.[5][3] Resource management follows exokernel principles, where applications handle their own threading and resource allocation using user-space libraries, while the kernel provides secure arbitration for inter-core shared resources such as memory and hardware peripherals. Inter-core communication is supported via shared memory mechanisms, ensuring efficient data exchange without kernel-mediated virtualization of resources.[3] Synchronization relies on lightweight primitives, including hardware atomic operations available in the x86-64 instruction set and message passing for coordinating tasks across cores, obviating the need for a traditional OS scheduler or heavy locking constructs.[3] This architecture scales effectively on multi-core x86-64 systems by statically pinning tasks to specific cores at boot time, promoting high throughput in parallel computing scenarios like high-performance computing workloads.[3] Despite these strengths, the absence of dynamic scheduling renders BareMetal unsuitable for interactive or preemptive applications requiring responsive task switching or real-time interrupts.[5]Hardware Support
Minimum Requirements
BareMetal requires a 64-bit x86-64 processor from AMD or Intel to operate, supporting single-core configurations with scalability to multiple cores for enhanced performance through symmetric multiprocessing.[3] 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.[3] Storage needs are modest for the kernel image and essential drivers; the system supports booting from USB drives or over a network, facilitating flexible deployment without reliance on large storage volumes.[3] Initial booting relies on standard PC BIOS or UEFI firmware, and no dedicated GPU or advanced peripherals are necessary for fundamental functionality, keeping the setup accessible for basic hardware platforms.[3] The overall installation footprint remains compact, with the kernel occupying less than 32 KiB, allowing for modular expansion through optional drivers as needed.[3]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.[14] 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.[14][4] 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.[14][4] Other peripherals are limited to essentials for input and virtualized operations. Basic keyboard and mouse 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 VGA text mode (80x25 characters, 16 colors) or Linear Framebuffer (LFB) with 1024x768 resolution at 32 bits per pixel as a fallback. Virtio interfaces extend compatibility to virtualized peripherals beyond networking and storage.[14][4] The driver model in BareMetal emphasizes minimalism, with assembly-language drivers loaded during the boot process via BIOS or UEFI. These drivers handle direct hardware interaction without higher-level abstractions, and community contributions for additional peripherals are hosted on GitHub, allowing extensions through open-source pull requests.[14]Programming
Application Programming Interface
BareMetal employs a library-based Application Programming Interface (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 design by delegating policy decisions—such as resource allocation and scheduling—to the application level, while the kernel provides only essential mechanisms for hardware abstraction. The API facilitates direct access to CPU cores, memory regions, and I/O ports, promoting efficiency in a single address space environment. Documentation for the API is maintained in the project's GitHub repository under the /doc directory, including assembly-language headers that detail low-level usage for developers.[3] Central to the API are functions for hardware binding and resource management. Applications can pin tasks to specific CPU cores to support symmetric multiprocessing 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 port operations allow direct read/write access to device ports, bypassing intermediary layers. Interrupt request (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.[3] The API's design philosophy underscores minimal intervention, treating kernel exports as foundational primitives 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 application layer while leveraging the kernel's bare-essentials footprint.[3]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.[15] 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.[15] C language support is provided through a dedicated port of the Newlib lightweight C standard library, which supplies essential functions likeprintf 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.[16]
C++ support extends from the C foundation, allowing compilation of C++ code with the same GCC toolchain and Newlib integration, but limited to C++11 features and subsets of the standard library due to the exokernel's single address space constraints, which preclude full STL components requiring dynamic allocation or hosted runtime support; emphasis is placed on low-level features such as templates for driver development.[15][16]
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.[15]
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.[15][16][4]
