Changes between Initial Version and Version 1 of HelloWorld


Ignore:
Timestamp:
Aug 21, 2006, 3:24:17 PM (18 years ago)
Author:
Nicolas Pouillon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HelloWorld

    v1 v1  
     1= Hello World =
     2
     3Hello world is the basic useless example. It tends to prove you have a complete working setup.
     4
     5This example will print "Hello world !" message infinitely repeated (due tu DsxThreads).
     6
     7== Task ==
     8
     9First we will create our task and declare it.
     10
     11hello.c:
     12
     13{{{
     14#include <dsx.h>
     15#include "hello_proto.h"
     16
     17FUNC(hello) {
     18    dsx_log_printf(NONE, "Hello world!\n");
     19}
     20}}}
     21
     22Task description in dsx's API:
     23
     24{{{
     25hello_task = TaskModel(
     26        'hello',
     27        impl = [
     28        SwTask('hello', stack_size = 128, sources = ['hello.c'])
     29        ] )
     30}}}
     31
     32== Test under Posix ==
     33
     34Let's create a task graph containing only this one.
     35
     36{{{
     37tcg = Tcg( Task('hello', hello_task)
     38         )
     39}}}
     40
     41And let's create Posix test application (and also a TopMakefile):
     42
     43{{{
     44px = Posix()
     45
     46tcg.generate(px)
     47TopMakefile(px)
     48}}}
     49
     50Now we can compile and launch it.
     51
     52{{{
     53$ make
     54[...]
     55$ ./exe.posix
     56Hello world!
     57Hello world!
     58Hello world!
     59Hello world!
     60Hello world!
     61Hello world!
     62Hello world!
     63Hello world!
     64^C
     65$
     66}}}
     67
     68It works !