Software:BareMetal

From HandWiki
BareMetal
DeveloperReturn Infinity
Written inAssembly
Working stateCurrent
Source modelOpen source
Initial release2008; 18 years ago (2008)
|Final release|Latest release}}2025.04 / April 30, 2025; 8 months ago (2025-04-30)[1]
Marketing targetHPCs, HTC, Cloud computing
Available inEnglish
Platformsx86-64
Kernel typeExokernel, SASOS
UserlandUnknown
Default user interfaceCommand-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

Hardware requirements

Source:[7]

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

Supported devices

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

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

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

TCP/IP stack

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

  1. Seyler, Ian. "Releases · ReturnInfinity/BareMetal". BareMetal OS GitHub repository. https://github.com/ReturnInfinity/BareMetal/releases. Retrieved May 19, 2025. 
  2. 2.0 2.1 Voorsanger, Conrad (June 2, 2011). "Interview With Baremetal OS' Ian Seyler". OSNews. http://www.osnews.com/story/24815/Interview_With_Baremetal_OS_Ian_Seyler. Retrieved May 26, 2014. 
  3. Adams, David (July 14, 2010). "BareMetal OS". OSNews. http://www.osnews.com/story/23556/BareMetal_OS. Retrieved May 26, 2014. 
  4. Benchoff, Brian (May 27, 2011). "64-bit OS written entirely in assembly". Hack A Day. http://hackaday.com/2011/05/27/64-bit-os-written-entirely-in-assembly/. Retrieved May 26, 2014. 
  5. Seyler, Ian. "Return Infinity (home page), The BareMetal advantage". Return Infinity. http://www.returninfinity.com/. Retrieved February 2, 2015. 
  6. Smith, Jesse (July 19, 2010). "DistroWatch Weekly, Issue 363". DistroWatch. http://distrowatch.com/weekly.php?issue=20100719. Retrieved May 26, 2014. 
  7. "BareMetal OS Requirements". Return Infinity (archived copy at Wayback Machine). Archived from the original on September 6, 2014. https://web.archive.org/web/20140906120230/http://www.returninfinity.com/baremetal.html#spec_list. Retrieved September 6, 2014. 
  8. Seyler, Ian. "Supported Hardware". BareMetal OS GitHub repository. https://github.com/ReturnInfinity/BareMetal/blob/master/doc/Supported%20Hardware.md. Retrieved May 19, 2025. 
  9. "BareMetal OS Queue". https://vimeo.com/13423853. Retrieved April 28, 2015. 
  10. Seyler, Ian. "API documentation". BareMetal OS GitHub repository. https://github.com/ReturnInfinity/BareMetal-OS/blob/master/docs/BareMetal%20OS%20-%20API.md. Retrieved June 26, 2015. 
  11. Seyler, Ian (January 17, 2014). "Newlib build script". BeareMetal OS Google Group. https://groups.google.com/forum/#!msg/baremetal-os/oxhjHA_B5-U/LqDSfOSHr5UJ. Retrieved February 2, 2015. 
  12. Seyler, Ian. "newlib.sh". Build scripts for BareMetal OS and its related utilities, GitHub repository. https://github.com/ReturnInfinity/BareMetal/blob/master/newlib.sh. Retrieved February 2, 2015. 
  13. Lodyagin, Sergei (November 17, 2013). "Bare C++ library". BeareMetal OS Google Group. https://groups.google.com/d/msg/baremetal-os/-EnSOPQJiwg/lCvg_0y4-xMJ. Retrieved February 2, 2015. 
  14. Lodyagin, Sergei. "The Bare C++ library". The Bare C++ library GitHub repository. https://github.com/lodyagin/bare_cxx. Retrieved February 2, 2015. 
  15. Andrews, Jack (December 10, 2024). "ReturnInfinity/kbm: k for BareMetal". BeareMetal OS port of k edu. https://github.com/ReturnInfinity/kbm. Retrieved May 19, 2025. 
  16. Whitney, Arthur. "shakti". k edu at shakti. https://shakti.com. Retrieved May 19, 2025. 
  17. Seyler, Ian. "Add Rust example". BareMetal OS GitHub repository (legacy version). https://github.com/ReturnInfinity/BareMetal-OS-legacy/commit/740d2b2359f51283cc269c26a6121a156b3db285. Retrieved March 18, 2018. 
  18. Seyler, Ian (August 22, 2013). "TCP/IP". BeareMetal OS Google Group. https://groups.google.com/forum/#!msg/baremetal-os/f-7NGTEIZ6k/pdeqgPW29GIJ. Retrieved February 2, 2015. 
  19. Seyler, Ian (October 31, 2014). "BareMetal and lwIP". BeareMetal OS Google Group. https://groups.google.com/forum/#!msg/baremetal-os/Lfeb-9GXPc0/fpkhnIp1LckJ. Retrieved February 2, 2015. 
  20. Seyler, Ian. "minIP - A minimalist IP stack written in ANSI C". BareMetal OS GitHub repository. https://github.com/IanSeyler/minIP. Retrieved May 24, 2017.