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
|
! SRC_CC = main.cc
|
||||||
! LIBS = base
|
! LIBS = base
|
||||||
|
|
||||||
Add the following entries to your 'config' file:
|
Extend your 'config' file as follows.
|
||||||
|
|
||||||
! <start name="timer">
|
# Add the 'SIGNAL' service to the '<parent-provides>' section:
|
||||||
! <resource name="RAM" quantum="256K"/>
|
|
||||||
! </start>
|
! <service name="SIGNAL"/>
|
||||||
! <start name="hello_client">
|
|
||||||
! <resource name="RAM" quantum="256K"/>
|
# Add start entries for 'Timer' service and hello client:
|
||||||
! </start>
|
|
||||||
|
! <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'
|
Build 'drivers/timer', and 'hello/client', go to 'build/bin', and run './core'
|
||||||
again. You have now successfully implemented your first Genode client-server
|
again. You have now successfully implemented your first Genode client-server
|
||||||
|
|
|
@ -16,17 +16,22 @@
|
||||||
#include <hello_session/client.h>
|
#include <hello_session/client.h>
|
||||||
#include <hello_session/connection.h>
|
#include <hello_session/connection.h>
|
||||||
|
|
||||||
|
#include <timer_session/connection.h>
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
Hello::Connection h;
|
Hello::Connection h;
|
||||||
|
|
||||||
|
Timer::Connection timer;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
h.say_hello();
|
h.say_hello();
|
||||||
|
|
||||||
int foo = h.add(2, 5);
|
int foo = h.add(2, 5);
|
||||||
PDBG("Added 2 + 5 = %d", foo);
|
PDBG("Added 2 + 5 = %d", foo);
|
||||||
|
timer.msleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user