Bare-metal programming means writing software that runs directly on the hardware with no operating system underneath it.1
Overview
On a microcontroller, bare-metal code is the firmware itself: it configures the chip’s peripheral registers by hand, manages its own memory, and typically runs as a “super loop” — an endless main loop that does work, with interrupts handling time-critical events. There is no scheduler, no driver model, and no abstraction between your code and the silicon, which means total control and minimal overhead, but also total responsibility for timing and correctness.
Trade-offs
Bare metal is the right choice for the simplest, smallest, or most timing-sensitive embedded systems, where an OS would only add size and unpredictability. It boots instantly and wastes no resources. The cost shows up as a project grows: juggling many concurrent jobs by hand becomes error-prone, which is the point at which developers adopt a real-time operating system. New firmware is loaded by in-system programming or a bootloader.
Sources
-
Bare machine — Wikipedia, on running software directly on hardware. ↩