using mingw for cross compilation ( butild kernel.bin )

hi I just reading some tutorial to write my own kernel using C and Assembly.

It just use a linker script and mearge the output object files into kernel.bin
file as described in that link script.

the start.asm generates a start.o aout object file and this is the gcc command line to build the main.o , here is my complete build.bat file.

1
2
3
4
5
6
7
8
9
10
11
echo Now assembling, compiling and linking your kernel:
nasm -f elf -o start.o start.asm
rem Remember this spot here: we will add 'gcc' commands here to compile C sources.
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o main.o main.c


rem This links all your files. Remember that as you add *.o files , you need to 
rem add them after start.o. If you don't add them at all, they won't be in your kernel!
ld -T link.ld -o kernel.bin  main.o start.o 
echo Done!
pause


in the bat executes and comes to the ld line it says that error message,
1
2
H:\Kernel Development\src>ld -T link.ld -o kernel.bin  main.o st
start.o: file not recognized: File format not recognized



what can I do here, is that Mingw (windows ) gcc's linker (ld,exe) doesn't support aout object files ????

I just using the ld version ,
1
2
3
4
5
GNU ld version 2.17.50 20070129
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.


please give me some idea.
oh guys I'm so sad , please someone be kind enoughf to help me !
I'm stucked !
It's only been three hours. Be a little more patient. The forum moves a lot slower during the weekends.

Have you tried having nasm output different formats?
allright ! after a hard time with the google.com , acutually burte forcing google.com . I found those.


http://www.osdever.net/downloads.php

after downloading the DJGPP and setting the paths
and the DJGPP env variables I found it working.

I think that minGW for windows contains a minimal version , so ld.exe get unable to support the
aout object files.

with the DJGPP hosted there I sloved the problem , but however now there is a new problem.


now the gcc injects ___main as a undefined symbol to the main.o ? what to do now ? I think
I should start another thread.
Topic archived. No new replies allowed.