This repositories shows the first basic steps that are needed to run bare-metal code on Aarch64 (inside Qemu).
You will need:
aarch64-linux-gnu-gcc
et al.qemu-system-aarch64
make
To run the code, just type:
$ make qemu
aarch64-linux-gnu-gcc -ggdb3 -std=gnu99 -Wall -c -o main.o main.c
aarch64-linux-gnu-as -o startup.o startup.asm
aarch64-linux-gnu-ld -Bstatic --gc-sections -nostartfiles -nostdlib -o first-steps.elf -T link.ld main.o
qemu-system-aarch64 -machine virt -m 1024M -cpu cortex-a53 -nographic -s -kernel first-steps.elf
Hello world!
This is the code for a blog post and I didn't make up everything myself, so thanks to freedomtan and ultimately also Balau.