Questions tagged [bare-metal]

In a bare-metal environment, the software runs directly on the hardware (CPU, microprocessor, etc) without the intermediary layer of an operating system.

There are multiple definitions for the term bare metal, (bare-metal, baremetal). This tag is specific to the definition meaning without an operating system.

https://en.wikipedia.org/wiki/Bare_machine

The software/firmware talks directly to the hardware and peripherals without running on top of an operating system.

A typical use case is firmware running on a microcontroller that manages the peripherals directly and doesnt use an RTOS. Some bootloaders for microprocessors would also fall into this category.

See other tags for bare metal server and other definitions.

539 questions
94
votes
10 answers

How do I create a "spacer" in a C++ class memory structure?

The issue In a low level bare-metal embedded context, I would like to create a blank space in the memory, within a C++ structure and without any name, to forbid the user to access such memory location. Right now, I have achieved it by putting an…
J Faucher
  • 988
  • 6
  • 14
42
votes
1 answer

What are "nosys", "nano", "rdimon" terms when using ARM GCC?

I am learning to write ARM code using the GCC toolchain. I've run into a few GCC options that I cannot find documentation for. Could someone please help explain what they do? -specs=nosys.specs -specs=nano.specs -specs=rdimon.specs -lnosys How do…
puritii
  • 1,069
  • 1
  • 7
  • 18
24
votes
3 answers

Docker on bare metal?

On the Docker website I see mention of Docker on "bare metal". Does this mean that you can run Docker on hardware with no underlying OS? If so, how would one install/implement it?
Lloyd R. Prentice
  • 4,329
  • 3
  • 21
  • 31
15
votes
2 answers

How to format output to a byte array with no_std and no allocator?

I want to do something like: let x = 123; let mut buf = [0 as u8; 20]; format_to!(x --> buf); assert_eq!(&buf[..3], &b"123"[..]); With #![no_std] and without any memory allocator. As I understand, there is an implementation of core::fmt::Display…
Andrey Tonkih
  • 331
  • 2
  • 8
15
votes
1 answer

How to produce a minimal BIOS hello world boot sector with GCC that works from a USB stick on real hardware?

I have managed to produce a minimal boot sector that works with QEMU 2.0.0 Ubuntu 14.04: .code16 .global _start _start: cli mov $msg, %si mov $0x0e, %ah loop: lodsb or %al, %al jz halt int $0x10 jmp loop halt: …
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
15
votes
6 answers

How to cleanly exit QEMU after executing bare metal program without user intervention?

I am assembling a cross compiling unit testing rig for an ARM system and running the tests on a host machine with qemu-system-arm. Specifically, I'm using qemu to emulate the Stellaris LM3S6965 eval board as it contains a Cortex M3 processor like my…
13
votes
4 answers

How to prevent inclusion of C library destructors and atexit()?

Using arm-none-eabi-gcc for Cortex-M4 (baremetal application), the code for malloc is also emitted even though I never use malloc in my code. Seeing the assembly output with arm-none-eabi-objdump -xS obj.elf, it seems that malloc is called by…
user80551
  • 1,134
  • 2
  • 15
  • 26
12
votes
1 answer

How to write to screen with video memory address 0xb8000 from real mode?

I created simple code to load second sector from hard drive, and then write to whole screen, with spaces with red background. The problem is that always instead of spaces I got @ signs. This is the code: org 0x7C00 bits 16 xor ax,ax mov ds,ax mov…
vakus
  • 732
  • 1
  • 10
  • 24
11
votes
1 answer

How do I know where the .data section needs to get the init data from? (gcc linker)

When building a gcc based bare metal mcu project you need to take care of the initialization of the .data and .bss sections during startup. The .bss section is quite easy since I just fill the entire section to 0. But variables in the .data section…
Johan
  • 20,067
  • 28
  • 92
  • 110
11
votes
1 answer

Setting up a bare metal x86 Ada toolchain

Please forgive the somewhat broad question. I'm wondering how to create an Ada toolchain targeting bare-metal x86. I've seen Lucretia's Ada Bare Bones tutorial on osdev.org, which provides some useful information about building a suitable runtime…
ajxs
  • 3,347
  • 2
  • 18
  • 33
11
votes
1 answer

How to write dynamic loader for bare-metal arm-application

I'm working on a project based on arm9 processor. We use only bare-metal without any operating system, so unfortunately we have no support for shared libraries / dynamic loader yet. I would like to be able to have libraries loaded for example from…
Honza
  • 1,734
  • 3
  • 16
  • 22
11
votes
2 answers

Critical sections in ARM

I am experienced in implementing critical sections on the AVR family of processors, where all you do is disable interrupts (with a memory barrier of course), do the critical operation, and then reenable interrupts: void my_critical_function() { …
DarthRubik
  • 3,927
  • 1
  • 18
  • 54
11
votes
2 answers

How to create a video stream from a series of bitmaps and send it over IP network?

I have a bare-metal application running on a tiny 16 bit microcontroller (ST10) with 10BASE-T Ethernet (CS8900) and a Tcp/IP implementation based upon the EasyWeb project. The application's main job is to control a led matrix display for public…
Joe
  • 3,090
  • 6
  • 37
  • 55
10
votes
1 answer

Profiling on baremetal embedded systems (ARM)

I am wondering how you profile software on bare metal systems (ARM Cortex a8)? Previously I was using a simulator which had built-in benchmark statistics, and now I want to compare results from real hardware (running on a BeagleBoard-Xm). I…
MrGigu
  • 1,729
  • 3
  • 23
  • 37
10
votes
7 answers

TCP/IP Protocol stack without an OS

I'm looking for a TCP/IP stack that can be used without an OS. Our customer has an "aversion" to interrupts and doesn't want a real OS on a embedded board we're building. It's desirable to move as much of the functionality to FPGA as possible due…
NoMoreZealots
  • 5,274
  • 7
  • 39
  • 56
1
2 3
35 36