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.
I've been loosely following the "Meaty Skeleton" tutorial and this is the first big issue I can't figure out how to solve. My src/kernel/kernel.c relies on strlen(), and since I was carrying over from the Bare Bones tutorial I originally included that function's definition in kernel.c. The project is now reorganized such that src/libc/include/string.h declares strlen(), and src/libc/string/strlen.c defines it. strlen.o gets archived into libk.a with the other standard library functions, so the kernel source should reference that library, if I understand correctly.
and is referencing it from sysroot/include/string.h, but when I comment out the definition of strlen() in kernel.c I get an undefined reference error. I've looked over my Makefile, and, as far as I can tell, I use the same method for compiling the libc source into libk.a that the tutorial does. Can anyone help me out?
Do not link libg or libc into your kernel. Just libk.
Do note how -nostdlib deliberately implies -nostartfiles and -nodefaultlibs. This is intentional. The libc must be compiled specifically as kernel code, at least on particular architectures.