* mikeOS 16 bit and amd64 baremetal
[mascara-docs.git] / amd64 / bareMetalOS-0.5.2 / baremetal0.5.2 / programs / helloc.c
blobad7f8f8297595ab30f3ccd5f38b8fe5f50e02c85
1 // Hello World C Test Program (v1.1, September 7 2010)
2 // Written by Ian Seyler
3 //
4 // BareMetal compile:
5 //
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"
23 int main(void)
25 b_print_string("Hello world, from C!\n");
26 return 0;