mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-06 19:07:51 +00:00
parent
041dd2a133
commit
25b41e9cff
@ -402,14 +402,20 @@ Add a 'target.mk' file with the following content to 'src/hello/client/':
|
||||
! SRC_CC = main.cc
|
||||
! LIBS = base
|
||||
|
||||
Add the following entries to your 'config' file:
|
||||
Extend your 'config' file as follows.
|
||||
|
||||
! <start name="timer">
|
||||
! <resource name="RAM" quantum="256K"/>
|
||||
! </start>
|
||||
! <start name="hello_client">
|
||||
! <resource name="RAM" quantum="256K"/>
|
||||
! </start>
|
||||
# Add the 'SIGNAL' service to the '<parent-provides>' section:
|
||||
|
||||
! <service name="SIGNAL"/>
|
||||
|
||||
# Add start entries for 'Timer' service and hello client:
|
||||
|
||||
! <start name="timer">
|
||||
! <resource name="RAM" quantum="512K"/>
|
||||
! </start>
|
||||
! <start name="hello_client">
|
||||
! <resource name="RAM" quantum="1M"/>
|
||||
! </start>
|
||||
|
||||
Build 'drivers/timer', and 'hello/client', go to 'build/bin', and run './core'
|
||||
again. You have now successfully implemented your first Genode client-server
|
||||
|
@ -16,17 +16,22 @@
|
||||
#include <hello_session/client.h>
|
||||
#include <hello_session/connection.h>
|
||||
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Hello::Connection h;
|
||||
|
||||
Timer::Connection timer;
|
||||
|
||||
while (1) {
|
||||
h.say_hello();
|
||||
|
||||
int foo = h.add(2, 5);
|
||||
PDBG("Added 2 + 5 = %d", foo);
|
||||
timer.msleep(1000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user