[okl4-developer] About Iguana client session.

Josh Matthews jmatthews at ok-labs.com
Tue May 20 17:29:53 EST 2008


Hi HoChul,

On Tue, May 20, 2008 at 3:14 PM, 유호철 <hcyoo at cuwave.co.kr> wrote:

>   I want to use [ iguana_client.h ] header function.  With my knowing it,
> first step is established session.
>
You don't need to establish a session to utilise the services of a server.
The first step in communicating with a server is to find out who he is! i.e:
you need to discover the server's thread id. To do this you have 2 options:

1) For an existing server (such as Iguana or Event servers), the easiest way
is to utilise the wrapper library provided with the server. These generally
perform the server lookup/resolution for you. For example, with the Event
server, take a look in libs/event/src/event.c:

static  L4_ThreadId_t server_tid;
void event_init(void){
    thread_ref_t server_;
    memsection_lookup((objref_t)
env_memsection_base(iguana_getenv("OKL4_EVENT_SERVER")),
                      &server_);
    server_tid = thread_l4tid(server_);
}

What it's doing is discovering the TID of the server from an Iguana
environment variable which corresponds to the name of the server. This name
is defined in the SConscript for the server. For example, in
iguana/event/SConscript:

weaver = env.WeaverIguanaProgramServer(server_name = "OKL4_EVENT_SERVER",
priority=200)

2)  You can include <interfaces/{server}_client.h> directly, in which case
you need to perform the lookup yourself in the same manner as above.

But,  IGUANA_GETENV_IGUANA_SERVER of setup_ig_lib() section is not exist. Is
> a way different from a case of iguana_session and  [my_test_esrver] session?
>
Iguana is special - it is the root server and resource manager for your
applications. ElfWeaver doesn't populate an environment variable with the
Iguana server - to utilise its services, you should use the Iguana library
(libs/iguana). For example, to have Iguana create a memsection for you,
#include <iguana/memsection.h>.

Under the hood, the Iguana library is performing the lookup for you, but
since it doesn't have the environment variable to use it needs to do it
another way. For this it uses the fact that Iguana server is your pager - it
simply uses the L4_Pager() call to find the server.

Hope this aids in your understanding.

Best regards,
Josh Matthews
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080520/b743ef8d/attachment.htm 


More information about the Developer mailing list