loader.o:file format not recognised
Posted: Mon Oct 17, 2011 6:32 am
hi everyone ,
i m making an os, it's the first time i use C++ to create an os(i choose it because it's the language that i m more experienced than the others).
i search on the net to find a tutorial from where i began.
i did the part code : my project is composed of (temporarily) : VideoMemory.h and CPP , Kernel.cpp loader.asm commun.h .
i compile loader.asm with nasm, and the others file with gcc: i used this command to make the .o: nasm -o aout loader.asm loader.o
i got .o files and i make my linker :
i link them using ld -T Linker.ld -o Kernel.bin loader.o Kernel.o VideoMemory.o
but i get this error :
loader.o: file not recognized: File format not recognized
thx for your help
i m making an os, it's the first time i use C++ to create an os(i choose it because it's the language that i m more experienced than the others).
i search on the net to find a tutorial from where i began.
i did the part code : my project is composed of (temporarily) : VideoMemory.h and CPP , Kernel.cpp loader.asm commun.h .
i compile loader.asm with nasm, and the others file with gcc: i used this command to make the .o: nasm -o aout loader.asm loader.o
i got .o files and i make my linker :
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data :
{
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
but i get this error :
loader.o: file not recognized: File format not recognized
thx for your help