Linking a file using ld to output a binary file gives error in OS development
I am learning Operating system tutorials. I created 2 files. boot.asm kernel.c The kernel.c is as follows : int main() { char *src = (char *)0xB8000000L; *src = 'M'; src += 2; *src = 'D'; return 0; } The kernel is used to write a character to the text mode video display area. The kernel was compiled using Windows version of GCC with: gcc -ffreestanding -c -m16 kernel.c -o kernel.o I link the kernel object to a binary file using LD : ld -Ttext 0x10000 --oformat binary -o kernel.bin kernel.o The error I get is: ld : cannot link the file which is not PE executable type Can anybody solve this