-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadme.txt
executable file
·318 lines (223 loc) · 12.3 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
=======================
Installing RTEMS 4.10.2
=======================
In this installation guide we present the steps to install RTEMS 4.10.2 for the
Patmos Pasim BSP. Additionally, for testing/comparison purposes, we present the
same install process for the SPARC Leon3 BSP.
Currently, both the Leon3 BSP and the Pasim BSP are completely functional.
Documentation on RTEMS can be found on:
http://www.rtems.org/onlinedocs/releases/
Documentation on version 4.10.2 of RTEMS can be found on:
http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.10.2/share/rtems/html/
As an alternative to this manual installation process, the 'build.sh' script in
the T-CREST misc repository automatically goes through all the steps required
to install RTEMS 4.10.2 for Patmos. To do so, run the script as follows:
'./build.sh rtems'
Similarly, the 'build-rtems.sh' script contained in this repository also
enables the automatic installation of both the patmos toolchain and rtems.
To do so, clone this repo and then run the script as follows:
'./build-rtems.sh -m -t -r'
This will automatically create a 't-crest' folder with 3 subfolders:
(a) 'patmos-misc' with the contents of the t-crest misc repo
(b) 'build-rtems' with the installation of the patmos toolchain for rtems
(c) 'rtems' with the 'rtems-src', 'rtems-build' and 'rtems-install' locations
==================================
Installing RTEMS 4.10.2 for Patmos
==================================
Installing the Patmos compiler
==============================
In order to compile RTEMS 4.10.2 OS for Patmos, we need to install the
Patmos compiler tool chain in a slightly different manner than the usual.
Assuming that we are using the Build Script to build the Tool Chain:
(a) Download/Checkout the build script:
'git clone https://github.com/t-crest/patmos-misc.git <misc_dir>'
(b) 'cd <misc_dir>'
(c) 'cp build.cfg.dist build.cfg', then edit build.cfg to:
(c.1) set ROOT_DIR
(c.2) change TARGET="patmos-unknown-unknown-elf" to
TARGET="patmos-unknown-rtems"
(c.3) uncomment GOLD_CXXFLAGS="-Wno-narrowing"
The RTEMS build system requires compiler, assembler and linker tools to be
compliant with the target of the installation (CPU-Vendor-OS). Therefore,
the Patmos executables created in this installation must be renamed, copied or
symbolically linked under different names. E.g. the patmos-clang compiler tool
will have to be renamed to patmos-unknown-rtems-clang:
'ln -s patmos-clang patmos-unknown-rtems-clang'
In this folder there is a script named 'build-rtems.sh' that installs the
Patmos toolchain as required by RTEMS, including renaming the Patmos binary
files. Thus, running './build-rtems.sh -m' will check out the misc repo and
then run the build.sh script with the required configurations for rtems.
The file 'target-change.sh' is responsible for renaming the Patmos tools,
hence needs to be placed in the same directory as the 'build-rtems.sh' script.
Alternatively, and assuming that the Patmos toolchain is already installed, the
'target-change.sh' script can be used alone to copy the Patmos tools,
e.g. like this: './target-change.sh ROOT_DIR'.
Finally, the Patmos executables must be added to the path environment variable
(e.g. 'export PATH=${PATH}:/ROOT_DIR/local/bin').
Similarly, the pasim simulator must also be added to the path environment
variable (e.g. 'export PATH=${PATH}:/ROOT_DIR/patmos/simulator/build/src').
The 'build-rtems.sh' script also adds these paths to the path env variable, and
in addition it adds these exports to the bashrc file.
Installing RTEMS 4.10.2
=======================
Use the command 'git clone https://github.com/t-crest/rtems <rtems_src_dir>' to
download the build files of RTEMS 4.10.2. Prior to the installation process, it
is necessary to run the bootstrap script. The bootstrap script found in the
top level directory of the RTEMS source tree is executed to produce the
automatically generated files. The bootstrap command is usually invoked in one
of the following manners:
(a) bootstrap to regenerate all files that are generated by
autoconf and automake.
(b) bootstrap -c to remove all files generated by autoconf and automake.
(c) bootstrap -p to regenerate preinstall.am files.
After cloning the RTEMS repository, the bootstrap script should be run in the
following manner:
(a) ./bootstrap -p
(b) ./bootstrap
Once RTEMS 4.10.2 is bootstraped, the configure script should run. The
configure process specializes the Makefile.in files at the time that RTEMS is
configured for a specific development host and target.
Configure for Patmos Pasim
--------------------------
Prior to configuring RTEMS with the Pasim BSP, create and go to the
configuration directory:
'mkdir <rtems_build_dir>'
'cd <rtems_build_dir>'
To configure RTEMS using the Patmos Pasim BSP, use the following command:
'<rtems_src_dir>/configure --target=patmos-unknown-rtems --enable-posix
--disable-networking --disable-cxx --enable-rtemsbsp=pasim --prefix=<rtems_install_dir>'
It is assumed that the source files for the installation are placed at
<rtems_src_dir> directory, and the variable <rtems_install_dir> should be
replaced by the installation directory (e.g. '~/t-crest/rtems/rtems-install').
The script shoud be executed from the configuration directory
(e.g. '~/t-crest/rtems/rtems-build').
The options passed to the configure script will determine which tools RTEMS
will include in the installation. In this case, the '--enable-posix' option
specifies that the POSIX API (profile 52) will be available in this
installation. Moreover, networking was disabled because the current version of
Patmos does not have an Ethernet interface. As for the '--disable-cxx' option,
since typical avionics applications do not rely on C++, there is no need to
enable it in RTEMS. An additional '--enable-tests' option can be added to this
script to instruct RTEMS to compile its testsuite.
Finish installation
-------------------
After configuring RTEMS for the specific CPU and board target, use
'make install' to install RTEMS 4.10.2. Next, set the path to the RTEMS
specific installation. Assuming '<rtems_install_dir>=~/t-crest/rtems/rtems-install':
'export RTEMS_MAKEFILE_PATH=~/t-crest/rtems/rtems-install/patmos-unknown-rtems/pasim'
Test installation
-----------------
To test installation, to check if the OS is working properly,
checkout the RTEMS Classic API examples at Github, using
'git clone https://github.com/RTEMS/examples-v2 <rtems_examples_dir>'.
Assuming '<rtems_examples_dir>=~/t-crest/rtems/rtems-examples':
(a) go to the triple period example, using
'cd ~/t-crest/rtems/rtems-examples/classic_api/triple_period'
(b) use 'make' to create the executable
(c) run the executable, using 'pasim o-optimize/triple_period.exe'
In case RTEMS was configured with tests enabled, the testsuite was compiled
in the configuration directory. Then:
(a) go to the testsuite folder in the configuration drectory, using
'cd <rtems_build_dir>/patmos-unknown-rtems/c/pasim/testsuites'
(b) go through all the test folders and execute each test individually e.g.
'cd sptests/sp01'
'pasim o-optimize/sp01.exe'
(c) compare the output of the test with the expected successful output
contained in the .scn files located in the RTEMS source tree (e.g.
'<rtems_src_dir>/testsuites/sptests/sp01/sp01.scn') to check if the
test passed
Alternatively, the 'build.sh' script in the T-CREST misc repository includes
the '-t' option that runs the complete RTEMS testsuite for Patmos and checks
its results. The 'run-testsuite.sh' script present in this repository also
performs these functions. The script should be executed from this source dir.
Run './run-testsuite.sh -h' to check the script options.
=================================
Installing RTEMS 4.10.2 for SPARC
=================================
Installing SPARC-RTEMS4.10 tools
================================
To install sparc-rtems4.10 tools, go to
http://www.rtems.org/ftp/pub/rtems/linux/4.10/ and download the appropriate
files. E.g. for the Fedora distribution of Linux, go to
http://www.rtems.org/ftp/pub/rtems/linux/4.10/fedora/17/x86_64/, and download:
(a) rtems-4.10-release-0.20130314.0-1.fc17.noarch.rpm
(b) rtems-4.10-yum-conf-0.20130314.0-1.fc17.noarch.rpm
Next, execute the following commands:
'sudo rpm -ivh rtems-4.10-release-0.20130314.0-1.fc17.noarch.rpm'
'sudo rpm -ivh rtems-4.10-yum-conf-0.20130314.0-1.fc17.noarch.rpm'
'sudo yum install rtems-4.10-sparc-rtems4.10-*'
Installing Leon3 Simulator
==========================
To install the Leon3 simulator, go to
http://www.gaisler.com/index.php/downloads/simulators?task=view&id=157, and
download file 'tsim-leon3-2.0.24.tar.gz'. Then, just use command
'tar tsim-leon3-2.0.24.tar.gz' to untar the file, and run
'export PATH=$PATH:/opt/rtems-4.10/bin' to make the tsim-leon3 simulator
available for use.
Installing RTEMS 4.10.2
=======================
Use the command 'git clone https://github.com/t-crest/rtems <rtems_src_dir>' to
download the build files of RTEMS 4.10.2. Prior to the installation process, it
is necessary to run the bootstrap script. The bootstrap script found in the
top level directory of the RTEMS source tree is executed to produce the
automatically generated files. The bootstrap command is usually invoked in one
of the following manners:
(a) bootstrap to regenerate all files that are generated by
autoconf and automake.
(b) bootstrap -c to remove all files generated by autoconf and automake.
(c) bootstrap -p to regenerate preinstall.am files.
After cloning the RTEMS repository, the bootstrap script should be run in the
following manner:
(a) ./bootstrap -p
(b) ./bootstrap
Once RTEMS 4.10.2 is bootstraped, the configure script should run. The
configure process specializes the Makefile.in files at the time that RTEMS is
configured for a specific development host and target.
Configure for SPARC Leon3
-------------------------
Prior to configuring RTEMS with the Leon3 BSP, create and go to the
configuration directory:
'mkdir <rtems_build_dir>'
'cd <rtems_build_dir>'
To configure RTEMS using the SPARC Leon3 BSP, use the following command:
'<rtems_src_dir>/configure --target=sparc-rtems4.10 --enable-posix
--disable-networking --disable-cxx --enable-rtemsbsp=leon3 --prefix=<rtems_install_dir>'
It is assumed that the source files for the installation are placed at
<rtems_src_dir> directory, and the variable <rtems_install_dir> should be replaced by
the installation directory (e.g. '~/t-crest/rtems/rtems-install'). The script shoud be
executed from the configuration directory (e.g. '~/t-crest/rtems/rtems-build').
The options passed to the configure script will determine which tools RTEMS
will include in the installation. In this case, the '--enable-posix' option
specifies that the POSIX API (profile 52) will be available in this
installation. As for the '--disable-cxx' option, since typical avionics
applications do not rely on C++, there is no need to enable it in RTEMS. An
additional '--enable-tests' option can be added to this script to instruct
RTEMS to compile its testsuite.
Finish installation
-------------------
After configuring RTEMS for the specific CPU and board target, use
'make install' to install RTEMS 4.10.2. Next, set the path to the RTEMS
specific installation.
Assuming '<rtems_install_dir>=~/t-crest/rtems/rtems-install':
'export RTEMS_MAKEFILE_PATH=~/t-crest/rtems/rtems-install/sparc-rtems4.10/leon3'
Test installation
-----------------
To test installation, to check if the OS is working properly,
checkout the RTEMS Classic API examples at Github, using
'git clone https://github.com/RTEMS/examples-v2 <rtems_examples_dir>'.
Assuming '<rtems_examples_dir>=~/t-crest/rtems/rtems-examples':
(a) go to the triple period example, using
'cd ~/t-crest/rtems/rtems-examples/classic_api/triple_period'
(b) use 'make' to create the executable
(c) run the executable, using 'tsim-leon3 o-optimize/triple_period.exe'
In case RTEMS was configured with tests enabled, the testsuite was compiled
in the configuration directory. Then:
(a) go to the testsuite folder in the configuration drectory, using
'cd <rtems_build_dir>/sparc-rtems4.10/c/leon3/testsuites'
(b) go through all the test folders and execute each test individually e.g.
'cd sptests/sp01'
'tsim-leon3 o-optimize/sp01.exe'
(c) compare the output of the test with the expected successful output
contained in the .scn files located in the RTEMS source tree (e.g.
'<rtems_src_dir>/testsuites/sptests/sp01/sp01.scn') to check if the
test passed