Normally I don't post much on the forums, but I couldn't find a solution for this problem (or, actually, I am not sure if I am doing this right), so I decided to ask for help here.
I am following Bran's Kernel Tutorial, and when it comes to the section where I have to start using C source files, and calling the main function in the assembly code, I have a problem.
As Brandon suggested in his tutorial, calling the main function from the C source file (main.c) should be done by adding the following lines immediately after 'stublet:'
Code: Select all
extern _main
call _main
I changed '_main' to 'main' in my code, and then it didn't came up with errors anymore.kernel.o:kernel.o(.text.0x2d) undefined reference to '_main'
However, I don't know if I have really 'solved' the problem. Though it does not come up with errors anymore, is using 'main' in assembly a good thing to do? Brandon said that GCC (I use version 4.3.3 by the way) automatically added an underscore before every function in C, so I guess my GCC compiler does not do that? Or is there something else I need to fix?
Thanks in advance,
~Temp.