1 <!-- Copyright (C) 2003 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 Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="eCos Synthetic Target"
23 HREF="hal-synth-arch.html"><LINK
26 HREF="synth.html"><LINK
28 TITLE="Running a Synthetic Target Application"
29 HREF="synth-running.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
71 HREF="synth-running.html"
82 NAME="SYNTH-INSTALL">Installation</H1
90 >Installation -- Preparing to use the synthetic target</DIV
94 NAME="SYNTH-INSTALL-HOST"
97 >Host-side Software</H2
99 >To get the full functionality of the synthetic target, users must
100 build and install the I/O auxiliary ecosynth and various support
101 files. It is possible to develop applications for the synthetic target
102 without the auxiliary, but only limited I/O facilities will be
103 available. The relevant code resides in the <TT
106 > subdirectory of the synthetic target
107 architectural HAL package, and building it involves the standard
121 >There are two main ways of building the host-side software. It is
122 possible to build both the generic host-side software and all
123 package-specific host-side software, including the I/O auxiliary. in a
124 single build tree. This involves using the
128 > script at the toplevel of the eCos
129 repository, which will automatically search the <TT
132 > hierarchy for host-side
133 software. For more information on this, see the
137 > file at the top of the repository.
138 Note that if you have an existing build tree which does not include
139 the synthetic target architectural HAL package then it will be
140 necessary to rerun the toplevel configure script: the search for
141 appropriate packages happens at configure time.
144 >The alternative is to build just the host-side for this package.
145 This involves creating a suitable build directory and running the
149 > script. Note that building directly in
150 the source tree is not allowed.
160 >$ cd <somewhere suitable>
163 $ <repo<>/packages/hal/synth/arch/<version>/host/configure <options>
170 >The code makes extensive use of Tcl/TK and requires version 8.3 or
171 later. This is checked by the <B
175 default it will use the system's Tcl installation in <TT
178 >. If a different, more recent Tcl
179 installation should be used then its location can be specified using
182 >--with-tcl=<path></TT
186 >--with-tcl-header=<path></TT
190 >--with-tcl-lib=<path></TT
191 >. For more information on these options
195 > file at the toplevel of the
199 >Some users may also want to specify the install location using a
202 >--prefix=<path></TT
203 > option. The default install
208 essential that the <TT
212 subdirectory of the install location is on the user's search
216 >, otherwise the eCos application will be unable to
217 locate and execute the I/O auxiliary ecosynth.
220 >Because ecosynth is run automatically by an eCos application rather
221 than explicitly by the user, it is not installed in the <TT
224 > subdirectory itself. Instead it is
229 together with various support files such as images. At configure time
230 it is usually possible to specify an alternative location for
237 >--exec-prefix=<path></TT
241 >--libexecdir=<path></TT
242 >. These options should not
243 be used for this package because the eCos application is built
244 completely separately and does not know how the host-side was
256 >When developing eCos applications for a normal embedded target it is
257 necessary to use a suitable cross-compiler and related tools such as
258 the linker. Developing for the synthetic target is easier because you
259 can just use the standard GNU tools (gcc, g++, ld, …) which
260 were provided with your Linux distribution, or which you used to build
261 your own Linux setup. Any reasonably recent version of the tools, for
262 example gcc 2.96(Red Hat) as shipped with Red Hat Linux 7, should be
266 >There is one important limitation when using these tools: current gdb
267 will not support debugging of eCos threads on the synthetic target. As
268 far as gdb is concerned a synthetic target application is
269 indistinguishable from a normal Linux application, so it assumes that
270 any threads will be created by calls to the Linux
274 > function provided by the C
275 library. Obviously this is not the case since the application is never
276 linked with that library. Therefore gdb never notices the eCos thread
277 mechanisms and assumes the application is single-threaded. Fixing this
278 is possible but would involve non-trivial changes to gdb.
281 >Theoretically it is possible to develop synthetic target applications
282 on, for example, a PC running Windows and then run the resulting
283 executables on another machine that runs Linux. This is rarely useful:
284 if a Linux machine is available then usually that machine will also be
285 used for building ecos and the application. However, if for some
286 reason it is necessary or desirable to build on another machine then
287 this requires a suitable cross-compiler and related tools. If the
288 application will be running on a typical PC with an x86 processor then
289 a suitable configure triplet would be
293 >i686-pc-linux-gnu</B
296 instructions for the various GNU tools should be consulted for further
303 NAME="SYNTH-HARDWARE"
306 >Hardware Preparation</H2
308 >Preparing a real embedded target for eCos development can be tricky.
309 Often the first step is to install suitable firmware, usually RedBoot.
310 This means creating and building a special configuration for eCos with
311 the RedBoot template, then somehow updating the target's flash chips
312 with the resulting RedBoot image. Typically it will also be necessary
313 to get a working serial connection, and possibly set up ethernet as
314 well. Although usually none of the individual steps are particularly
315 complicated, there are plenty of ways in which things can go wrong and
316 it can be hard to figure out what is actually happening. Of course
317 some board manufacturers make life easier for their developers by
318 shipping hardware with RedBoot preinstalled, but even then it is still
319 necessary to set up communication between host and target.
322 >None of this is applicable to the synthetic target. Instead you can
323 just build a normal eCos configuration, link your application with the
324 resulting libraries, and you end up with an executable that you can
325 run directly on your Linux machine or via gdb. A useful side effect of
326 this is that application development can start before any real
327 embedded hardware is actually available.
330 >Typically the memory map for a synthetic target application will be
331 set up such that there is a read-only ROM region containing all the
332 code and constant data, and a read-write RAM region for the data. The
333 default locations and sizes of these regions depend on the specific
334 platform being used for development. Note that the application always
335 executes out of ROM: on a real embedded target much of the development
336 would involve running RedBoot firmware there, with application code
337 and data loaded into RAM; usually this would change for the final
338 system; the firmware would be replaced by the eCos application itself,
339 configured for ROM bootstrap, and it would perform the appropriate
340 hardware initialization. Therefore the synthetic target actually
341 emulates the behaviour of a final system, not of a development
342 environment. In practice this is rarely significant, although having
343 the code in read-only memory can help catch some problems in
352 SUMMARY="Footer navigation table"
381 HREF="synth-running.html"
397 HREF="hal-synth-arch.html"
405 >Running a Synthetic Target Application</TD