how to compile library for use without OS ?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I am writing a library for ARM. My work station is running Debian and Gentoo
Linux
on x86.

The target is an ARM dragonball. It has a bootstrap, and shall not have any OS.

My library is written in POSIX C98, compiled under Linux.

The bootstrap is created by some one else using C++ and IAR on Windows.

I need to produce a static library, so that the other company, let me call them
Zoro, can link my lib with their bootstrap, and call my functions.

Since I can cross compile to produce a static library, and can provide Zoro with
a
header file, I really think it should be easy for me to write a lib, and provide
a
header, the problem is that I have no clue how to
- cross compile for ARM from x86
- create a static library for use with direct boot strap
- how Zoro shall call and include my lib in their project.

I have already written dynamic libs for Linux.

The problem is that i dont know how to:
- cross compile
- create a lib for standalone use (without OS)
- write a bootstrap in C++ and call funtions inside my lib

Zoro will call my lib, but I shall tell them how to do so.

I hope I have been clear, feel free to ask back about any fuzzy point.

--
DEMAINE Benoit-Pierre (aka DoubleHP ) http://www.demaine.info /
\_o< If computing were an exact science, IT engineers would not have work >o_/

Re: how to compile library for use without OS ?
On Fri, 01 Jul 2005 15:29:46 +0200, DEMAINE Benoit-Pierre

Quoted text here. Click to load it
Linux
Quoted text here. Click to load it
with a
Quoted text here. Click to load it
provide a
Quoted text here. Click to load it

For bootstrap ideas, search for programs called locators. They take
the compiler output and resolve all of the relocation references
needed to load the programs into memory. Usually the OS will handle
that when it executes programs, but it has to be done before the
program can actually run. Most have samples of the bootstrap utilities
needed to run on bare silicon.

Bob McConnell
N2SPP


Re: how to compile library for use without OS ?
Quoted text here. Click to load it
with a
Quoted text here. Click to load it
provide a
Quoted text here. Click to load it

Static libraries are basically a callection of objects in a single
archive file.  When Zoro calls and uses any of your library functions,
their linker will pull out the object and add it to the objects it is
linking.

Most tools chains will/should have a static library archive tool.  If
not, you might be able to use a GNU AR for ARM.  (Comes in the bintools
package, I think, but I may be wrong.)


Quoted text here. Click to load it

Static libraries are completely different to dynamic.  Dynamic libs
usually have one copy of the code in one place that is loaded on demand,
code from a static library is included in all the programs that use it.


Quoted text here. Click to load it

Just like any other function, just make sure they have the static
library in
the list of files to be linked.


Regards,

NBB

Re: how to compile library for use without OS ?
On Fri, 01 Jul 2005 15:29:46 +0200, DEMAINE Benoit-Pierre

Quoted text here. Click to load it

Give Zoro the sources as they seem to have the needed knowledge.

--
42Bastian
Do not email to snipped-for-privacy@yahoo.com, it's a spam-only account :-)
We've slightly trimmed the long signature. Click to see the full one.
Re: how to compile library for use without OS ?
Quoted text here. Click to load it

my source is written in Posix-C98 for GCC, their compiler (which is different)
may
not be compatible, but I hope binary static library are.

--
DEMAINE Benoit-Pierre (aka DoubleHP ) http://www.demaine.info /
\_o< If computing were an exact science, IT engineers would not have work >o_/

Site Timeline