Hi, I have a bootloader written in assembly and it works.
The bootloader jumps to the kernel, and the kernel calls the kmain function written in c.
Now here is the problem:
If i want to call kmain from my kernel.asm file, I have to use the
CODE
extern kmain
.
But for some reason nasm can't use extern functions in binary format, so i need to use
"nasm -f elf kernel.asm" if I use it this way I can link it with the c function without problems, but then my filesize is to big.
if I just use nasm kernel.asm my file size is like 88bytes and if i use the -f elf its like 3kb.
So this is my problem, my bootloader only loads the second 512 bytes from the floppy, so if my file size is 3kb, my bootloader won't load the whole program.
I also tried after linking the c function and the kernel this:
"objcopy kernel.o final -R .note -R .comment -S -O binary" wich get my filesize back to normal, but then my c function does not work.
I hope someone can help me? if you need more info just ask

thanks---