flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > flat binaries with Dev-C++ |
Author |
|
AmbroXio 13 Jan 2007, 19:15
Hi there !....
... well, i would really like to do flat binaries with Dev C++, i've seen a pdf that explains how to do that with GCC.. http://www.nondot.org/sabre/os/files/Booting/CompilingBinaryFilesUsingACompiler.pdf .. and i believe Dev-C++ and GCC aren't different at all ?.. am i wrong ?....... anyway, i have no idea about, how to do that....... could anyone please help with these ? ! ..... i know where the compiler and the linker arguments should be using dev c, but ..... well, you'll better see that pdf to get me clear... |
|||
13 Jan 2007, 19:15 |
|
TmX 14 Jan 2007, 04:47
Dev-C++ is just the GUI IDE
Dev-C++ itself uses MinGW GCC as it's compiler |
|||
14 Jan 2007, 04:47 |
|
AmbroXio 14 Jan 2007, 23:33
well.... TmX, thanks for the info.. i guess..... anyway, i think there's some kind of bug with dev-c++, because it changes "--oformat" to "-foformat" ......
... so I deicded to do this using a script ... Code: @ECHO OFF IF "%2" == "" goto noparam C:\Dev-Cpp\bin\gcc.exe -c %1 -o temp.o C:\Dev-Cpp\bin\ld.exe temp.o -o %2 -Ttext 0x0 -e main --oformat binary del temp.o goto end :noparam ECHO. ECHO Escrito por Guillermo Ambrosio (14/01/2007) ECHO. ECHO Script generador de binarios usando GCC y LD ECHO Uso : ECHO BINMAKER [archivo de entrada] [nombre de archivo de salida] ECHO. :end these are the important lines: C:\Dev-Cpp\bin\gcc.exe -c %1 -o temp.o C:\Dev-Cpp\bin\ld.exe temp.o -o %2 -Ttext 0x0 -e main --oformat binary i tried it, but this gives me these messages: Code: C:\Documents and Settings\Guillermo\Escritorio\HISPAOS>binmaker prueba.c prueba.bin C:\Dev-Cpp\bin\ld.exe: warning: cannot find entry symbol main; defaulting to 00000000 temp.o(.text+0x21):prueba.c: undefined reference to `_alloca' temp.o(.text+0x26):prueba.c: undefined reference to `__main' why doesnt it "finds" 'main' symbol ???...... and what's that about the undefined references ??..... i hope someone helps me..... un saludo!.. |
|||
14 Jan 2007, 23:33 |
|
nimday 22 May 2014, 21:56
you can do that with this,change main to start
Code: int start () { int i; /* declaration of an int */ i = 0x12345678; /* hexadecimal */ } Code: gcc -c test.c ld -o test -Ttext 0x0 -e main test.o objcopy -R .note -R .comment -S -O binary test test.bin |
|||
22 May 2014, 21:56 |
|
badc0de02 22 May 2014, 22:05
dev gcc uses mingw gcc/g++
if you dont want the devcpp platform just install mingw |
|||
22 May 2014, 22:05 |
|
badc0de02 22 May 2014, 22:09
but one aleread tell that and you guessed
|
|||
22 May 2014, 22:09 |
|
sid123 22 May 2014, 23:58
You must use a linker script for linking all the object files to a binary file. I'm not sure why you're doing this because binary format is *plain stupid*. Neither they contain any information about the executable, uninitialized variables turn into 0's which takes a lot of space.....
|
|||
22 May 2014, 23:58 |
|
revolution 23 May 2014, 16:46
sid123 wrote: ... because binary format is *plain stupid*. Neither they contain any information about the executable, uninitialized variables turn into 0's which takes a lot of space..... |
|||
23 May 2014, 16:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.