Porting GlibC

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.
Post Reply
User avatar
Protan
Posts: 4
Joined: Fri Jun 28, 2013 3:52 am

Porting GlibC

Post by Protan »

Please tell me how to port GlibC,
1. Is that exactly similar to porting Newlib as told in OS Specific Toolchain?
2. Is GlibC is better than Newlib? :roll:
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: Porting GlibC

Post by dozniak »

1. Why do you want to port glibc in particular?
Learn to read.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Porting GlibC

Post by sortie »

Yes, glibc is much better than newlib that is supposedly a piece of ****. Nonetheless, it's also much harder to port, but it can be ported if you put in considerable effort. Basically porting anything involves modifying it so it runs on your platform and then cross-compiling it.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Porting GlibC

Post by AJ »

rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Porting GlibC

Post by rdos »

Looking at the ported OSes (basically only Linux) it quickly becomes apparent that glibc is not a good target for a non-unix-based OS. You would at least want to see some radically different OSes being ported like Windows, QNX, Mac OS to even consider it.
OSwhatever
Member
Member
Posts: 595
Joined: Mon Jul 05, 2010 4:15 pm

Re: Porting GlibC

Post by OSwhatever »

rdos wrote:Looking at the ported OSes (basically only Linux) it quickly becomes apparent that glibc is not a good target for a non-unix-based OS. You would at least want to see some radically different OSes being ported like Windows, QNX, Mac OS to even consider it.
What do you consider is the easiest to port C-library for non-UNIX like operating systems?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Porting GlibC

Post by sortie »

You'd probably want to have a look at PDCLib which is public domain and attempts to be very standards compliant with the C standard, while avoiding Unixisms/Posixisms. It's supposed to be very portable.
h0bby1
Member
Member
Posts: 240
Joined: Wed Aug 21, 2013 7:08 am

Re: Porting GlibC

Post by h0bby1 »

there are some tools who can build reduced glibc, like tinylibc or other, it works from the source tree of glibc and then compile and link only the files that are required by a set of application, it can be helpfull to decrease the amount of work if you don't need to have all the function of the glibc, probably older versions are also simpler, depend on the level of compatibility you want it to have, and glibc is updated frequently and it would be hard to catch up with all versions and port them, maybe the easiest way would be to have the linux kernel api emulated , but even kernel api change regulary, linux can works fine because they have lot of developers and good organisation to mannage big project and distributions with dependencies but it would be hard to follow all the update and having a up to date ported glibc all the time,there are many other libc that can be mostly compatible with it, minus some crt functions specific to gcc
User avatar
Protan
Posts: 4
Joined: Fri Jun 28, 2013 3:52 am

Re: Porting GlibC

Post by Protan »

I am really grateful to everyone for Your advises, :)
I know this is not a beginner's forum, but I am shamelessly asking This,

1. What kind Operating System is built in the http://wiki.osdev.org's tutorials?
Is this UNIX/POSIX or BSD or LINUX :oops:

I am already been to
http://www.gnu.org/software/libc/manual ... rting.html
http://www.gnu.org/software/libc/manual ... ng-to-Unix
http://forum.osdev.org/viewtopic.php?f=1&t=11321

But could not figure out How to create the upper layer, to successfully do that.
How ever, Now I am thinking it would be practical to stick with the NewLib or uClibc.
And could this come handy building toolchains? http://kegel.com/crosstool
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Porting GlibC

Post by sortie »

Hi Protan, perhaps you should make your own thread.

This community is about creating your own operating system - this is what the tutorial teach you, although many have a common Unix background as many hobby operating systems are Unix-like (more or less). The tutorials are not completed, you cannot follow them and magically get a full operating system - no, you have to do the hard work yourself and these documents are but guides and advise.

I would advise you to read the beginner materials on the osdev wiki and following the Bare Bones tutorial as the first steps on making our own operating system.
Post Reply