Changes between Version 14 and Version 15 of almosOnTsarDoc


Ignore:
Timestamp:
Aug 21, 2012, 2:10:06 AM (13 years ago)
Author:
almaless
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • almosOnTsarDoc

    v14 v15  
    3636== Start the simulation ==
    3737
    38 Before any use of the distribution package you need to set some environment variables:
     38Before '''any use''' of the distribution package you need to set some environment variables:
    3939
    4040{{{
     
    8686 4. Go to your ''DISTRIB/test/pfX'' directory and run the TSAR simulator
    8787 
    88 Some example of applications source code can be found in ''DISTRIB/test/apps''. Lets try the ''hello_world'' one. The ''main'' function of this application asks the system for the number of online cores (''count'') and then it fires ''count'' threads before it synchronizes on their end. Each fired thread executes the ''thread_func'' function which prints a "Hello World" message.
     88Some example of applications source code can be found in ''DISTRIB/apps''. Lets try the ''hello_world'' one. The ''main'' function of this application asks the system for the number of online cores (''count'') and then it fires ''count'' threads before it synchronizes on their end. Each fired thread executes the ''thread_func'' function which prints a "Hello World" message.
    8989
    9090To Cross-compile the application using ALMOS headers and static libraries:
    9191
    9292{{{
    93 $ cd DISTRIB/test/apps
     93$ cd DISTRIB/apps/hello_world
    9494$ make TARGET=tsar
    9595}}}
    9696
    97 The result is the ''./hello'' program. To install this program into ALMOS file system (''hdd-img.bin''). Just type:
     97The result is the ''./hello'' program for ALMOS. To install this program into ALMOS's file system (''hdd-img.bin''). Just type:
    9898
    9999{{{
     
    126126That is it ... you are done !!
    127127
     128In a normal situation your application may have some bugs and you need to validate it. The recommended and most convenient method is to test and validate your application on Linux before corss-compiling it for ALMOS. Lets go back to ''DISTRIB/apps/hello_world'' and clean the directory before compiling the same application for Linux:
     129
     130{{{
     131$ cd ''DISTRIB/apps/hello_world''
     132$ make realclean
     133$ make TARGET=linux
     134}}}
     135
     136This will generate the ''./hello'' program for Linux. To run it, just type:
     137
     138{{{
     139$ ./hello
     140}}}
     141
     142Now, lets take a look to the Makefile:
     143
     144{{{
     145$ cat ./Makefile
     146
     147FILES=main
     148BIN=hello
     149ADD-CFLAGS=-O3
     150
     151HDD=$(ALMOS_TEST)/pf1/hdd-img.bin
     152
     153include $(ALMOS_TOP)/include/appli.mk
     154
     155install:
     156        mcopy -i $(HDD) $(BIN) ::bin/.
     157}}}
     158
     159The ''ALMOS_TEST'' and ''ALMOS_TOP'' are an environment variables exported by sourcing the ''DISTRIB/SourceMe'' file from the ''DISTRIB'' directory. The fist one is equivalent to ''DISTRIB/test'' directory while the second is equivalent to ''DISTRIB/almos''.
     160
     161The ''mcopy'' command enables you to copy a file from your host machine file system to a FAT file system image and in particular to the ''hdd-image.bin''. ''mdir'' and ''mdel'' are another two useful utilities from the ''mtools'' package (see man mtools).
     162
    128163== Running without interactive mode ==