So the cross-compiled C environment we have only can utilize the freestanding headers: think <stdint.h> that only defines things like types. As a result, there's no memcmp, memcpy, strlen (see the static impl in term.c).
On OSDev, they point to this article after the initial tutorial and make points on why a libc implementation is needed for compiling programs later in userspace with a hosted compiler. Obviously userspace is a bit away, but these things are needed in kernel space.
So see these two articles (the arch stuff is overkill since we're just doing 32-bit x86):
So the gist of this ticket is to incrementally implement libc; it'd likely be wiser to do this in chunks, committing and implementing a few functions as you go.
At the time of writing, I don't think it's viable to port a libc and I wouldn't know where to start.
So the cross-compiled C environment we have only can utilize the freestanding headers: think
<stdint.h>
that only defines things like types. As a result, there's nomemcmp
,memcpy
,strlen
(see the static impl interm.c
).On OSDev, they point to this article after the initial tutorial and make points on why a libc implementation is needed for compiling programs later in userspace with a hosted compiler. Obviously userspace is a bit away, but these things are needed in kernel space.
So see these two articles (the arch stuff is overkill since we're just doing 32-bit x86):
So the gist of this ticket is to incrementally implement libc; it'd likely be wiser to do this in chunks, committing and implementing a few functions as you go.
At the time of writing, I don't think it's viable to port a libc and I wouldn't know where to start.