Page 1 of 1

Mixing Assembly and C Tutorial Help

Posted: Wed Jun 07, 2006 11:00 pm
by Cool Dude 2k
The first example works but the 2nd one gives me a error when I try to do the ld part.
Heres what I get.
cooldude2k@Game-Maker-2k:~/kernel$ nasm -f coff -o kernel32.o kernel32.asm
cooldude2k@Game-Maker-2k:~/kernel$ ld -Ttext 0x100000 --oformat binary -o kernel32.bin kernel32.o
kernel32.o: file not recognized: File format not recognized
cooldude2k@Game-Maker-2k:~/kernel$

Re: Mixing Assembly and C Tutorial Help

Posted: Wed Jun 07, 2006 11:00 pm
by osprogram
From the article:

Linux Warning: There is a problem with ld on Linux. The problem is that the "ld" that comes with linux distros lists support for the coff object format, but apparently you have to rebuilt binutils from gnu.org to get it working. I found two possible solutions. Recompile ld or edit your assembly files and remove all the leading underscores. Then when you assemble with nasm use the -f aout option instead of coff. I've tested the second method briefly and it works.

Sounds like this is your problem, as it looks like you're on Linux.

Re: Mixing Assembly and C Tutorial Help

Posted: Thu Jun 08, 2006 11:00 pm
by c_plus_plus
I have another question about this tutourial: can I use a bloodshed c++ compiler instead of the windows port for GCC