NASM targets - odd behavior
Posted: Tue Jul 29, 2003 11:31 am
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:
my gcc compile lines are:
and my linker line looks like:
Any help would be appreciated.
-m
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
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
Code: Select all
ld -Ttext=0x9000 -o myos stage2.o Kernel.o Video.o -e 0x0
-m