how to compile library for use without OS ? - Embedded

This is a discussion on how to compile library for use without OS ? - Embedded ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: how to compile library for use without OS ?

  1. how to compile library for use without OS ?

    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_/

  2. Re: how to compile library for use without OS ?

    On Fri, 01 Jul 2005 15:29:46 +0200, DEMAINE Benoit-Pierre
    wrote:

    >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.


    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


  3. Re: how to compile library for use without OS ?

    DEMAINE Benoit-Pierre wrote:
    > 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.


    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.)


    > I have already written dynamic libs for Linux.


    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.


    > 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.


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


    Regards,

    NBB

  4. Re: how to compile library for use without OS ?

    On Fri, 01 Jul 2005 15:29:46 +0200, DEMAINE Benoit-Pierre
    wrote:

    >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.


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

    --
    42Bastian
    Do not email to bastian42@yahoo.com, it's a spam-only account :-)
    Use @monlynx.de instead !

  5. Re: how to compile library for use without OS ?

    42Bastian Schick wrote:
    > On Fri, 01 Jul 2005 15:29:46 +0200, DEMAINE Benoit-Pierre
    > wrote:
    >
    >
    >>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.

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


    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_/

+ Reply to Thread