NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: GeirGrusom on March 30, 2007, 08:11:31 PM

Title: linking with nasm
Post by: GeirGrusom on March 30, 2007, 08:11:31 PM
We are developing an operating system, but when trying to link out asm output (asm_main.o) with the rest of the project, we get an "File not recognized, format not recognized" from the linker on the nasm output file.... but this does not happen in Linux... gcc files link just fine, anyone knows how we can fix this?
this is out nasm command:
nasm -f aout main.asm -o main_asm.o
...and out linker command:
ld -T link.ld -o ../../build/kernel.bin main_asm.o main_c.o video.o exception.o irq.o pic.o paging.o

"main_asm.o: file not recognized: File format not recognized"

why does this happen? or why doesn't it happen in linux?
Title: Re: linking with nasm
Post by: Frank Kotler on March 30, 2007, 08:59:43 PM
Dunno. Try "-f aoutb" maybe?

Best,
Frank
Title: Re: linking with nasm
Post by: GeirGrusom on March 30, 2007, 09:01:49 PM
at closer inspection, I can see that the aout is a linux file format.
But what can we use instead?
It would be nice if we didn't have to write a seperate command line for windows and linux...
The output will be a flat binary.
Title: Re: linking with nasm
Post by: GeirGrusom on March 30, 2007, 09:08:08 PM
Thank you for your reply.
but aoutb didn't work :(