Though I am not sure what Ian means, you should be able to build the
application
a) without any reference to the windows runtime
b) no DLL dependencies
c) linked to a fixed address (there is no loader to relocate your code and
data)
--
42Bastian
+
| http://www.sciopta.com
| Fastest direct message passing kernel.
| IEC61508 certified.
+
The usual development environment for BareMetal OS is linux which usually has the compiler tools pre-installed. This document contains the instructions necessary for compiling C/C++ applications for BareMetal OS under Windows.
You can download the latest version of GCC for Windows from here (Make sure to get tdm64-gcc-X.X.X):
http://tdm-gcc.tdragon.net/download
Run the installer once it has finished downloading.
In the setup click on 'Create'.
Select 'MinGW-w64/TDM64 Experimental (32-bit and 64-bit)' and click next.
The default installation directory is fine for most installs. Click next.
For a download mirror the SourceForge Default is fine. Click next.
Select 'All Packages' for the install type. Click next.
Once the installation is complete click next.
Deselect the ReadMe file option and click finish.
We can start with some very basic code that uses libBareMetal.
#include "libBareMetal.h"
int start(void)
{
b_print_string("Hello world, from C!\n");
return 0;
}
Note that the program starts in start() instead of main().
And then the compile:
gcc -m64 -nostdlib -nostartfiles -nodefaultlibs -mno-red-zone -o hello.o hello.c libBareMetal.c -DBAREMETAL -Ttext=0x200000
objcopy -O binary hello.o hello.app
Success - tx.