ArticleslgStudy

computer science

BareMetal

BareMetal is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand BareMetal rather than just read about it. In short: 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 with a "just enough operating system" (JeOS) approach.

Key takeaways

  • BareMetal belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect BareMetal to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of BareMetal from memory before moving on to harder problems.

Reference excerpt

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 with a "just enough operating system" (JeOS) approach. 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, and it is a recent example of an operating system that is not written in C or C++, nor based on Unix-like kernels.

Overview

Hardware requirements Source:

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

Supported devices Source:

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.

Programming

API An API is documented 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).

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

C++ A mostly-complete C++11 Standard Library was designed and developed for working in ring 0. 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.

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

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

Networking

TCP/IP stack A TCP/IP stack was the #1 feature request. A port of lwIP written in C was announced in October 2014. minIP, 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

External links ReturnInfinity on GitHub BareMetal OS Google Group discussion forum

Worked examples

Example 1 — a first encounter with BareMetal

Start with the simplest possible case. Write down what BareMetal claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to BareMetal before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about BareMetal ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of BareMetal

In research
BareMetal appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses BareMetal in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
BareMetal is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free software operating systems, Hobbyist operating systems, Microkernels, so understanding it makes those chapters shorter.
In everyday life
Look for BareMetal outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “BareMetal” →

How to study BareMetal in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what BareMetal means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain BareMetal out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is BareMetal in simple terms?

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 with a "just enough operating system" (JeOS) approach.

Why does BareMetal matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study BareMetal?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on BareMetal.

Tags

  • Free software operating systems
  • Hobbyist operating systems
  • Microkernels
  • Operating system stubs
  • Software programmed in assembly language
  • Software using the BSD license
  • X86-64 operating systems

Keep exploring