I am trying to create a simple operating system, yet when I compile the bootloader, I get the error:
error: binary output format does not support external references
I know what this error means, but is it possible to make external references when compiling to binary format? Here is my complete code:
;Bootloader.s
[BITS 16]
[ORG 0x7C00]
global loader
extern kmain
loader:
call kmain
times 510-($-$$) db 0
dw 0xAA55
And my kernel:
/*kernel.c*/
void kmain()
{
unsigned char *vidmem = (unsigned char *) 0xb8000;
int i
for(i=1;i<=11;i+=2)
{
vidmem[i]=0x07;
}
vidmem[0]='H';
vidmem[2]='e';
vidmem[4],vidmem[6]='l';
vidmem[8]='o';
videmem[10]='!';
}
How I compiled:
nasm -o '/home/myusername/Cubed OS/Bootloader.o' '/home/myusername/Cubed OS/Bootloader.s'