[okl4-developer] Building an iguana server

Charles Wong charlesw at ok-labs.com
Mon Mar 31 12:55:50 EST 2008


On 28/03/2008, at 4:34 AM, Remy Gottschalk wrote:
>
> For what i have seen you generally add another abstraction layer to  
> this
> (as for naming, event and timer).
> What I have understood looking at those server is the the following :
> Interfaces are :
> Defined in : libs/bla/include/interfaces/bla.idl4

Yep

> Implemented : iguana/bla/src/bla.c

Yep

> And another wrapping is done via functions in :
> - libs/bla/include/
> - libs/bla/src/

Also yep :)

> Of course this is the "fullest set" and the whole is not always  
> needed.
>
> On the client's side you need to include bla_client.h or bla.h
> respectively found in build/iguana/include/interfaces/ and
> build/iguana/include/bla.h. The first one is generated and the  
> second is a
> simple copy of lib/bla/include/bla.h.

The bla_client.h header file is only used in the implementation of the  
user-side wrappers in the library.  If you're just calling the library  
then all you need is the bla.h header file.

For example, the naming_client.h header file is only included in lib- 
naming.  If you want to use lib naming the only header file you need  
is naming.h.

> And the client also need to be linked with libbla.a found in
> build/iguana/lib/

Yep

> Could you confirm that for this part i am not misunderstanding too  
> much ?
>
> Could you also briefly tell me how work and how to use the mighty
> SESSION() Macro witch seem to be nice for passing the server thread
> identifier.and some more info.

The SESSION() macro is a handy way of accessing the session struct.   
For example, the SESSION() macro in lib naming returns a pointer to  
the naming_session struct.

> And lastly what is the simplest way to call my newly created server,  
> and
> from how "far" can i contact it, is it for example possible/ 
> desirable to
> call it from inside a linux's thread.

To use your server you need link against the corresponding library and  
include the relevant header file.

You can call your library from linux.  You'll need to explicitly link  
against it in linux/kernel/arch/l4/Makefile.



More information about the Developer mailing list