Page 1 of 1

NASM targets - odd behavior

Posted: Tue Jul 29, 2003 11:31 am
by lacrymology
I have a number of source files, but for simplicity I will only mention a few (the minimum needed).

Anyway, I am using NASM, gcc, and GNU ld to build my code which takes the following form:

loader.asm
stage2.asm
Kernel.cpp
Out.cpp

Basically, the loader sets up a20 and all that nonsense and loads a file named stage2.bin which then calls the main function contained in Kernel.cpp which then calls Out.displayBitmap() which shows my OS logo. This is the bear minimum functionality.

While building stage2 in Linux using NASM as the aout target and linking it together with ld to the Kernel.cpp and Out.cpp files everything is peachy. However, when I do the same thing using Cygwin, ld complains that the format of stage2.o (the intermediate file to be linked) is not recognized. I am 99.8% certain that the build scripts are the same (although I have not implemented source control yet), so I am curious what the situation may be. My line to build stage2.o is:

Code: Select all

nasm -f aout -o bin/stage2.o stage2.asm
my gcc compile lines are:

Code: Select all

c++ -c Kernel.cpp -o bin/Kernel.o -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions

Code: Select all

c++ -c Video.cpp -o bin/Video.o -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
and my linker line looks like:

Code: Select all

ld -Ttext=0x9000 -o myos stage2.o Kernel.o Video.o -e 0x0
Any help would be appreciated.

-m

Re:NASM targets - odd behavior

Posted: Tue Jul 29, 2003 11:37 am
by Pype.Clicker
natively, cygwin works in COFF while linux uses ELF (with a backward compatibility to A.OUT) binary format ... this is probably where you're having problems ...