Author Topic: linking with nasm  (Read 8226 times)

GeirGrusom

  • Guest
linking with nasm
« 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?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2596
  • Country: us
Re: linking with nasm
« Reply #1 on: March 30, 2007, 08:59:43 PM »
Dunno. Try "-f aoutb" maybe?

Best,
Frank

GeirGrusom

  • Guest
Re: linking with nasm
« Reply #2 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.

GeirGrusom

  • Guest
Re: linking with nasm
« Reply #3 on: March 30, 2007, 09:08:08 PM »
Thank you for your reply.
but aoutb didn't work :(