1 <!-- Copyright (C) 2002 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Synthetic Target"
20 HREF="hal-synth-arch.html"><LINK
23 HREF="synth.html"><LINK
25 TITLE="Running a Synthetic Target Application"
26 HREF="synth-running.html"></HEAD
37 SUMMARY="Header navigation table"
46 >eCos Synthetic Target</TH
68 HREF="synth-running.html"
79 NAME="SYNTH-INSTALL">Installation</H1
87 >Installation -- Preparing to use the synthetic target</DIV
91 NAME="SYNTH-INSTALL-HOST"
94 >Host-side Software</H2
96 >To get the full functionality of the synthetic target, users must
97 build and install the I/O auxiliary ecosynth and various support
98 files. It is possible to develop applications for the synthetic target
99 without the auxiliary, but only limited I/O facilities will be
100 available. The relevant code resides in the <TT
103 > subdirectory of the synthetic target
104 architectural HAL package, and building it involves the standard
118 >There are two main ways of building the host-side software. It is
119 possible to build both the generic host-side software and all
120 package-specific host-side software, including the I/O auxiliary. in a
121 single build tree. This involves using the
125 > script at the toplevel of the eCos
126 repository, which will automatically search the <TT
129 > hierarchy for host-side
130 software. For more information on this, see the
134 > file at the top of the repository.
135 Note that if you have an existing build tree which does not include
136 the synthetic target architectural HAL package then it will be
137 necessary to rerun the toplevel configure script: the search for
138 appropriate packages happens at configure time.
141 >The alternative is to build just the host-side for this package.
142 This involves creating a suitable build directory and running the
146 > script. Note that building directly in
147 the source tree is not allowed.
157 >$ cd <somewhere suitable>
160 $ <repo<>/packages/hal/synth/arch/<version>/host/configure <options>
167 >The code makes extensive use of Tcl/TK and requires version 8.3 or
168 later. This is checked by the <B
172 default it will use the system's Tcl installation in <TT
175 >. If a different, more recent Tcl
176 installation should be used then its location can be specified using
179 >--with-tcl=<path></TT
183 >--with-tcl-header=<path></TT
187 >--with-tcl-lib=<path></TT
188 >. For more information on these options
192 > file at the toplevel of the
196 >Some users may also want to specify the install location using a
199 >--prefix=<path></TT
200 > option. The default install
205 essential that the <TT
209 subdirectory of the install location is on the user's search
213 >, otherwise the eCos application will be unable to
214 locate and execute the I/O auxiliary ecosynth.
217 >Because ecosynth is run automatically by an eCos application rather
218 than explicitly by the user, it is not installed in the <TT
221 > subdirectory itself. Instead it is
226 together with various support files such as images. At configure time
227 it is usually possible to specify an alternative location for
234 >--exec-prefix=<path></TT
238 >--libexecdir=<path></TT
239 >. These options should not
240 be used for this package because the eCos application is built
241 completely separately and does not know how the host-side was
253 >When developing eCos applications for a normal embedded target it is
254 necessary to use a suitable cross-compiler and related tools such as
255 the linker. Developing for the synthetic target is easier because you
256 can just use the standard GNU tools (gcc, g++, ld, …) which
257 were provided with your Linux distribution, or which you used to build
258 your own Linux setup. Any reasonably recent version of the tools, for
259 example gcc 2.96(Red Hat) as shipped with Red Hat Linux 7, should be
263 >There is one important limitation when using these tools: current gdb
264 will not support debugging of eCos threads on the synthetic target. As
265 far as gdb is concerned a synthetic target application is
266 indistinguishable from a normal Linux application, so it assumes that
267 any threads will be created by calls to the Linux
271 > function provided by the C
272 library. Obviously this is not the case since the application is never
273 linked with that library. Therefore gdb never notices the eCos thread
274 mechanisms and assumes the application is single-threaded. Fixing this
275 is possible but would involve non-trivial changes to gdb.
278 >Theoretically it is possible to develop synthetic target applications
279 on, for example, a PC running Windows and then run the resulting
280 executables on another machine that runs Linux. This is rarely useful:
281 if a Linux machine is available then usually that machine will also be
282 used for building ecos and the application. However, if for some
283 reason it is necessary or desirable to build on another machine then
284 this requires a suitable cross-compiler and related tools. If the
285 application will be running on a typical PC with an x86 processor then
286 a suitable configure triplet would be
290 >i686-pc-linux-gnu</B
293 instructions for the various GNU tools should be consulted for further
300 NAME="SYNTH-HARDWARE"
303 >Hardware Preparation</H2
305 >Preparing a real embedded target for eCos development can be tricky.
306 Often the first step is to install suitable firmware, usually RedBoot.
307 This means creating and building a special configuration for eCos with
308 the RedBoot template, then somehow updating the target's flash chips
309 with the resulting RedBoot image. Typically it will also be necessary
310 to get a working serial connection, and possibly set up ethernet as
311 well. Although usually none of the individual steps are particularly
312 complicated, there are plenty of ways in which things can go wrong and
313 it can be hard to figure out what is actually happening. Of course
314 some board manufacturers make life easier for their developers by
315 shipping hardware with RedBoot preinstalled, but even then it is still
316 necessary to set up communication between host and target.
319 >None of this is applicable to the synthetic target. Instead you can
320 just build a normal eCos configuration, link your application with the
321 resulting libraries, and you end up with an executable that you can
322 run directly on your Linux machine or via gdb. A useful side effect of
323 this is that application development can start before any real
324 embedded hardware is actually available.
327 >Typically the memory map for a synthetic target application will be
328 set up such that there is a read-only ROM region containing all the
329 code and constant data, and a read-write RAM region for the data. The
330 default locations and sizes of these regions depend on the specific
331 platform being used for development. Note that the application always
332 executes out of ROM: on a real embedded target much of the development
333 would involve running RedBoot firmware there, with application code
334 and data loaded into RAM; usually this would change for the final
335 system; the firmware would be replaced by the eCos application itself,
336 configured for ROM bootstrap, and it would perform the appropriate
337 hardware initialization. Therefore the synthetic target actually
338 emulates the behaviour of a final system, not of a development
339 environment. In practice this is rarely significant, although having
340 the code in read-only memory can help catch some problems in
349 SUMMARY="Footer navigation table"
369 HREF="hal-synth-arch.html"
378 HREF="synth-running.html"
398 >Running a Synthetic Target Application</TD