I'm writing an C kernel and I just implemented the fantabulous printf() function. But here comes the weird trouble...
bin/i386/obj/main.o: In function `main':
main.c:(.text+0x64): undefined reference to `putchar'
It happens when I try to link the kernel with ld. This is the command line I'm using:
ld -melf_i386 -nostdlib -nodefaultlib -T link.ld -o bin/i386/Kernel.kimg bin/i386/obj/standard/errno.o bin/i386/obj/standard/crt0.o bin/i386/obj/standard/math_exp.o bin/i386/obj/standard/stdio.o bin/i386/obj/standard/math_misc.o bin/i386/obj/standard/uchar.o bin/i386/obj/standard/string.o bin/i386/obj/standard/wchar.o bin/i386/obj/standard/ctype.o bin/i386/obj/standard/math_pow.o bin/i386/obj/standard/math_trigo.o bin/i386/obj/standard/stdlib.o bin/i386/obj/load.o bin/i386/obj/keyboard.o bin/i386/obj/vgacon.o bin/i386/obj/main.o bin/i386/obj/portio.o bin/i386/obj/power.o bin/i386/obj/printf.o
I don't know where is putchar referenced. I think the linker may be linking the kernel with the GNU standard library.