Thursday, July 30, 2009

How can I compile a C/c++ file to a binary file (not EXE or ELF)?

I want to create a small kernel and then a small operating system. I have created the boot sector and a small kernel in asm (I use flat assembler). But it is very difficult to continue this way. So I want to create the operating system in C/C++ (and some asm code). Linux was created this way. But I don't know any compiler which can bring me a PURE BINARY code.


This means code for BIOS not for DOS.


Even if I write my own functions, and I don't use %26lt;stdio.h%26gt; or other, the OBJ file is created with DOS interrupts.


And let's not forget that I need a flat code, not an EXE, ELF or other.





Please excuse my bad English.

How can I compile a C/c++ file to a binary file (not EXE or ELF)?
have you tried the linux compiler "GCC"?


when I want to compile my linux kernel or even my boot loader I compile it with GCC





there is a version of GCC for windows i think it is called mingw but not sure
Reply:Well, here is a good place to start, assuming that you're attempting the Intel platforms. Other platforms will have similar sites. I hope this will give you more specific information. Good luck!


No comments:

Post a Comment