Changes between Version 14 and Version 15 of almosOnTsarDoc
- Timestamp:
- Aug 21, 2012, 2:10:06 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
almosOnTsarDoc
v14 v15 36 36 == Start the simulation == 37 37 38 Before any useof the distribution package you need to set some environment variables:38 Before '''any use''' of the distribution package you need to set some environment variables: 39 39 40 40 {{{ … … 86 86 4. Go to your ''DISTRIB/test/pfX'' directory and run the TSAR simulator 87 87 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.88 Some 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. 89 89 90 90 To Cross-compile the application using ALMOS headers and static libraries: 91 91 92 92 {{{ 93 $ cd DISTRIB/ test/apps93 $ cd DISTRIB/apps/hello_world 94 94 $ make TARGET=tsar 95 95 }}} 96 96 97 The result is the ''./hello'' program . To install this program into ALMOSfile system (''hdd-img.bin''). Just type:97 The result is the ''./hello'' program for ALMOS. To install this program into ALMOS's file system (''hdd-img.bin''). Just type: 98 98 99 99 {{{ … … 126 126 That is it ... you are done !! 127 127 128 In 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 136 This will generate the ''./hello'' program for Linux. To run it, just type: 137 138 {{{ 139 $ ./hello 140 }}} 141 142 Now, lets take a look to the Makefile: 143 144 {{{ 145 $ cat ./Makefile 146 147 FILES=main 148 BIN=hello 149 ADD-CFLAGS=-O3 150 151 HDD=$(ALMOS_TEST)/pf1/hdd-img.bin 152 153 include $(ALMOS_TOP)/include/appli.mk 154 155 install: 156 mcopy -i $(HDD) $(BIN) ::bin/. 157 }}} 158 159 The ''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 161 The ''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 128 163 == Running without interactive mode ==