On Mon, Jul 07, 2003 at 07:56:15PM -0700, Remco Treffkorn wrote: > > In order to see what's missing, I added a 'test' target to the Makefile. That > would compile test.c to test.o and then link it with libc.a. Naturally _start > was missing, so I added crt/Crt0.c and linked that in. this is system specific so should go in an approprate sysdeps/ directory. > With the formalities out of the way, everything missing still, is what needs > to be added. Since test.c is basically "hello world", write is one of the > expected missing functions. The missing __progname in assert.c I added to > Crt0.c. ok. > The few things that bother me are that stdin, stdout, and stderr are missing. > These belong to stdio, and not in the kernel. well there is no kernel. stdin/out/error need to be setup by some sort of __stdio_init() which would be called in the __libc_start() function. however we need open() read() write() lseek() and close() first, thats what we are trying to get done now. (well i hope anyway, everyone seems to have dissappeared). > Also vsnprintf wants __udivdi3 and __umoddi3. These are probably gcc support > functions. I don't know where they normally are, but I know how to find out. hmm didn't notice these. i got the vsnprintf implementation from klibc. > My goal is to be able to link against prom-libc as a replacement for glibc in > order to be able to test it. thats been a wishlist of mine, but i doubted id ever get it to work since im not that familier with linkage between a kernel and libc. > Is there any merit in what I am doing, or am I wasing my time? no this would be very useful. implement the code in sysdeps/linux and if there is any processor specific code put it in sysdeps/powerpc/linux (or whatever architecture your attempting). btw i have a start of a libc testsuite at http://penguinppc.org/~eb/test.tar.gz so far it only tests most of string.h stuff, but it has a fairly generic architecture for building tests. thanks much. -- Ethan Benson http://www.alaska.net/~erbenson/
Attachment:
pgp00014.pgp
Description: PGP signature