Im learning C++ Operating System Development.
And i have 2 file in my OS Project: boot.asm kernel.cpp
this is code for boot.asm
[bits 32] ; hey, we're in Protected Mode
[global start]
[extern _kernel] ; always add a "_" in front of a C function to call it
start:
call _kernel
jmp $
And this is for kernel.cpp
void kernel()
{
}
But when i build the assembly boot file to .bin with this command:
nasm boot.asm -f bin -o boot.bin
so i can test with qemu,i get this error:
boot.asm:7: error: binary output format does not support external references
Line 7:
call _kernel
so i tried the build command to these:
nasm -felf boot.asm -o boot.bin
or nasm -felf32 boot.asm -o boot.bin
its worked,but when i execute the .bin with qemu,i get this result: