So I have a bootloader (boot.asm) and a kernel (kernel.cpp)
I have "extern kernel_main" in the assembly code
When I run
nasm.exe -f bin boot.asm -o boot.obj
It will say "binary output format does not support external refrences"
But when I run nasm.exe -f win64 boot.asm -o boot.obj
it will work but after running the linker
~\tdm-gcc64\C++.exe -T linker.ld -o Boot.img -ffreestanding -nostdlib boot.obj kernel.obj -lgcc
it will have junk like:"This program cannot be run in DOS mode" I have searched all over the internet and cannot find out how to export from nasm so it will play nice with gcc.
Any help will be appreciated.
I'm using 64 bit windows 10 home with nasm, gcc, and qemu
Edit: I also need to know how to set the origin to 0x7c00 as org 0x7c00
doesn't work when compiling as an object