jonesz / CS499-UAH24

CS499 UAH Fall 24.
0 stars 3 forks source link

libc implementation. #10

Closed jonesz closed 6 days ago

jonesz commented 2 weeks ago

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.

jonesz commented 1 week ago

I'm going to look at porting a smaller libc over. :+1: