1 // Hello World C Test Program (v1.1, September 7 2010)
2 // Written by Ian Seyler
6 // GCC (Tested with 4.5.0)
7 // gcc -c -m64 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone -o helloc.o helloc.c
8 // gcc -c -m64 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone -o libBareMetal.o libBareMetal.c
9 // objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame helloc.o
10 // objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame libBareMetal.o
11 // ld -T app.ld -o helloc.app helloc.o libBareMetal.o
13 // Clang (Tested with 2.7)
14 // clang -c -mno-red-zone -o libBareMetal.o libBareMetal.c
15 // clang -c -mno-red-zone -o helloc.o helloc.c
16 // objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame helloc.o
17 // objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame libBareMetal.o
18 // ld -T app.ld -o helloc.app helloc.o libBareMetal.o
21 #include "libBareMetal.h"
25 b_print_string("Hello world, from C!\n");