Error folowing the tutorial

I've been folowing the tutorial from here:
http://www.cplusplus.com/articles/zv07M4Gy/

I'm having trouble with this line:

gcc loader.o kernel.o -T linker.ld -o kern -nostdlib -nodefaultlibs -lgcc


now I've replaced loader.o with boot.o (since loader.o wasn't declared anywhere), but then I'm getting this error:
bin/boot.o: In function `start':
boot.asm:(.mbHeader+0xe): undefined reference to `kernel_main'
collect2.exe: error: ld returned 1 exit status


same goes if I replace the _kernel_main at line 4 and 25 with kernel_main (no underscore).

I've also tried replacing gcc with ld (since I'm providing linker.ld) and it fails with this error: ld: cannot find -lgcc

What would I have to fix?
boot.o is generated from the assembler step:
 
nasm -f elf boot.asm -o boot.o
yes, I know, but the error appears after running the third compilation program.
i really dont suggest using that. wiki.osdev.org has that and so much more. plus, all of wikis stuff is correct
Registered users can post here. Sign in or register to post.