Next Generation Emulation banner

1 - 4 of 4 Posts

·
Registered
Joined
·
44 Posts
Discussion Starter · #1 ·
I wish to port the standard C library over to my toy OS (stdlib.c, stdlib.h, stdio.h, stdio.c) now im trying to find the libstdc.c to use but it does not exist on my linux distribution , and i began to search the internet for standard C library files and could not find stdlib.c anywhere. Any tips as to where this may be?

Edit: i mean stdlib.c sorry lol im tired right now *correction*
 

·
Registered
Joined
·
230 Posts
Get a copy of K&R's The C Programming Language while you're at it, since it helps a lot with understanding how standard string and IO functions work.

So what C Library are you trying to port? There's several open source implementations out there, and they shouldn't be expected to work if you mix code from them.

EDIT: Oh, Linux. So you're probably trying to port glibc. You can find the full source code via anonymous FTP at ftp://ftp.gnu.org/gnu/glibc/ or HTTP at http://ftp.gnu.org/gnu/glibc/

The latest release is: http://ftp.gnu.org/gnu/glibc/glibc-2.3.5.tar.bz2

And the Porting guide: http://www.gnu.org/software/libc/manual/html_node/Porting.html

Consider trying newlib while you're at it:
http://sourceware.org/newlib/

It's a much smaller standard C library implementation designed for use with GCC and embedded systems.
 

·
Registered
Joined
·
44 Posts
Discussion Starter · #3 · (Edited)
cool

cool ill take a look into that newlib it seems interesting.

oh and for string.h and c i decided just to make my own it was easier, tho i had a problem with one function strncat it caused me a segmentation fault, then i decided to make a test program and use the real libc on linux and do the same scenerio and it caused linux console to get a segfault, im not sure why this is.
I was just testing appending a string onto another string to make sure the function i made worked since there was no string.c to check against.
When i reboot to linux ill make a post on what it was that crashed since my source files are on a ext2 partition, tho i wont be back til tomorow somtime im going to a friends house to hang out party and stuff, nothin to do on friday so partying is good idea get drunk stay out late^^.
 

·
Registered
Joined
·
44 Posts
Discussion Starter · #4 ·
it came to me this morning when i decided to think it over i bet its cause the data for destination character array wasnt allocated big enough in ram. I will investigate later but i feel like going to sleep. Just came tomind in my slightly coming down drunken state, good night, err morning. lol
 
1 - 4 of 4 Posts
Top