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.