# Bare machine

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Bare_machine
> Markdown URL: https://mediated.wiki/source/Bare_machine.md
> Source: https://en.wikipedia.org/wiki/Bare_machine
> Source revision: 1342750907
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{short description|Computer without an operating system}}
{{Redirect|Bare metal}}
{{distinguish|Bare-metal server}}

In [information technology](/source/information_technology), a '''bare machine''' (or '''bare-metal computer''') is a [computer](/source/computer) which has no [operating system](/source/operating_system).<ref name="databank">{{cite web |title=Understanding Bare Metal: Exploring the Meaning and Benefits |url=https://www.databank.com/resources/blogs/what-is-bare-metal-meaning/ |publisher=DataBank |date=12 January 2023|access-date=17 January 2025}}</ref> The software executed by a bare machine, commonly called a ''bare metal program'' or ''bare metal application'',<ref>{{cite web |title=Bare Metal Overview |url=https://www.intel.com/content/www/us/en/docs/programmable/683211/current/bare-metal-overview.html#:~:text=Firmware%20applications%20intended%20to%20run,and%20run%20without%20an%20OS. |publisher=Intel |access-date=17 January 2025}}</ref> is designed to interact directly with hardware. Bare machines are widely used in [embedded system](/source/embedded_system)s, particularly in cases where resources are limited or high performance is required.<ref>{{cite web |last1=Beningo |first1=Jacob |title=Is Bare-Metal Programming Dead? |url=https://www.designnews.com/embedded-systems/is-bare-metal-programming-dead- |publisher=DesignNews |access-date=17 January 2025}}</ref>

==Bare machine computing==

'''Bare Machine Computing''' is a computing paradigm in which application software runs directly on a bare machine as a single, stand-alone executable, without an operating system or device drivers. The application software has direct access to hardware resources, and there is typically no distinction between user and kernel mode. It is self-managed software that boots, loads and runs without using any other software components. Bare metal programs are typically written in a close-to-hardware language such as [C](/source/C_(programming_language)) or [assembly language](/source/assembly_language).<ref>{{Cite web|url=https://arobenko.gitbooks.io/bare_metal_cpp/content|title=Practical Guide to Bare Metal C++|access-date=December 16, 2022}}</ref>

== Advantages ==

Typically, a bare-metal application will run faster, use less memory and be more power efficient than an equivalent program that relies on an operating system, due to the inherent overhead imposed by [system call](/source/system_call)s. For example, hardware inputs and outputs are directly accessible to bare metal software, whereas they must usually be accessed through system calls when using an OS.<ref>{{Cite journal|url=https://pages.cs.wisc.edu/~remzi/Classes/838/Spring2013/Papers/eli.pdf|doi = 10.1145/2248487.2151020|title = ELI: bare-metal performance for I/O virtualization|year = 2012|last1 = Gordon|first1 = Abel|last2 = Amit|first2 = Nadav|last3 = Har'El|first3 = Nadav|last4 = Ben-Yehuda|first4 = Muli|last5 = Landau|first5 = Alex|last6 = Schuster|first6 = Assaf|last7 = Tsafrir|first7 = Dan|journal = ACM SIGPLAN Notices|volume = 47|issue = 4|pages = 411–422|url-access = subscription}}</ref> It has no OS and therefore has no OS-related vulnerabilities.

== Disadvantages ==
Bare metal applications typically require more effort to develop because operating system services such as memory management and task scheduling are not available.

Debugging a bare-metal program may be complicated by factors such as:
* Lack of a standard output.
* The target machine may differ from the hardware used for program development (e.g., [emulator](/source/emulator), simulator). This forces setting up a way to load the bare-metal program onto the target ([flashing](/source/Firmware)), start the program execution and access the target resources.

== Examples ==

=== Early computers ===
Early computers, such as the [PDP-11](/source/PDP-11), allowed programmers to load a program, supplied in [machine code](/source/machine_code), to [RAM](/source/RAM). The resulting operation of the program could be monitored by [lights](/source/Blinkenlights), and output derived from [magnetic tape](/source/magnetic_tape), print devices, or [storage](/source/Computer_data_storage).

[Amdahl UTS](/source/Amdahl_UTS)'s performance improves by 25% when run on bare metal without [VM](/source/VM_(operating_system)), the company said in 1986.<ref>{{cite news |first=Jeffry |last=Beeler |newspaper=Computerworld |date=27 January 1986 |title=Amdahl broadens Unix-based UTS line |url=https://books.google.com/books?id=33QfOHT69aMC&pg=PA13}}</ref>

=== Embedded systems ===
{{Wikibooks|Embedded Systems|Super Loop Architecture}}
Bare machine programming is a common practice in [embedded system](/source/embedded_system)s, in which [microcontroller](/source/microcontroller)s or [microprocessor](/source/microprocessor)s boot directly into monolithic, single-purpose software without loading an operating system. Such [embedded software](/source/embedded_software) can vary in structure. For example, one such program paradigm, known as ''foreground-background'' or '''superloop''' architecture, consists of an infinite [main loop](/source/main_loop) in which each task is executed sequentially and must [voluntarily return control back to the loop](/source/Cooperative_multitasking).<ref>{{cite web |last1=Niedźwiedź |first1=Krzysztof |title=Embedded Systems Programming: A Foreground-Background (“Superloop”) Architecture |url=https://intechhouse.com/blog/embedded-systems-programming-a-foreground-background-superloop-architecture/ |access-date=17 January 2025}}</ref> The loop runs these cooperative ''background'' processes that are not time-critical, while [interrupt service routine](/source/interrupt_service_routine)s momentarily interrupt the loop to handle time-critical foreground tasks.<ref>{{Cite web |date=2016-06-30 |title=Basic concepts |url=https://micro-os-plus.github.io/user-manual/basic-concepts/ |access-date=2026-01-28 |website=µOS++ |language=en |quote=An application consists of an infinite loop that calls one or more functions in succession to perform the desired operations (background). Interrupt service routines (ISRs) are used to handle the asynchronous, real-time parts of the application (foreground).}}</ref>

== See also ==
* [Barebone computer](/source/Barebone_computer)
* [Standalone program](/source/Standalone_program)

== References ==
{{Reflist}}

==Further reading==
* {{cite book|first1=A.|last1=Silberschatz|first2=Peter|last2=Galvin|first3=Greg|last3=Gagne|title=Operating System Concepts|year=2003|publisher=Wiley |isbn=9780471250609|url=https://archive.org/details/operatingsystemc0006silb|url-access=registration}}

Category:Classes of computers
Category:History of software
Category:Operating systems

---
Adapted from the Wikipedia article [Bare machine](https://en.wikipedia.org/wiki/Bare_machine) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Bare_machine?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
