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
10
votes
3 answers

It is possible to get linker script symbols addresses as compile time constant values in C code?

I want to get the address of the end of my program and check at compilation/linker time if I have enough space, after the code, to place some random data in execution time. But as the symbols provided by PROVIDE keyword are like normal variables in…
Lilás
  • 1,111
  • 1
  • 16
  • 29
9
votes
4 answers

Execution without OS

How do you compile a C program in to a valid ELF format(or RAW format) so that it can be executed directly from RAM without any OS? Assume that a bootloader exists which is capable of loading the code to any location in RAM and start execution at…
AIB
  • 5,894
  • 8
  • 30
  • 36
9
votes
2 answers

How to avoid C++ code bloat issued by template instantiation and symbol table?

I'd started a bare-metal (Cortex-M) project some years ago. At project setup we decided to use gcc toolchain with C++11 / C++14 etc. enabled and even for using C++ exceptions and rtti. We are currently using gcc 4.9 from…
Joe
  • 3,090
  • 6
  • 37
  • 55
9
votes
3 answers

What is Qt Bare Metal?

QtCreator has a plugin named "Bare Metal". Bare Metal means a computer without an operating system. I have not seen much about Qt Bare Metal development. Is it a way to develop Qt for a bare metal system? Does Qt run on a system with no OS? If yes,…
Nejat
  • 31,784
  • 12
  • 106
  • 138
9
votes
1 answer

LLVM (arm-none-eabi target) is producing an ARM.exidx section for C based code(?)

Compiling a simple HelloWorld.c using Clang/LLVM (arm-none-eabi target) produces a relocation section '.rel.ARM.exidx' but using arm-gcc does not. These LLVM produced unwind table entries are correctly tagged as canunwind. But why are they even…
user824082
8
votes
1 answer

Qemu baremetal emulation - how to view UART output?

Question: How do I get the UART output from a baremetal program run with Qemu? Background Here is the command line invocation I have been using: qemu-system-arm -M xilinx-zynq-a9 -cpu cortex-a9 -nographic -kernel $BUILD_DIR/mm.elf -m 512M -s…
thatjames
  • 438
  • 1
  • 5
  • 10
8
votes
1 answer

How to setup ARM interrupt vector table branches in C or inline assembly?

Can someone please show me an example of how to setup an ARM9 interrupt vector table using C or inline assembly in a bare-metal environment with no RTOS or Linux OS? Specifically how can I use inline assembly or C to set branches to my IRQ interrupt…
Ed of the Mountain
  • 5,219
  • 4
  • 46
  • 54
8
votes
2 answers

llvm optimizes with library functions

Starting with code like this void lib_memset( unsigned char *dest, unsigned char c, unsigned int n) { while(n--) { *dest=c; dest++; } } using llvm as a cross compiler clang -Wall -m32 -emit-llvm -fno-builtin…
old_timer
  • 69,149
  • 8
  • 89
  • 168
7
votes
1 answer

How to Install a Vagrant Box on a Bare Metal Machine?

Is there an established way to take a Vagrant box and use it as the operating system for a "bare metal" machine, i.e. a normal computer and not a hypervisor, without having to sit through an installation process? Now I understand the common response…
codingking
  • 71
  • 1
  • 4
7
votes
2 answers

What are the differences between C/C++ bare-metal compilation and compilation for a specific OS (Linux)?

Suppose you have a cross-compilation tool-chain that produces binaries for the ARM architecture. Your tool-chain is like this (running on a X86_64 machine with Linux): arm-linux-gnueabi-gcc.exe : for cross-compilation for Linux, running on…
7
votes
1 answer

Intel Galileo bare metal UART

I want to program a little "hello world" bare metal application on the Intel Galileo board. Using UEFI to print out text (to UART-1) works well, of course, but I want to access the UART "manually", without any help from UEFI. In QEMU my code works…
Kijewski
  • 25,517
  • 12
  • 101
  • 143
6
votes
3 answers

How to make bare metal ARM programs and run them on QEMU?

I am trying to get this tutorial to work as intended without success (Something fails after the bl main instruction). According to the tutorial the command (qemu) xp /1dw 0xa0000018 should result in the print 33 (But i get 0x00 instead) a0000018:…
Henrik
  • 405
  • 1
  • 8
  • 19
6
votes
1 answer

How to ignore interrupts with arm gdb

I am trying to debug a program using arm-none-eabi-gdb and step through it. There is an interrupt, USB0_Handler, which I do not want to step into while stepping the program. To achieve this, I tried to use skip, but it didn't work, even if I try to…
adriel
  • 61
  • 1
  • 2
6
votes
1 answer

Which section does objdump disassemble by default

I am currently building a bare metal executeable, which contains some special sections containing code. However, when I do objdump -d I only get the code for the .text and .init.text sections. The manpage for objdump only says that it "only…
LiKao
  • 10,408
  • 6
  • 53
  • 91
6
votes
3 answers

MBR Booting from DOS

For a project I would like to invoke the MBR on the first harddisk directly from DOS. I've written a small assembler program that loads the MBR in memory at 0:7c00h an does a far jump to it. I've put my util on a (DOS) bootable floppy. The disk…
Rogier
  • 121
  • 9
1
2
3
35 36