Skip to content

Instantly share code, notes, and snippets.

@xzhong86
Created March 19, 2025 02:17
Show Gist options
  • Save xzhong86/bc6b31a957029d3323119ae13673c4d2 to your computer and use it in GitHub Desktop.
Save xzhong86/bc6b31a957029d3323119ae13673c4d2 to your computer and use it in GitHub Desktop.

Simple AArch64 Bare Metal

C code example:

#include <stdio.h>
int main() { printf("Hello world!\n"); }

Compile it with rdimon.specs:

$ aarch64-none-elf-gcc -static -specs=rdimon.specs hello.c
$ qemu-8.2.6/bin/qemu-aarch64 ./a.out

In this way, we get a bare metal executable which only require ARM semihosting support (no OS needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment