This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: platform initialisation


>Suppose we have a stand-alone application to run on bare-metal with no
>OS. Is the C library initialisation responsible for initialising
>platform devices in this case?

There's no hard rule about this, but I'd say that the C library is not
responsible for this.  Generally, platform specific details should not
be in the C library, but in a separate platform library, or as part of
the application.  Even crt0.s is very often not a part of the C
library for this reason (people often write their own, or do their
own initialization before branching to crt0.s).

Newlib blurs the line a bit here since it ships with both a C library
and "libgloss" which has some basic platform support.  But even then I
suspect most projects don't have heavy dependence on libgloss, but use
it as a guide or for initial porting.

The reason for all this is that you often want the C library to be
standalone.  That is the same library should be usable in many
different projects.  If they use the same CPU then the library
shouldn't even need recompilation.  In the same way that a C library
shouldn't be customized for specific applications, it shouldn't need
customization for specific platform details either.

--
Darin Johnson


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]