Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Hi there!
I'm following Bran's Kernel Tutorial to develop my very firsti OS.
I just reached the IDT chapter and I'm stuck with an error I'm getting from the linker.
The error message is:
start.o:start.o:(.text+0x53): undefined reference to `_idtp'
main.o:main.c:(.text+0x14f): undefined reference to `_idt_install'
I'm guessing you're compiling to ELF format. If so, C functions don't get a leading underscore when accessed from assembly.
The solution is to either remove them from your assembly file or pass '-fleading-underscore' to GCC when compiling the C files.
If you remove them and later want to compile to an object format that does use leading underscores, either pass '-fno-leading-underscore' to GCC or '--prefix _' to NASM.
I'm receiving these errors even if I try to compile the tutorial's code itself
Strange - I downloaded the code at the end of the tutorial, and it seemed to compile and link fine (although there were a few compiler warnings about certain code - but nothing to worry about).
Do you have a script/bat file that compiles and links everything? If so it would help for you to post that (it sounds as though you've forgotten to link in the idt code). If not, could you post the commands you use to build it?