flat binary
flat binary
i use the djgpp compiler just a while but how can i make
the compiler compile to a flat binary file? ???
the compiler compile to a flat binary file? ???
Re:flat binary
Just compile your file, then use objcopy to strip the header(s).
Like this:
gcc -c file.c -o file.o
objcopy -O binary file.o file.bin
That -O is O for October not Zero.
You must also make sure that you file does not rely on any external variables or functions, or otherwise the flat binary file will not work.
Hope this helps.
Like this:
gcc -c file.c -o file.o
objcopy -O binary file.o file.bin
That -O is O for October not Zero.
You must also make sure that you file does not rely on any external variables or functions, or otherwise the flat binary file will not work.
Hope this helps.
Re:flat binary
That's because you forgot to link it.You must also make sure that you file does not rely on any external variables or functions, or otherwise the flat binary file will not work.
gcc -c file1.c -o file1.o
gcc -c file2.c -o file2.o
ld -o file.out file1.o file2.o
objcopy -O binary file.out file.bin
Re:flat binary
isn't there a good ide out there that take care of all that linking and stuff???
Re:flat binary
I will be making a IDE...and someone else here will....I think it is "M@rtin12345"
Re:flat binary
can visual studio outpu binary files and is it possibel to create a OS system dispite the fact you may only create windows software with it.
Re:flat binary
if somebody made a good ide for djgpp please let me know if you make the ide please make sure there is good support for outputting binary files ;D
Re:flat binary
Textpad is a good win32 ide You can add programs to run as commands with keyboard shortcuts. So ctrl+1 could run nasm, ctrl+2 could run gcc, ctrl+3 could run ld. etc. Add you can use $File and $FileDir as parameters to the programs.
You can also view hex files, dos, ansi, unix, etc, etc.
www.textpad.com
You can also view hex files, dos, ansi, unix, etc, etc.
www.textpad.com
Re:flat binary
The Emacs C and C++ modes have a preset compile command that runs "make -k" by default. You'd still have to write a Makefile, but given the kinds of things that can be done automatically by [tt]make[/tt](1), this is a Good Thing. You can go far beyond just compiling with a single step that way.engine252 wrote: isn't there a good ide out there that take care of all that linking and stuff???
Re:flat binary
No, the linker emits Portable Executable files, which Windows happens to use, as do ReactOS, Mobius, and various loaders. My point is: VC++ isn't tied to Windows.Tom wrote:Nope....only win32 bins...but the ide can make the files you type up.