changeset 332:7c1c8dc43ba1

Now witness the firepower of this fully armed and operational synthetic target.
author bartv
date Sun, 15 Sep 2002 17:48:26 +0000
parents 83cd88af1211
children 26852e80cb37
files packages/devs/eth/synth/ecosynth/current/ChangeLog packages/devs/eth/synth/ecosynth/current/cdl/syntheth.cdl packages/devs/eth/synth/ecosynth/current/doc/devs-eth-synth-ecosynth.html packages/devs/eth/synth/ecosynth/current/doc/makefile packages/devs/eth/synth/ecosynth/current/doc/overview.fig packages/devs/eth/synth/ecosynth/current/doc/overview.gif packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml packages/devs/eth/synth/ecosynth/current/host/Makefile.am packages/devs/eth/synth/ecosynth/current/host/Makefile.in packages/devs/eth/synth/ecosynth/current/host/acinclude.m4 packages/devs/eth/synth/ecosynth/current/host/aclocal.m4 packages/devs/eth/synth/ecosynth/current/host/configure packages/devs/eth/synth/ecosynth/current/host/configure.in packages/devs/eth/synth/ecosynth/current/host/ethernet.tcl packages/devs/eth/synth/ecosynth/current/host/ethernet.tdf packages/devs/eth/synth/ecosynth/current/host/fromnet.xbm packages/devs/eth/synth/ecosynth/current/host/netrecord.xbm packages/devs/eth/synth/ecosynth/current/host/rawether.c packages/devs/eth/synth/ecosynth/current/host/tonet.xbm packages/devs/eth/synth/ecosynth/current/src/protocol.h packages/devs/eth/synth/ecosynth/current/src/syntheth.c packages/devs/watchdog/synth/current/ChangeLog packages/devs/watchdog/synth/current/cdl/synth_watchdog.cdl packages/devs/watchdog/synth/current/doc/asleep.gif packages/devs/watchdog/synth/current/doc/awake.gif packages/devs/watchdog/synth/current/doc/devs-watchdog-synth.html packages/devs/watchdog/synth/current/doc/makefile packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml packages/devs/watchdog/synth/current/host/Makefile.am packages/devs/watchdog/synth/current/host/Makefile.in packages/devs/watchdog/synth/current/host/acinclude.m4 packages/devs/watchdog/synth/current/host/aclocal.m4 packages/devs/watchdog/synth/current/host/alarm.gif packages/devs/watchdog/synth/current/host/asleep.gif packages/devs/watchdog/synth/current/host/configure packages/devs/watchdog/synth/current/host/configure.in packages/devs/watchdog/synth/current/host/doghouse.gif packages/devs/watchdog/synth/current/host/doghouse.pov packages/devs/watchdog/synth/current/host/eye.gif packages/devs/watchdog/synth/current/host/sound1.au packages/devs/watchdog/synth/current/host/sound2.au packages/devs/watchdog/synth/current/host/watchdog.tcl packages/devs/watchdog/synth/current/host/watchdog.tdf packages/devs/watchdog/synth/current/src/synth_watchdog.cxx packages/ecos.db packages/hal/synth/arch/current/ChangeLog packages/hal/synth/arch/current/cdl/hal_synth.cdl packages/hal/synth/arch/current/doc/filters.gif packages/hal/synth/arch/current/doc/hal-synth-arch.html packages/hal/synth/arch/current/doc/layout.fig packages/hal/synth/arch/current/doc/layout.gif packages/hal/synth/arch/current/doc/menu_edit.gif packages/hal/synth/arch/current/doc/menu_file.gif packages/hal/synth/arch/current/doc/menu_help.gif packages/hal/synth/arch/current/doc/menu_view.gif packages/hal/synth/arch/current/doc/overview.fig packages/hal/synth/arch/current/doc/overview.gif packages/hal/synth/arch/current/doc/preferences.gif packages/hal/synth/arch/current/doc/screen_main.gif packages/hal/synth/arch/current/doc/synth-console.html packages/hal/synth/arch/current/doc/synth-gui.html packages/hal/synth/arch/current/doc/synth-install.html packages/hal/synth/arch/current/doc/synth-new-host.html packages/hal/synth/arch/current/doc/synth-new-target.html packages/hal/synth/arch/current/doc/synth-porting.html packages/hal/synth/arch/current/doc/synth-running.html packages/hal/synth/arch/current/doc/synth-syscalls.html packages/hal/synth/arch/current/doc/synth.html packages/hal/synth/arch/current/doc/synth.sgml packages/hal/synth/arch/current/host/Makefile.am packages/hal/synth/arch/current/host/Makefile.in packages/hal/synth/arch/current/host/acinclude.m4 packages/hal/synth/arch/current/host/aclocal.m4 packages/hal/synth/arch/current/host/configure packages/hal/synth/arch/current/host/configure.in packages/hal/synth/arch/current/host/console.tcl packages/hal/synth/arch/current/host/copy.xbm packages/hal/synth/arch/current/host/cut.xbm packages/hal/synth/arch/current/host/default.tdf packages/hal/synth/arch/current/host/ecosicon.xbm packages/hal/synth/arch/current/host/ecosiconmask.xbm packages/hal/synth/arch/current/host/ecosynth.c packages/hal/synth/arch/current/host/ecosynth.tcl packages/hal/synth/arch/current/host/help.xbm packages/hal/synth/arch/current/host/paste.xbm packages/hal/synth/arch/current/host/running1.ppm packages/hal/synth/arch/current/host/running2.ppm packages/hal/synth/arch/current/host/running3.ppm packages/hal/synth/arch/current/host/save.xbm packages/hal/synth/arch/current/host/saveall.xbm packages/hal/synth/arch/current/host/tick_no.xbm packages/hal/synth/arch/current/host/tick_yes.xbm packages/hal/synth/arch/current/host/user_initrc.tcl packages/hal/synth/arch/current/host/user_mainrc.tcl packages/hal/synth/arch/current/include/hal_io.h packages/hal/synth/arch/current/src/synth_diag.c packages/hal/synth/arch/current/src/synth_entry.c packages/hal/synth/arch/current/src/synth_intr.c packages/hal/synth/arch/current/src/synth_protocol.h packages/hal/synth/i386linux/current/ChangeLog packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S
diffstat 101 files changed, 26324 insertions(+), 450 deletions(-) [+]
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/ChangeLog
@@ -0,0 +1,35 @@
+2002-08-07  Bart Veer  <bartv@ecoscentric.com>
+
+	* synthetic target ethernet driver package created
+
+//===========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/cdl/syntheth.cdl
@@ -0,0 +1,143 @@
+# ====================================================================
+#
+#      syntheth.cdl
+#
+#      Synthetic target ethernet package.
+#
+# ====================================================================
+#####ECOSGPLCOPYRIGHTBEGIN####
+## -------------------------------------------
+## This file is part of eCos, the Embedded Configurable Operating System.
+## Copyright (C) 2002 Bart Veer
+##
+## eCos is free software; you can redistribute it and/or modify it under
+## the terms of the GNU General Public License as published by the Free
+## Software Foundation; either version 2 or (at your option) any later version.
+##
+## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+## WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with eCos; if not, write to the Free Software Foundation, Inc.,
+## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+##
+## As a special exception, if other files instantiate templates or use macros
+## or inline functions from this file, or you compile this file and link it
+## with other works to produce a work based on this file, this file does not
+## by itself cause the resulting work to be covered by the GNU General Public
+## License. However the source code for this file must still be made available
+## in accordance with section (3) of the GNU General Public License.
+##
+## This exception does not invalidate any other reasons why a work based on
+## this file might be covered by the GNU General Public License.
+##
+## Alternative licenses for eCos may be arranged by contacting the
+## copyright holder(s).
+## -------------------------------------------
+#####ECOSGPLCOPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      bartv
+# Original data:  bartv
+# Contributors:
+# Date:           2002-08-07
+#
+#####DESCRIPTIONEND####
+# ====================================================================
+
+cdl_package CYGPKG_DEVS_ETH_ECOSYNTH {
+    display     "Synthetic target ethernet driver"
+    description "
+        The ethernet driver for the eCos synthetic target allows applications
+        and other packages such as a TCP/IP stack to perform ethernet I/O.
+        This can involve either an unused ethernet device, or an emulated
+        ethernet device as provided by the Linux kernel's tunnel/tap
+        support. The eCos code interacts with a suitable Linux application
+        through the I/O auxiliary. Up to four ethernet devices are
+        supported, and the host-side target definition file controls how
+        each device will perform its I/O."
+    
+    parent      CYGPKG_IO_ETH_DRIVERS
+    active_if   CYGPKG_IO_ETH_DRIVERS
+    active_if   CYGPKG_HAL_SYNTH
+
+    cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH0 {
+	display         "Provide eth0 device"
+	description     "
+	    The synthetic target can provide up to four ethernet devices,
+	    eth0 to eth3. By default eth0 is enabled when a TCP/IP stack
+            is part of the configuration, disabled otherwise."
+	default_value   CYGPKG_NET_STACK
+	implements      CYGHWR_NET_DRIVERS
+	implements      CYGHWR_NET_DRIVER_ETH0
+    }
+    
+    cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH1 {
+	display        "Provide eth1 device"
+	description     "
+	    The synthetic target can provide up to four ethernet devices,
+	    eth0 to eth3. By default eth1 is always disabled, but can
+	    be enabled if the eCos application needs more than one ethernet
+	    device."
+	default_value 0
+	implements      CYGHWR_NET_DRIVERS
+	implements      CYGHWR_NET_DRIVER_ETH1
+    }
+
+    cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH2 {
+	display        "Provide eth2 device"
+	description     "
+	    The synthetic target can provide up to four ethernet devices,
+	    eth0 to eth3. By default eth2 is always disabled, but can
+	    be enabled if the eCos application needs more than two ethernet
+	    devices."
+	default_value 0
+	implements      CYGHWR_NET_DRIVERS
+    }
+
+    cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH3 {
+	display        "Provide eth3 device"
+	description     "
+	    The synthetic target can provide up to four ethernet devices,
+	    eth0 to eth3. By default eth3 is always disabled, but can
+	    be enabled if the eCos application needs more than three ethernet
+	    devices."
+	default_value 0
+	implements      CYGHWR_NET_DRIVERS
+    }
+
+    cdl_component CYGPKG_DEVS_ETH_ECOSYNTH_OPTIONS {
+	display     "Build options"
+	active_if   { CYGVAR_DEVS_ETH_ECOSYNTH_ETH0 || CYGVAR_DEVS_ETH_ECOSYNTH_ETH1 || CYGVAR_DEVS_ETH_ECOSYNTH_ETH2 || CYGVAR_DEVS_ETH_ECOSYNTH_ETH3 }
+	flavor      none
+	compile     -library=libextras.a syntheth.c
+	description "
+	    Package-specific build options including control over compiler
+	    flags used only in building this package."
+
+	cdl_option CYGPKG_DEVS_ETH_ECOSYNTH_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building this package. These flags are used in addition
+                to the set of global flags."
+	}
+        cdl_option CYGPKG_DEVS_ETH_ECOSYNTH_CFLAGS_REMOVE {
+            display "Suppressed compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building this package. These flags are removed from
+                the set of global flags if present."
+        }
+    }
+}
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/doc/devs-eth-synth-ecosynth.html
@@ -0,0 +1,912 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of substantively modified versions of this         -->
+<!-- document is prohibited without the explicit permission of the   -->
+<!-- copyright holder.                                               -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Synthetic Target Ethernet Driver</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><H1
+><A
+NAME="DEVS-ETH-SYNTH-ECOSYNTH">Synthetic Target Ethernet Driver</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4"
+></A
+><H2
+>Name</H2
+>Synthetic Target Ethernet Support&nbsp;--&nbsp;Allow synthetic target applications to perform ethernet I/O</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7"
+></A
+><H2
+>Overview</H2
+><P
+>The synthetic target ethernet package can provide up to four network
+devices, <TT
+CLASS="VARNAME"
+>eth0</TT
+> to <TT
+CLASS="VARNAME"
+>eth3</TT
+>. These can
+be used directly by the eCos application or, more commonly, by a
+TCP/IP stack that is linked with the eCos application. Each eCos
+device can be mapped on to a real Linux network device. For example,
+if the Linux PC has two ethernet cards and <TT
+CLASS="VARNAME"
+>eth1</TT
+> is
+not currently being used by Linux itself, then one of the eCos devices
+can be mapped on to this Linux device. Alternatively, it is possible
+to map some or all of the eCos devices on to the ethertap support
+provided by the Linux kernel.
+    </P
+><P
+>The ethernet package depends on the I/O auxiliary provided by the
+synthetic target architectural HAL package. During initialization the
+eCos application will attempt to instantiate the desired devices, by
+sending a request to the auxiliary. This will load a Tcl script
+<TT
+CLASS="FILENAME"
+>ethernet.tcl</TT
+> that is responsible for handling the
+instantiation request and subsequent I/O operations, for example
+transmitting an ethernet packet. However, some of the low-level I/O
+operations cannot conveniently be done by a Tcl script so
+<TT
+CLASS="FILENAME"
+>ethernet.tcl</TT
+> will actually run a separate program
+<B
+CLASS="COMMAND"
+>rawether</B
+> to interact with the Linux network device. 
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN17"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="overview.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>On the target-side there are configuration options to control which
+network devices should be present. For many applications a single
+device will be sufficient, but if the final eCos application is
+something like a network bridge then the package can support multiple
+devices. On the host-side each eCos network device needs to be mapped
+on to a Linux one, either a real ethernet device or an ethertap
+device. This is handled by an entry in the target definition file:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    eth0 real eth1
+    eth1 ethertap tap3 00:01:02:03:FE:05
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The ethernet package also comes with support for packet logging,
+and provides various facilities for use by user Tcl scripts.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-INSTALL"
+></A
+><H2
+>Installation</H2
+><P
+>Before a synthetic target eCos application can access ethernet devices
+it is necessary to build and install host-side support. The relevant
+code resides in the <TT
+CLASS="FILENAME"
+>host</TT
+>
+subdirectory of the synthetic target ethernet package, and building it
+involves the standard <B
+CLASS="COMMAND"
+>configure</B
+>,
+<B
+CLASS="COMMAND"
+>make</B
+> and <B
+CLASS="COMMAND"
+>make install</B
+> steps.
+The build involves a new executable <B
+CLASS="COMMAND"
+>rawether</B
+> which
+must be able to access a raw Linux network device. This is achieved by
+installing it suid root, so the <B
+CLASS="COMMAND"
+>make install</B
+> step
+has to be run with superuser privileges.
+    </P
+><DIV
+CLASS="CAUTION"
+><P
+></P
+><TABLE
+CLASS="CAUTION"
+BORDER="1"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="CENTER"
+><B
+>Caution</B
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+><P
+>Installing <B
+CLASS="COMMAND"
+>rawether</B
+> suid root introduces a
+potential security problem. Although normally
+<B
+CLASS="COMMAND"
+>rawether</B
+> is executed only by the I/O auxiliary,
+theoretically it can be run by any program. Effectively it gives any
+user the ability to monitor all ethernet traffic and to inject
+arbitrary packets into the network. Also, as with any suid root
+programs there may be as yet undiscovered exploits. Users and system
+administrators should consider the risks before running <B
+CLASS="COMMAND"
+>make
+install</B
+>. 
+    </P
+></TD
+></TR
+></TABLE
+></DIV
+><P
+>There are two main ways of building the host-side software. It is
+possible to build both the generic host-side software and all
+package-specific host-side software, including the ethernet support,
+in a single build tree. This involves using the
+<B
+CLASS="COMMAND"
+>configure</B
+> script at the toplevel of the eCos
+repository. For more information on this, see the
+<TT
+CLASS="FILENAME"
+>README.host</TT
+> file at the top of the repository.
+Note that if you have an existing build tree which does not include
+the synthetic target ethernet support then it will be necessary to
+rerun the toplevel configure script: the search for appropriate
+packages happens at configure time.
+    </P
+><P
+>The alternative is to build just the host-side for this package.
+This requires a separate build directory, building directly in the
+source tree is disallowed. The <B
+CLASS="COMMAND"
+>configure</B
+> options
+are much the same as for a build from the toplevel, and the
+<TT
+CLASS="FILENAME"
+>README.host</TT
+> file can be consulted for more
+details. It is essential that the ethernet support be configured with
+the same <TT
+CLASS="OPTION"
+>--prefix</TT
+> option as other eCos host-side
+software, especially the I/O auxiliary provided by the architectural
+synthetic target HAL package, otherwise the I/O auxiliary will be
+unable to locate the ethernet support.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-OPTIONS"
+></A
+><H2
+>Target-side Configuration Options</H2
+><P
+>The target-side code can be configured to support up to four ethernet
+devices, <TT
+CLASS="VARNAME"
+>eth0</TT
+> to <TT
+CLASS="VARNAME"
+>eth3</TT
+>. By
+default <TT
+CLASS="VARNAME"
+>eth0</TT
+> is enabled if the configuration
+includes a TCP/IP stack, otherwise it is disabled. The other three
+devices are always disabled by default. If any of the devices are
+enabled then there will also be the usual configuration options
+related to building this package. Other options related to network
+devices, for example whether or not to use DHCP, are provided by
+the generic network device package.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-REAL"
+></A
+><H2
+>Real Ethernet</H2
+><P
+>One obvious way of providing a synthetic target eCos application with
+ethernet I/O is to use a real ethernet device in the PC: transmitted
+packets go out on a real network, and packets on the network addressed
+to the right MAC address are passed on to eCos. This way synthetic
+target networking behaves just like networking on a real target with
+ethernet hardware. For example, if there is a DHCP server anywhere on
+the network then eCos will be able to contact it during networking
+startup and get hold of IP address information.
+    </P
+><P
+>Configuring the ethernet support to use a real ethernet device
+requires a simple entry in the target definition file:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    &lt;eCos device&gt; real &lt;linux device&gt;
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>For example, to map the eCos network device <TT
+CLASS="VARNAME"
+>eth0</TT
+> to
+the Linux device <TT
+CLASS="VARNAME"
+>eth1</TT
+>:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    eth0 real eth1
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>It is not possible for an ethernet device to be shared by both the
+eCos TCP/IP stack and the Linux one: there would be no simple way to
+work out which stack incoming packets are intended for. In theory
+it might be possible to do some demultiplexing using distinct IP
+addresses, but it would be impossible to support some functionality
+such as DHCP. Therefore the <B
+CLASS="COMMAND"
+>rawether</B
+> program will
+refuse to access any ethernet device already in use. On a typical
+Linux system <TT
+CLASS="VARNAME"
+>eth0</TT
+> will be used for Linux
+networking, and the PC will have to be equipped with additional
+ethernet devices for use by eCos.
+    </P
+><P
+>The <B
+CLASS="COMMAND"
+>rawether</B
+> program will access the hardware via
+the appropriate Linux device driver, so it is important that the
+system is set up such that the relevant module will be automatically
+loaded or is already loaded. The details of this will depend on the
+installed distribution and version, but typically it will involve an
+entry in <TT
+CLASS="FILENAME"
+>/etc/modules.conf</TT
+>.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-ETHERTAP"
+></A
+><H2
+>Ethertap</H2
+><P
+>The Linux kernel's ethertap facility provides a virtual network
+interface. A Linux application, for example the
+<B
+CLASS="COMMAND"
+>rawether</B
+> program, can open a special character
+device <TT
+CLASS="FILENAME"
+>/dev/net/tun</TT
+>, perform various
+<TT
+CLASS="FUNCTION"
+>ioctl</TT
+> calls, and then <TT
+CLASS="FILENAME"
+>write</TT
+>
+and <TT
+CLASS="FILENAME"
+>read</TT
+> ethernet packets. When the device is
+opened the Linux kernel automatically creates a new network interface,
+for example <TT
+CLASS="VARNAME"
+>tap0</TT
+>. The Linux TCP/IP stack can be
+made to use this network interface like any other interface, receiving
+and transmitting ethernet packets. The net effect is a virtual network
+connecting just the Linux and eCos TCP/IP stacks, with no other nodes
+attached. By default all traffic remains inside this virtual network
+and is never forwarded to a real network.
+    </P
+><P
+>Support for the ethertap facility may or may not be provided
+automatically, depending on your Linux distribution and version. If
+your system does not have a device <TT
+CLASS="FILENAME"
+>/dev/net/tun</TT
+>
+or a module <TT
+CLASS="FILENAME"
+>tun.o</TT
+> then the appropriate kernel
+documentation should be consulted, for example
+<TT
+CLASS="FILENAME"
+>/usr/src/linux-2.4/Documentation/networking/tuntap.txt</TT
+>.
+    </P
+><P
+>The target definition file is used to map eCos network devices on to
+ethertap devices. The simplest usage is:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    eth0 ethertap
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The Linux kernel will automatically allocate the next available tap
+network interface. Usually this will be <TT
+CLASS="VARNAME"
+>tap0</TT
+> but if
+other software is using the ethertap facility, for example to
+implement a VPN, then a different number may be allocated. Usually it
+will be better to specify the particular tap device that should be
+used for each eCos device, for example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    eth0 ethertap tap3
+    eth1 ethertap tap4
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The user now knows exactly which eCos device is mapped onto which
+Linux device, avoiding much potential confusion. Because the virtual
+devices are emulated ethernet devices, they require MAC addresses.
+There is no physical hardware to provide these addresses, so normally
+MAC addresses will be invented. That means that each time the eCos
+application is run it will have different MAC addresses, which makes
+it more difficult to compare the results of different runs. To get
+more deterministic behaviour it is possible to specify the MAC
+addresses in the target definition file:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    eth0 ethertap tap3 00:01:02:03:FE:05
+    eth1 ethertap tap4 00:01:02:03:FE:06
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>During the initialization phase the eCos application will instantiate
+the various network devices. This will cause the I/O auxiliary to load
+the <TT
+CLASS="FILENAME"
+>ethernet.tcl</TT
+> script and spawn
+<B
+CLASS="COMMAND"
+>rawether</B
+> processes, which in turn will
+<TT
+CLASS="FUNCTION"
+>open</TT
+> <TT
+CLASS="FILENAME"
+>/dev/net/tun</TT
+> and
+perform the appropriate <TT
+CLASS="FILENAME"
+>ioctl</TT
+> calls. On the Linux
+side there will now be new network interfaces such as
+<TT
+CLASS="VARNAME"
+>tap3</TT
+>, and these can be configured like any other
+network interface using commands such as <B
+CLASS="COMMAND"
+>ifconfig</B
+>.
+In addition, if the Linux system is set up with hotplug support then
+it may be possible to arrange for the network interface to become
+active automatically. On a Red Hat Linux system this would require
+files such as
+<TT
+CLASS="FILENAME"
+>/etc/sysconfig/network-scripts/ifcfg-tap3</TT
+>,
+containing data like:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>DEVICE="tap3"
+BOOTPROTO="none"
+BROADCAST=10.2.2.255
+IPADDR="10.2.2.1"
+NETMASK="255.255.255.0"
+NETWORK=10.2.2.0
+ONBOOT="no"</PRE
+></TD
+></TR
+></TABLE
+><P
+>This gives the Linux interface the address <TT
+CLASS="LITERAL"
+>10.2.2.1</TT
+>
+on the network <TT
+CLASS="LITERAL"
+>10.2.2.0</TT
+>. The eCos network device
+should be configured with a compatible address. One way of doing this
+would be to enable <TT
+CLASS="VARNAME"
+>CYGHWR_NET_DRIVER_ETH0_ADDRS</TT
+>,
+set <TT
+CLASS="VARNAME"
+>CYGHWR_NET_DRIVER_ETH0_ADDRS_IP</TT
+> to
+<TT
+CLASS="LITERAL"
+>10.2.2.2</TT
+>, and similarly update the
+<TT
+CLASS="VARNAME"
+>NETMASK</TT
+>, <TT
+CLASS="VARNAME"
+>BROADCAST</TT
+>,
+<TT
+CLASS="VARNAME"
+>GATEWAY</TT
+> and <TT
+CLASS="VARNAME"
+>SERVER</TT
+> configuration
+options. 
+    </P
+><P
+>It should be noted that the ethertap facility provides a virtual
+network, and any packets transmitted by the eCos application will
+not appear on a real network. Therefore usually there will no
+accessible DHCP server, and eCos cannot use DHCP or BOOTP to obtain IP
+address information. Instead the eCos configuration should use manual
+or static addresses.
+    </P
+><P
+>An alternative approach would be to set up the Linux box as a network
+bridge, using commands like <B
+CLASS="COMMAND"
+>brctl</B
+> to connect the
+virtual network interface <TT
+CLASS="VARNAME"
+>tap3</TT
+> to a physical
+network interface such as <TT
+CLASS="VARNAME"
+>eth0</TT
+>. Any packets sent by
+the eCos application will get forwarded automatically to the real
+network, and some packets on the real network will get forwarded over
+the virtual network to the eCos application. Note that the eCos
+application might also get some packets that were not intended for it,
+but usually those will just be discarded by the eCos TCP/IP stack. The
+exact details of setting up a network bridge are left as an exercise
+to the reader.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-LOGGING"
+></A
+><H2
+>Packet Logging</H2
+><P
+>The ethernet support comes with support for logging the various
+packets that are transferred, including a simple protocol analyser.
+This generates simple text output using the filter mechanisms provided
+by the I/O auxiliary, so it is possible to control the appearance and
+visibility of different types of output. For example the user might
+want to see IPv4 headers and all ICMPv4 and ARP operations, but not
+TCP headers or any of the packet data.
+    </P
+><P
+>The protocol analyser is not intended to be a fully functional
+analyser with knowledge of many different TCP/IP protocols, advanced
+search facilities, graphical traffic displays, and so on.
+Functionality like that is already provided by other tools such as
+<SPAN
+CLASS="APPLICATION"
+>ethereal</SPAN
+> and
+<SPAN
+CLASS="APPLICATION"
+>tcpdump</SPAN
+>. Achieving similar levels of
+functionality would require a lot of work, for very little gain. It is
+still useful to have some protocol analysis functionality available
+because the output will be interleaved with other output, for example
+<TT
+CLASS="FILENAME"
+>printf</TT
+> calls from the application. That may make
+it easier to understand the sequence of events.
+    </P
+><P
+>One problem with logging ethernet traffic is that it can involve very
+large amounts of data. If the application is expected to run for a
+long time or is very I/O intensive then it is easy to end up with many
+megabytes. When running in graphical mode all the logging data will be
+held in memory, even data that is not currently visible. At some point
+the system will begin to run low on memory and performance will
+suffer. To avoid problems, the ethernet script maintains a flag that
+controls whether or not packet logging is active. The default is to
+run with logging disabled, but this can be changed in the target
+definition file:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    &#8230;
+    logging 1
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The ethernet script will add a toolbar button that allows this flag to
+be changed at run-time, allowing the user to capture traffic for
+certain periods of time while the application continues running.
+    </P
+><P
+>The target definition file can contain the following entries for the
+various packet logging filters:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    &#8230;
+    filter ether  -hide 0 -background LightBlue -foreground "#000080"
+    filter arp    -hide 0 -background LightBlue -foreground "#000050"
+    filter ipv4   -hide 0 -background LightBlue -foreground "#000040"
+    filter ipv6   -hide 1 -background LightBlue -foreground "#000040"
+    filter icmpv4 -hide 0 -background LightBlue -foreground "#000070"
+    filter icmpv6 -hide 1 -background LightBlue -foreground "#000070"
+    filter udp    -hide 0 -background LightBlue -foreground "#000030"
+    filter tcp    -hide 0 -background LightBlue -foreground "#000020"
+    filter hexdata   -hide 1 -background LightBlue -foreground "#000080"
+    filter asciidata -hide 1 -background LightBlue -foreground "#000080"
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>All output will show the eCos network device, for example
+<TT
+CLASS="LITERAL"
+>eth0</TT
+>, and the direction relative to the eCos
+application. Some of the filters will show packet headers, for example
+<TT
+CLASS="LITERAL"
+>ether</TT
+> gives details of the ethernet packet header
+and <TT
+CLASS="LITERAL"
+>tcp</TT
+> gives information about TCP headers such as
+whether or not the SYN flag is set. The TCP and UDP filters will also
+show source and destination addresses, using numerical addresses and
+if possible host names. However, host names will only be shown if the
+host appears in <TT
+CLASS="FILENAME"
+>/etc/hosts</TT
+>: doing full DNS
+lookups while the data is being captured would add significantly to
+complexity and overhead. The <TT
+CLASS="LITERAL"
+>hexdata</TT
+> and
+<TT
+CLASS="LITERAL"
+>asciidata</TT
+> filters show the remainder of the packets
+after the ethernet, IP and TCP or UDP headers have been stripped.
+    </P
+><P
+>Some of the filters will provide raw dumps of some of the packet data.
+Showing up to 1500 bytes of data for each packet would be expensive,
+and often the most interesting information is near the start of the
+packet. Therefore it is possible to set a limit on the number of bytes
+that will be shown using the target definition file. The default limit
+is 64 bytes.
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device ethernet {
+    &#8230;
+    max_show 128
+}</PRE
+></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-GUI"
+></A
+><H2
+>User Interface Additions</H2
+><P
+>When running in graphical mode the ethernet script extends the user
+interface in two ways: a button is added to the toolbar so that users
+can enable or disable packet logging; and an entry is added to the
+<SPAN
+CLASS="GUIMENU"
+>Help</SPAN
+> menu for the ethernet-specific documentation.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-ARGS"
+></A
+><H2
+>Command Line Arguments</H2
+><P
+>The synthetic target ethernet support does not use any command line
+arguments. All configuration is handled through the target definition
+file. 
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-HOOKS"
+></A
+><H2
+>Hooks</H2
+><P
+>The ethernet support defines two hooks that can be used by other
+scripts, especially user scripts: <TT
+CLASS="LITERAL"
+>ethernet_tx</TT
+> and
+<TT
+CLASS="LITERAL"
+>ethernet_rx</TT
+>. The tx hook is called whenever eCos
+tries to transmit a packet. The rx hook is called whenever an incoming
+packet is passed to the eCos application. Note that this may be a
+little bit after the packet was actually received by the I/O auxiliary
+since it can buffer some packets. Both hooks are called with two
+arguments, the name of the network device and the packet being
+transferred. Typical usage might look like:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>  proc my_tx_hook { arg_list } {
+    set dev [lindex $arg_list 0]
+    incr ::my_ethernet_tx_packets($dev)
+    incr ::my_ethernet_tx_bytes($dev) [string length [lindex $arg_list 1]]
+  }
+  proc my_rx_hook { arg_list } {
+    set dev [lindex $arg_list 0]
+    incr ::my_ethernet_rx_packets($dev)
+    incr ::my_ethernet_rx_bytes($dev) [string length [lindex $arg_list 1]]
+  }
+  synth::hook_add "ethernet_tx" my_tx_hook
+  synth::hook_add "ethernet_rx" my_rx_hook</PRE
+></TD
+></TR
+></TABLE
+><P
+>The global arrays <TT
+CLASS="VARNAME"
+>my_ethernet_tx_packets</TT
+> etc. will
+now be updated whenever there is ethernet traffic. Other code,
+probably running at regular intervals by use of the Tcl
+<B
+CLASS="COMMAND"
+>after</B
+> procedure, can then use this information to
+update a graphical monitor of some sort.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-ETH-ECOSYNTH-TCL"
+></A
+><H2
+>Additional Tcl Procedures</H2
+><P
+>The ethernet support provides one additional Tcl procedure that can be
+used by other scripts;
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>ethernet::devices_get_list    </PRE
+></TD
+></TR
+></TABLE
+><P
+>This procedure returns a list of the ethernet devices that have been
+instantiated, for example <TT
+CLASS="LITERAL"
+>{eth0 eth1}</TT
+>.
+    </P
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/doc/makefile
@@ -0,0 +1,34 @@
+#=============================================================================
+#
+#    makefile
+#
+#    For building the synthetic target ethernet package documentation
+#
+#=============================================================================
+#####COPYRIGHTBEGIN####
+#                                                                          
+# ===============================================================
+# Copyright (C) 2002 Bart Veer
+# This material may be distributed only subject to the terms
+# and conditions set forth in the Open Publication License, v1.0
+# or later (the latest version is presently available at
+# http://www.opencontent.org/openpub/)
+# ===============================================================
+#                                                                          
+#####COPYRIGHTEND####
+#=============================================================================
+#####DESCRIPTIONBEGIN####
+#
+# Author(s):     bartv
+# Date:          2002-08-20
+#####DESCRIPTIONEND####
+#=============================================================================
+
+TOPLEVEL   := ../../../../../..
+MAIN_SGML  := syntheth.sgml
+MAIN_HTML  := devs-eth-synth.html
+MAIN_PDF   := devs-eth-synth.pdf
+OTHER_SGML :=
+PICTURES   :=
+
+include $(TOPLEVEL)/pkgconf/rules.doc
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/doc/overview.fig
@@ -0,0 +1,54 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 1500 300 1500 1500
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 2400 300 2400 1500
+2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+	 300 300 3000 300 3000 1500 300 1500 300 300
+2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
+	 3600 300 6000 300 6000 1500 3600 1500 3600 300
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 4800 300 4800 1500
+2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 3000 900 3600 900
+2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6000 1050 6600 1050
+2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 7500 450 8100 450
+2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 7500 1050 8100 1050
+2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
+	 6600 900 7500 900 7500 1200 6600 1200 6600 900
+2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
+	 6600 300 7500 300 7500 600 6600 600 6600 300
+2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6000 450 6600 450
+4 0 0 50 0 0 12 0.0000 4 180 825 375 1200 application\001
+4 0 0 50 0 0 12 0.0000 4 135 390 600 900 eCos\001
+4 0 0 50 0 0 12 0.0000 4 135 540 1650 900 TCP/IP\001
+4 0 0 50 0 0 12 0.0000 4 135 330 2550 675 eth0\001
+4 0 0 50 0 0 12 0.0000 4 135 330 2550 1200 eth1\001
+4 0 0 50 0 0 12 0.0000 4 180 975 3675 900 I/O Auxiliary\001
+4 0 0 50 0 0 12 0.0000 4 135 870 4950 900 ethernet.tcl\001
+4 0 0 50 0 0 12 0.0000 4 135 330 8175 525 eth1\001
+4 0 0 50 0 0 12 0.0000 4 180 330 8175 1125 tap3\001
+4 0 0 50 0 0 12 0.0000 4 135 675 6675 1125 rawether\001
+4 0 0 50 0 0 12 0.0000 4 135 675 6675 525 rawether\001
new file mode 100644
index 0000000000000000000000000000000000000000..d404959783366417f0eafc180c0d2bae6d8182d3
GIT binary patch
literal 1581
zc$@((2GaRQNk%v~VI%@l0Du4h00030|Nkri0000a0#X0~0{)DTsmtvTqnxzbi?iOm
z`wxcVNMgW=rs~SJ?hD8AOxO1PmI}`I{tpbYbP1ucMI-@|%w03HY(|;WC)N6_61CU}
zw|n`5L*ntGEJBmbIyGD4{>0hyx6_`+JL(+%#;*qf7`T^3cy=f;n0Uu%uo!0O2scS7
zRT%(DhsnvQS@GE^>LocD3U)fGDp$Jd+L20H8EZxRdP`wjh|3#!Ig+Z|w^Jo-XUzJ0
z)r-j7cz^;GjbI#144Gom{OJ75i0s|gT{KSpxFU_tg&n0f*N$#7^l-xc3~q)$tem8e
zS`O_<3@1ybwX-)QTPA~<1PRP>Et^7n6wCRuv@D}V{(u!#q?^`|oVkz(=ap3Wj@m>E
z@y^6M2yG<5i%?o^;TUoz19sbDa+~6DVL*gJWzyRz%?nVN#f;*7n#(3sXEfKH%UQ2p
zQHBk*!W5Jb9#f+<r_PdUmRD6`=e&0GS`eYuqDRBRBiR;c+P%9p^2N3GtgEtU2?h4s
zjWEBPf>$X<d}xrCmElS}?uYZRqsxCXW0EWqjplKj#Vt-$x+cfeU=@AM30ov&W~_k~
z4pf_^=f*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?x^{_Ro?ZpI3C`{Vt*s?8UfslE#gCYBVcnpP^2~aoe
z%JC#f7YNp`huvdZ{-z#QzzmiRa7N@{^Ez>{tT>Q7uoL3}Nq9F?xMzfC9AfRds1~aI
z18loG9}T~F#5WdkkCtg&5YQH+#64(k8?;a%Yr(pM9WsxMT%^hzsYggIOpcOtV<n@;
z$2$@+lI!u@B{3O8By!S=nRMJI0a(fpb`X@E<l-p}=}AqF5|yE><tq#4N-NrpNYZQN
zEn)dfx3MyqS|nx)jXBE~BD0vwv}7}Zxyok>azxW4pC}tiOJBnAnamVg);5XF+r^Tb
zRn+D+NtsLpjgy?tjN>=cIZSuvlAYaz+h-`Lnt7U%p2y@TE~DAZYI;bZqaq|f37R2<
fhRLAxROo>c{0PyAO4K-6n5acB3Q>Pfpa1|nKLHXz
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml
@@ -0,0 +1,506 @@
+<!DOCTYPE refentry  PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
+
+<!-- {{{ Banner                         -->
+
+<!-- =============================================================== -->
+<!--                                                                 -->
+<!--     syntheth.sgml                                               -->
+<!--                                                                 -->
+<!--     Synthetic target ethernet support package.                  -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+<!-- ####COPYRIGHTBEGIN####                                          -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+<!-- Copyright (C) 2002 Bart Veer                                    -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- =============================================================== -->
+<!--                                                                 -->      
+<!-- ####COPYRIGHTEND####                                            -->
+<!-- =============================================================== -->
+<!-- #####DESCRIPTIONBEGIN####                                       -->
+<!--                                                                 -->
+<!-- Author(s):   bartv                                              -->
+<!-- Contact(s):  bartv                                              -->
+<!-- Date:        2002/08/20                                         -->
+<!-- Version:     0.01                                               -->
+<!--                                                                 -->
+<!-- ####DESCRIPTIONEND####                                          -->
+<!-- =============================================================== -->
+
+<!-- }}} -->
+
+<refentry id="devs-eth-synth-ecosynth">
+  <refmeta>
+    <refentrytitle>Synthetic Target Ethernet Driver</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>Synthetic Target Ethernet Support</refname>
+    <refpurpose>Allow synthetic target applications to perform ethernet I/O</refpurpose> 
+  </refnamediv>
+
+  <refsect1><title>Overview</title>
+    <para>
+The synthetic target ethernet package can provide up to four network
+devices, <varname>eth0</varname> to <varname>eth3</varname>. These can
+be used directly by the eCos application or, more commonly, by a
+TCP/IP stack that is linked with the eCos application. Each eCos
+device can be mapped on to a real Linux network device. For example,
+if the Linux PC has two ethernet cards and <varname>eth1</varname> is
+not currently being used by Linux itself, then one of the eCos devices
+can be mapped on to this Linux device. Alternatively, it is possible
+to map some or all of the eCos devices on to the ethertap support
+provided by the Linux kernel.
+    </para>
+    <para>
+The ethernet package depends on the I/O auxiliary provided by the
+synthetic target architectural HAL package. During initialization the
+eCos application will attempt to instantiate the desired devices, by
+sending a request to the auxiliary. This will load a Tcl script
+<filename>ethernet.tcl</filename> that is responsible for handling the
+instantiation request and subsequent I/O operations, for example
+transmitting an ethernet packet. However, some of the low-level I/O
+operations cannot conveniently be done by a Tcl script so
+<filename>ethernet.tcl</filename> will actually run a separate program
+<command>rawether</command> to interact with the Linux network device. 
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="overview.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+On the target-side there are configuration options to control which
+network devices should be present. For many applications a single
+device will be sufficient, but if the final eCos application is
+something like a network bridge then the package can support multiple
+devices. On the host-side each eCos network device needs to be mapped
+on to a Linux one, either a real ethernet device or an ethertap
+device. This is handled by an entry in the target definition file:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    eth0 real eth1
+    eth1 ethertap tap3 00:01:02:03:FE:05
+    &hellip;
+}
+</programlisting>
+    <para>
+The ethernet package also comes with support for packet logging,
+and provides various facilities for use by user Tcl scripts.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-install"><title>Installation</title>
+    <para>
+Before a synthetic target eCos application can access ethernet devices
+it is necessary to build and install host-side support. The relevant
+code resides in the <filename class="directory">host</filename>
+subdirectory of the synthetic target ethernet package, and building it
+involves the standard <command>configure</command>,
+<command>make</command> and <command>make install</command> steps.
+The build involves a new executable <command>rawether</command> which
+must be able to access a raw Linux network device. This is achieved by
+installing it suid root, so the <command>make install</command> step
+has to be run with superuser privileges.
+    </para>
+    <caution><para>
+Installing <command>rawether</command> suid root introduces a
+potential security problem. Although normally
+<command>rawether</command> is executed only by the I/O auxiliary,
+theoretically it can be run by any program. Effectively it gives any
+user the ability to monitor all ethernet traffic and to inject
+arbitrary packets into the network. Also, as with any suid root
+programs there may be as yet undiscovered exploits. Users and system
+administrators should consider the risks before running <command>make
+install</command>. 
+    </para></caution>
+    <para>
+There are two main ways of building the host-side software. It is
+possible to build both the generic host-side software and all
+package-specific host-side software, including the ethernet support,
+in a single build tree. This involves using the
+<command>configure</command> script at the toplevel of the eCos
+repository. For more information on this, see the
+<filename>README.host</filename> file at the top of the repository.
+Note that if you have an existing build tree which does not include
+the synthetic target ethernet support then it will be necessary to
+rerun the toplevel configure script: the search for appropriate
+packages happens at configure time.
+    </para>
+    <para>
+The alternative is to build just the host-side for this package.
+This requires a separate build directory, building directly in the
+source tree is disallowed. The <command>configure</command> options
+are much the same as for a build from the toplevel, and the
+<filename>README.host</filename> file can be consulted for more
+details. It is essential that the ethernet support be configured with
+the same <option>--prefix</option> option as other eCos host-side
+software, especially the I/O auxiliary provided by the architectural
+synthetic target HAL package, otherwise the I/O auxiliary will be
+unable to locate the ethernet support.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-options"><title>Target-side Configuration Options</title>
+    <para>
+The target-side code can be configured to support up to four ethernet
+devices, <varname>eth0</varname> to <varname>eth3</varname>. By
+default <varname>eth0</varname> is enabled if the configuration
+includes a TCP/IP stack, otherwise it is disabled. The other three
+devices are always disabled by default. If any of the devices are
+enabled then there will also be the usual configuration options
+related to building this package. Other options related to network
+devices, for example whether or not to use DHCP, are provided by
+the generic network device package.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-real"><title>Real Ethernet</title>
+    <para>
+One obvious way of providing a synthetic target eCos application with
+ethernet I/O is to use a real ethernet device in the PC: transmitted
+packets go out on a real network, and packets on the network addressed
+to the right MAC address are passed on to eCos. This way synthetic
+target networking behaves just like networking on a real target with
+ethernet hardware. For example, if there is a DHCP server anywhere on
+the network then eCos will be able to contact it during networking
+startup and get hold of IP address information.
+    </para>
+    <para>
+Configuring the ethernet support to use a real ethernet device
+requires a simple entry in the target definition file:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    &lt;eCos device&gt; real &lt;linux device&gt;
+    &hellip;
+}
+</programlisting>
+    <para>
+For example, to map the eCos network device <varname>eth0</varname> to
+the Linux device <varname>eth1</varname>:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    eth0 real eth1
+    &hellip;
+}
+</programlisting>
+    <para>
+It is not possible for an ethernet device to be shared by both the
+eCos TCP/IP stack and the Linux one: there would be no simple way to
+work out which stack incoming packets are intended for. In theory
+it might be possible to do some demultiplexing using distinct IP
+addresses, but it would be impossible to support some functionality
+such as DHCP. Therefore the <command>rawether</command> program will
+refuse to access any ethernet device already in use. On a typical
+Linux system <varname>eth0</varname> will be used for Linux
+networking, and the PC will have to be equipped with additional
+ethernet devices for use by eCos.
+    </para>
+    <para>
+The <command>rawether</command> program will access the hardware via
+the appropriate Linux device driver, so it is important that the
+system is set up such that the relevant module will be automatically
+loaded or is already loaded. The details of this will depend on the
+installed distribution and version, but typically it will involve an
+entry in <filename>/etc/modules.conf</filename>.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-ethertap"><title>Ethertap</title>
+    <para>
+The Linux kernel's ethertap facility provides a virtual network
+interface. A Linux application, for example the
+<command>rawether</command> program, can open a special character
+device <filename>/dev/net/tun</filename>, perform various
+<function>ioctl</function> calls, and then <filename>write</filename>
+and <filename>read</filename> ethernet packets. When the device is
+opened the Linux kernel automatically creates a new network interface,
+for example <varname>tap0</varname>. The Linux TCP/IP stack can be
+made to use this network interface like any other interface, receiving
+and transmitting ethernet packets. The net effect is a virtual network
+connecting just the Linux and eCos TCP/IP stacks, with no other nodes
+attached. By default all traffic remains inside this virtual network
+and is never forwarded to a real network.
+    </para>
+    <para>
+Support for the ethertap facility may or may not be provided
+automatically, depending on your Linux distribution and version. If
+your system does not have a device <filename>/dev/net/tun</filename>
+or a module <filename>tun.o</filename> then the appropriate kernel
+documentation should be consulted, for example
+<filename>/usr/src/linux-2.4/Documentation/networking/tuntap.txt</filename>.
+    </para>
+    <para>
+The target definition file is used to map eCos network devices on to
+ethertap devices. The simplest usage is:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    eth0 ethertap
+    &hellip;
+}
+</programlisting>
+    <para>
+The Linux kernel will automatically allocate the next available tap
+network interface. Usually this will be <varname>tap0</varname> but if
+other software is using the ethertap facility, for example to
+implement a VPN, then a different number may be allocated. Usually it
+will be better to specify the particular tap device that should be
+used for each eCos device, for example:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    eth0 ethertap tap3
+    eth1 ethertap tap4
+    &hellip;
+}
+</programlisting>
+    <para>
+The user now knows exactly which eCos device is mapped onto which
+Linux device, avoiding much potential confusion. Because the virtual
+devices are emulated ethernet devices, they require MAC addresses.
+There is no physical hardware to provide these addresses, so normally
+MAC addresses will be invented. That means that each time the eCos
+application is run it will have different MAC addresses, which makes
+it more difficult to compare the results of different runs. To get
+more deterministic behaviour it is possible to specify the MAC
+addresses in the target definition file:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    eth0 ethertap tap3 00:01:02:03:FE:05
+    eth1 ethertap tap4 00:01:02:03:FE:06
+    &hellip;
+}
+</programlisting>
+    <para>
+During the initialization phase the eCos application will instantiate
+the various network devices. This will cause the I/O auxiliary to load
+the <filename>ethernet.tcl</filename> script and spawn
+<command>rawether</command> processes, which in turn will
+<function>open</function> <filename>/dev/net/tun</filename> and
+perform the appropriate <filename>ioctl</filename> calls. On the Linux
+side there will now be new network interfaces such as
+<varname>tap3</varname>, and these can be configured like any other
+network interface using commands such as <command>ifconfig</command>.
+In addition, if the Linux system is set up with hotplug support then
+it may be possible to arrange for the network interface to become
+active automatically. On a Red Hat Linux system this would require
+files such as
+<filename>/etc/sysconfig/network-scripts/ifcfg-tap3</filename>,
+containing data like:
+    </para>
+    <programlisting>
+DEVICE="tap3"
+BOOTPROTO="none"
+BROADCAST=10.2.2.255
+IPADDR="10.2.2.1"
+NETMASK="255.255.255.0"
+NETWORK=10.2.2.0
+ONBOOT="no"
+</programlisting>
+    <para>
+This gives the Linux interface the address <literal>10.2.2.1</literal>
+on the network <literal>10.2.2.0</literal>. The eCos network device
+should be configured with a compatible address. One way of doing this
+would be to enable <varname>CYGHWR_NET_DRIVER_ETH0_ADDRS</varname>,
+set <varname>CYGHWR_NET_DRIVER_ETH0_ADDRS_IP</varname> to
+<literal>10.2.2.2</literal>, and similarly update the
+<varname>NETMASK</varname>, <varname>BROADCAST</varname>,
+<varname>GATEWAY</varname> and <varname>SERVER</varname> configuration
+options. 
+    </para>
+    <para>
+It should be noted that the ethertap facility provides a virtual
+network, and any packets transmitted by the eCos application will
+not appear on a real network. Therefore usually there will no
+accessible DHCP server, and eCos cannot use DHCP or BOOTP to obtain IP
+address information. Instead the eCos configuration should use manual
+or static addresses.
+    </para>
+    <para>
+An alternative approach would be to set up the Linux box as a network
+bridge, using commands like <command>brctl</command> to connect the
+virtual network interface <varname>tap3</varname> to a physical
+network interface such as <varname>eth0</varname>. Any packets sent by
+the eCos application will get forwarded automatically to the real
+network, and some packets on the real network will get forwarded over
+the virtual network to the eCos application. Note that the eCos
+application might also get some packets that were not intended for it,
+but usually those will just be discarded by the eCos TCP/IP stack. The
+exact details of setting up a network bridge are left as an exercise
+to the reader.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-logging"><title>Packet Logging</title>
+    <para>
+The ethernet support comes with support for logging the various
+packets that are transferred, including a simple protocol analyser.
+This generates simple text output using the filter mechanisms provided
+by the I/O auxiliary, so it is possible to control the appearance and
+visibility of different types of output. For example the user might
+want to see IPv4 headers and all ICMPv4 and ARP operations, but not
+TCP headers or any of the packet data.
+    </para>
+    <para>
+The protocol analyser is not intended to be a fully functional
+analyser with knowledge of many different TCP/IP protocols, advanced
+search facilities, graphical traffic displays, and so on.
+Functionality like that is already provided by other tools such as
+<application>ethereal</application> and
+<application>tcpdump</application>. Achieving similar levels of
+functionality would require a lot of work, for very little gain. It is
+still useful to have some protocol analysis functionality available
+because the output will be interleaved with other output, for example
+<filename>printf</filename> calls from the application. That may make
+it easier to understand the sequence of events.
+    </para>
+    <para>
+One problem with logging ethernet traffic is that it can involve very
+large amounts of data. If the application is expected to run for a
+long time or is very I/O intensive then it is easy to end up with many
+megabytes. When running in graphical mode all the logging data will be
+held in memory, even data that is not currently visible. At some point
+the system will begin to run low on memory and performance will
+suffer. To avoid problems, the ethernet script maintains a flag that
+controls whether or not packet logging is active. The default is to
+run with logging disabled, but this can be changed in the target
+definition file:
+    </para>
+    <programlisting>
+synth_device ethernet {
+    &hellip;
+    logging 1
+}
+</programlisting>
+    <para>
+The ethernet script will add a toolbar button that allows this flag to
+be changed at run-time, allowing the user to capture traffic for
+certain periods of time while the application continues running.
+    </para>
+    <para>
+The target definition file can contain the following entries for the
+various packet logging filters:
+    </para>
+    <programlisting width=72>
+synth_device ethernet {
+    &hellip;
+    filter ether  -hide 0 -background LightBlue -foreground "#000080"
+    filter arp    -hide 0 -background LightBlue -foreground "#000050"
+    filter ipv4   -hide 0 -background LightBlue -foreground "#000040"
+    filter ipv6   -hide 1 -background LightBlue -foreground "#000040"
+    filter icmpv4 -hide 0 -background LightBlue -foreground "#000070"
+    filter icmpv6 -hide 1 -background LightBlue -foreground "#000070"
+    filter udp    -hide 0 -background LightBlue -foreground "#000030"
+    filter tcp    -hide 0 -background LightBlue -foreground "#000020"
+    filter hexdata   -hide 1 -background LightBlue -foreground "#000080"
+    filter asciidata -hide 1 -background LightBlue -foreground "#000080"
+}
+</programlisting>
+    <para>
+All output will show the eCos network device, for example
+<literal>eth0</literal>, and the direction relative to the eCos
+application. Some of the filters will show packet headers, for example
+<literal>ether</literal> gives details of the ethernet packet header
+and <literal>tcp</literal> gives information about TCP headers such as
+whether or not the SYN flag is set. The TCP and UDP filters will also
+show source and destination addresses, using numerical addresses and
+if possible host names. However, host names will only be shown if the
+host appears in <filename>/etc/hosts</filename>: doing full DNS
+lookups while the data is being captured would add significantly to
+complexity and overhead. The <literal>hexdata</literal> and
+<literal>asciidata</literal> filters show the remainder of the packets
+after the ethernet, IP and TCP or UDP headers have been stripped.
+    </para>
+    <para>
+Some of the filters will provide raw dumps of some of the packet data.
+Showing up to 1500 bytes of data for each packet would be expensive,
+and often the most interesting information is near the start of the
+packet. Therefore it is possible to set a limit on the number of bytes
+that will be shown using the target definition file. The default limit
+is 64 bytes.
+    </para>
+    <programlisting width=72>
+synth_device ethernet {
+    &hellip;
+    max_show 128
+}
+</programlisting>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-gui"><title>User Interface Additions</title>
+    <para>
+When running in graphical mode the ethernet script extends the user
+interface in two ways: a button is added to the toolbar so that users
+can enable or disable packet logging; and an entry is added to the
+<guimenu>Help</guimenu> menu for the ethernet-specific documentation.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-args"><title>Command Line Arguments</title>
+    <para>
+The synthetic target ethernet support does not use any command line
+arguments. All configuration is handled through the target definition
+file. 
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-hooks"><title>Hooks</title>
+    <para>
+The ethernet support defines two hooks that can be used by other
+scripts, especially user scripts: <literal>ethernet_tx</literal> and
+<literal>ethernet_rx</literal>. The tx hook is called whenever eCos
+tries to transmit a packet. The rx hook is called whenever an incoming
+packet is passed to the eCos application. Note that this may be a
+little bit after the packet was actually received by the I/O auxiliary
+since it can buffer some packets. Both hooks are called with two
+arguments, the name of the network device and the packet being
+transferred. Typical usage might look like:
+    </para>
+    <programlisting>
+  proc my_tx_hook { arg_list } {
+    set dev [lindex $arg_list 0]
+    incr ::my_ethernet_tx_packets($dev)
+    incr ::my_ethernet_tx_bytes($dev) [string length [lindex $arg_list 1]]
+  }
+  proc my_rx_hook { arg_list } {
+    set dev [lindex $arg_list 0]
+    incr ::my_ethernet_rx_packets($dev)
+    incr ::my_ethernet_rx_bytes($dev) [string length [lindex $arg_list 1]]
+  }
+  synth::hook_add "ethernet_tx" my_tx_hook
+  synth::hook_add "ethernet_rx" my_rx_hook
+</programlisting>
+    <para>
+The global arrays <varname>my_ethernet_tx_packets</varname> etc. will
+now be updated whenever there is ethernet traffic. Other code,
+probably running at regular intervals by use of the Tcl
+<command>after</command> procedure, can then use this information to
+update a graphical monitor of some sort.
+    </para>  
+  </refsect1>
+
+  <refsect1 id="devs-eth-ecosynth-tcl"><title>Additional Tcl Procedures</title>
+    <para>
+The ethernet support provides one additional Tcl procedure that can be
+used by other scripts;
+    </para>
+    <programlisting>
+ethernet::devices_get_list    
+</programlisting>
+    <para>
+This procedure returns a list of the ethernet devices that have been
+instantiated, for example <literal>{eth0 eth1}</literal>.
+    </para>
+  </refsect1>
+
+</refentry>
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/Makefile.am
@@ -0,0 +1,91 @@
+## Process this file with automake to produce Makefile.in
+## =====================================================================
+##
+##     Makefile.am
+##
+##     Build support for the host-side synthetic target support,
+##     the ethernetpackage.
+##
+## =====================================================================
+######COPYRIGHTBEGIN####
+#                                                                          
+# ----------------------------------------------------------------------------
+# Copyright (C) 2002 Bart Veer
+#
+# This file is part of the eCos synthetic target ethernet support.
+#
+# This program is free software; you can redistribute it and/or modify it 
+# under the terms of the GNU General Public License as published by the Free 
+# Software Foundation; either version 2 of the License, or (at your option) 
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful, but WITHOUT 
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+# more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# ----------------------------------------------------------------------------
+#                                                                          
+######COPYRIGHTEND####
+## =====================================================================
+#######DESCRIPTIONBEGIN####
+##
+## Author(s):	bartv
+## Contact(s):	bartv
+## Date:	2002/08/07
+## Version:	0.01
+##
+######DESCRIPTIONEND####
+## =====================================================================
+
+AUTOMAKE_OPTIONS = 1.3 foreign
+
+## Only some platforms are supported. Having the configure script throw
+## an error when attempting to configure on an unsupported platform
+## would be a mistake, since that would prevent any configury from
+## the toplevel on unsupported platforms. Instead an automake conditional
+## is used, leading to null makefiles on unsupported platforms.
+
+if SUPPORTED
+
+AM_CFLAGS       = @ecos_CFLAGS@ -DECOSYNTH_VERSION=\"@VERSION@\" \
+ -DECOS_REPOSITORY=\"@ECOS_REPOSITORY@\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DPACKAGE_DIR=\"@PACKAGE_DIR@\" \
+ -DPACKAGE_VERSION=\"@PACKAGE_VERSION@\" \
+ -DPACKAGE_INSTALL=\"@PACKAGE_INSTALL@\"
+AM_CXXFLAGS     = @ecos_CXXFLAGS@
+INCLUDES        = @ecos_INCLUDES@
+LIBS            = @ecos_LIBS@ @ecos_LDADD@
+
+## The synthetic target support consists of a single program rawether,
+## a number of Tcl scripts, and some additional data files. These are
+## all installed in a single directory $(libexec)/ecos/<package>_<version>/
+## Neither the rawether executable nor any of the scripts are directly
+## executable, instead rawether gets fork()'d/execve()'d by the Tcl
+## script so $(libexec) is appropriate. Strictly speaking the
+## Tcl scripts and data files are architecture-independent so should
+## probably be installed in an analogous directory below $(datadir),
+## but that would add more directories for little real gain. The scripts
+## are treated as data files since they should not be executed directly,
+## i.e. they should not be installed with the execute bit set.
+
+etherdir 		= $(libexecdir)/ecos/@PACKAGE_INSTALL@
+ether_PROGRAMS		= rawether
+ether_DATA		= ethernet.tcl ethernet.tdf netrecord.xbm
+
+rawether_SOURCES	= rawether.c
+
+## Manual dependencies
+rawether.$(OBJEXT)	: Makefile ../src/protocol.h
+
+## The rawether program needs to run with root privileges, or it will
+## be unable to access the ethernet hardware.
+install-data-hook:
+	chown root $(etherdir)/rawether
+	chmod u+s $(etherdir)/rawether
+
+endif
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/Makefile.in
@@ -0,0 +1,450 @@
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+######COPYRIGHTBEGIN####
+#                                                                          
+# ----------------------------------------------------------------------------
+# Copyright (C) 2002 Bart Veer
+#
+# This file is part of the eCos synthetic target ethernet support.
+#
+# This program is free software; you can redistribute it and/or modify it 
+# under the terms of the GNU General Public License as published by the Free 
+# Software Foundation; either version 2 of the License, or (at your option) 
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful, but WITHOUT 
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+# more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# ----------------------------------------------------------------------------
+#                                                                          
+######COPYRIGHTEND####
+#######DESCRIPTIONBEGIN####
+######DESCRIPTIONEND####
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+CC = @CC@
+CXX = @CXX@
+ECOS_REPOSITORY = @ECOS_REPOSITORY@
+EXEEXT = @EXEEXT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MSVC_SRCDIR = @MSVC_SRCDIR@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_DIR = @PACKAGE_DIR@
+PACKAGE_INSTALL = @PACKAGE_INSTALL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+VERSION = @VERSION@
+ecos_CFLAGS = @ecos_CFLAGS@
+ecos_CXXFLAGS = @ecos_CXXFLAGS@
+ecos_INCLUDES = @ecos_INCLUDES@
+ecos_LDADD = @ecos_LDADD@
+ecos_LIBS = @ecos_LIBS@
+ecos_infra_incdir = @ecos_infra_incdir@
+ecos_infra_libdir = @ecos_infra_libdir@
+ecos_libcdl_incdir = @ecos_libcdl_incdir@
+ecos_libcdl_libdir = @ecos_libcdl_libdir@
+ecos_tk_libs = @ecos_tk_libs@
+
+AUTOMAKE_OPTIONS = 1.3 foreign
+
+@SUPPORTED_TRUE@AM_CFLAGS = @SUPPORTED_TRUE@@ecos_CFLAGS@ -DECOSYNTH_VERSION=\"@VERSION@\" \
+@SUPPORTED_TRUE@ -DECOS_REPOSITORY=\"@ECOS_REPOSITORY@\" \
+@SUPPORTED_TRUE@ -DLIBEXECDIR=\"$(libexecdir)\" \
+@SUPPORTED_TRUE@ -DPACKAGE_DIR=\"@PACKAGE_DIR@\" \
+@SUPPORTED_TRUE@ -DPACKAGE_VERSION=\"@PACKAGE_VERSION@\" \
+@SUPPORTED_TRUE@ -DPACKAGE_INSTALL=\"@PACKAGE_INSTALL@\"
+@SUPPORTED_TRUE@AM_CXXFLAGS = @SUPPORTED_TRUE@@ecos_CXXFLAGS@
+@SUPPORTED_TRUE@INCLUDES = @SUPPORTED_TRUE@@ecos_INCLUDES@
+@SUPPORTED_TRUE@LIBS = @SUPPORTED_TRUE@@ecos_LIBS@ @ecos_LDADD@
+
+@SUPPORTED_TRUE@etherdir = @SUPPORTED_TRUE@$(libexecdir)/ecos/@PACKAGE_INSTALL@
+@SUPPORTED_TRUE@ether_PROGRAMS = @SUPPORTED_TRUE@rawether
+@SUPPORTED_TRUE@ether_DATA = @SUPPORTED_TRUE@ethernet.tcl ethernet.tdf netrecord.xbm
+
+@SUPPORTED_TRUE@rawether_SOURCES = @SUPPORTED_TRUE@rawether.c
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../../../../acsupport/mkinstalldirs
+CONFIG_CLEAN_FILES = 
+@SUPPORTED_TRUE@ether_PROGRAMS =  rawether$(EXEEXT)
+PROGRAMS =  $(ether_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) 
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+@SUPPORTED_TRUE@rawether_OBJECTS =  rawether.$(OBJEXT)
+rawether_LDADD = $(LDADD)
+rawether_DEPENDENCIES = 
+rawether_LDFLAGS = 
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DATA =  $(ether_DATA)
+
+DIST_COMMON =  Makefile.am Makefile.in acinclude.m4 aclocal.m4 configure \
+configure.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+DEP_FILES =  .deps/rawether.P
+SOURCES = $(rawether_SOURCES)
+OBJECTS = $(rawether_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .obj .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4
+	cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+mostlyclean-etherPROGRAMS:
+
+clean-etherPROGRAMS:
+	-test -z "$(ether_PROGRAMS)" || rm -f $(ether_PROGRAMS)
+
+distclean-etherPROGRAMS:
+
+maintainer-clean-etherPROGRAMS:
+
+install-etherPROGRAMS: $(ether_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(etherdir)
+	@list='$(ether_PROGRAMS)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(etherdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+	     $(INSTALL_PROGRAM) $$p $(DESTDIR)$(etherdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	  else :; fi; \
+	done
+
+uninstall-etherPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	list='$(ether_PROGRAMS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(etherdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	done
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+	$(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+	-rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+rawether$(EXEEXT): $(rawether_OBJECTS) $(rawether_DEPENDENCIES)
+	@rm -f rawether$(EXEEXT)
+	$(LINK) $(rawether_LDFLAGS) $(rawether_OBJECTS) $(rawether_LDADD) $(LIBS)
+
+install-etherDATA: $(ether_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(etherdir)
+	@list='$(ether_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(etherdir)/$$p"; \
+	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(etherdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etherdir)/$$p"; \
+	    $(INSTALL_DATA) $$p $(DESTDIR)$(etherdir)/$$p; \
+	  fi; fi; \
+	done
+
+uninstall-etherDATA:
+	@$(NORMAL_UNINSTALL)
+	list='$(ether_DATA)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(etherdir)/$$p; \
+	done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	-rm -rf $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+	mkdir $(distdir)/=build
+	mkdir $(distdir)/=inst
+	dc_install_base=`cd $(distdir)/=inst && pwd`; \
+	cd $(distdir)/=build \
+	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist
+	-rm -rf $(distdir)
+	@banner="$(distdir).tar.gz is ready for distribution"; \
+	dashes=`echo "$$banner" | sed s/./=/g`; \
+	echo "$$dashes"; \
+	echo "$$banner"; \
+	echo "$$dashes"
+dist: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+dist-all: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+distdir: $(DISTFILES)
+	-rm -rf $(distdir)
+	mkdir $(distdir)
+	-chmod 777 $(distdir)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-etherPROGRAMS install-etherDATA
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-etherPROGRAMS uninstall-etherDATA
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(etherdir) $(DESTDIR)$(etherdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-etherPROGRAMS mostlyclean-compile \
+		mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am:  clean-etherPROGRAMS clean-compile clean-tags clean-depend \
+		clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am:  distclean-etherPROGRAMS distclean-compile distclean-tags \
+		distclean-depend distclean-generic clean-am
+
+distclean: distclean-am
+	-rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-etherPROGRAMS \
+		maintainer-clean-compile maintainer-clean-tags \
+		maintainer-clean-depend maintainer-clean-generic \
+		distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+	-rm -f config.status
+
+.PHONY: mostlyclean-etherPROGRAMS distclean-etherPROGRAMS \
+clean-etherPROGRAMS maintainer-clean-etherPROGRAMS \
+uninstall-etherPROGRAMS install-etherPROGRAMS mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+uninstall-etherDATA install-etherDATA tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+@SUPPORTED_TRUE@rawether.$(OBJEXT)	: Makefile ../src/protocol.h
+
+@SUPPORTED_TRUE@install-data-hook:
+@SUPPORTED_TRUE@	chown root $(etherdir)/rawether
+@SUPPORTED_TRUE@	chmod u+s $(etherdir)/rawether
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/acinclude.m4
@@ -0,0 +1,45 @@
+dnl Process this file with aclocal to get an aclocal.m4 file. Then
+dnl process that with autoconf.
+dnl ====================================================================
+dnl
+dnl     acinclude.m4
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos host tools.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/08/07
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+dnl Access shared macros.
+dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
+dnl incorporate the macro into aclocal.m4
+sinclude(../../../../../../../acsupport/acinclude.m4)
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/aclocal.m4
@@ -0,0 +1,183 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+dnl Process this file with aclocal to get an aclocal.m4 file. Then
+dnl process that with autoconf.
+dnl ====================================================================
+dnl
+dnl     acinclude.m4
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos host tools.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/08/07
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+dnl Access shared macros.
+dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
+dnl incorporate the macro into aclocal.m4
+sinclude(../../../../../../../acsupport/acinclude.m4)
+
+# Define a conditional.
+
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "[$]2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/configure
@@ -0,0 +1,2013 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer"
+ac_help="$ac_help
+ --enable-debug           do a debug rather than a release build"
+ac_help="$ac_help
+ --enable-ansi            do an ANSI rather than a unicode build"
+ac_help="$ac_help
+ --with-tcl-version=<vsn> version of Tcl to be used"
+ac_help="$ac_help
+ --with-tcl-header=<path> location of Tcl header"
+ac_help="$ac_help
+ --with-tcl-lib=<path>    location of Tcl libraries"
+ac_help="$ac_help
+ --with-tcl=<path>        location of Tcl header and libraries"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=rawether.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ac_aux_dir=
+for ac_dir in ../../../../../../../acsupport $srcdir/../../../../../../../acsupport; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in ../../../../../../../acsupport $srcdir/../../../../../../../acsupport" 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+
+    echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6
+echo "configure:563: checking that a separate build tree is being used" >&5
+    ecos_cwd=`/bin/pwd`
+    if test "${srcdir}" = "." ; then
+        srcdir=${ecos_cwd}
+    fi
+    if test "${ecos_cwd}" = "${srcdir}" ; then
+        echo "$ac_t""no" 1>&6
+        { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; }
+    else
+        echo "$ac_t""yes" 1>&6
+    fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:582: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:614: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:667: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:724: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=eCos_synthetic_target_ethernet
+
+VERSION=0.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:763: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal
+   echo "$ac_t""found" 1>&6
+else
+   ACLOCAL="$missing_dir/missing aclocal"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:776: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:789: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:802: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:815: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:829: checking whether to enable maintainer-specific portions of Makefiles" >&5
+    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval="$enable_maintainer_mode"
+  USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+  
+
+if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+  MAINT=$MAINTAINER_MODE_TRUE
+  
+
+
+case "${host}" in
+    i[34567]86-*-linux-gnu* ) SUPPORTED="yes";;
+    * ) SUPPORTED="no"
+esac
+
+
+if test "${SUPPORTED}" = "yes"; then
+  SUPPORTED_TRUE=
+  SUPPORTED_FALSE='#'
+else
+  SUPPORTED_TRUE='#'
+  SUPPORTED_FALSE=
+fi
+
+if test "${SUPPORTED}" = "yes" ; then
+    # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:870: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:900: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:951: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:983: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 994 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1025: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1030: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1058: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+
+    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1094: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1126: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1137 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cxx_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cxx_cross=no
+  else
+    ac_cv_prog_cxx_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1168: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:1173: checking whether we are using GNU C++" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.C <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gxx=yes
+else
+  ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+if test $ac_cv_prog_gxx = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+
+ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=
+echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:1201: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+  ac_cv_prog_cxx_g=yes
+else
+  ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS="$ac_save_CXXFLAGS"
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+
+for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat > conftest.$ac_ext <<EOF
+#line 1242 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int main() {
+exit (42);
+; return 0; }
+EOF
+if { (eval echo configure:1250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  continue
+fi
+rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#line 1260 "configure"
+#include "confdefs.h"
+$ac_declaration
+int main() {
+exit (42);
+; return 0; }
+EOF
+if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+
+    echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1284: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  for ac_file in conftest.*; do
+    case $ac_file in
+    *.c) ;;
+    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+    esac
+  done
+else
+  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+    echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1308: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1313 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_cygwin=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1341: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1346 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_mingw32=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1372: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
+else
+  rm -f conftest*
+  echo 'int main () { return 0; }' > conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:1382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for file in conftest.*; do
+      case $file in
+      *.c | *.o | *.obj) ;;
+      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+    
+    ecos_CFLAGS=""
+    ecos_CXXFLAGS=""
+    ecos_LDADD=""
+    ecos_INCLUDES=""
+    ecos_LIBS=""
+    
+    
+    
+    
+    
+
+
+    
+    
+    
+
+    echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6
+echo "configure:1420: checking "for Visual C++"" >&5
+    MSVC="no";
+    if test "${CC}" = "cl" ; then
+       MSVC="yes"
+       CXX="cl"
+       
+    
+    
+    if test "${MSVC}" = "yes" ; then
+      MSVC_SRCDIR=`cygpath -w ${MSVC_SRCDIR} | tr \\\\\\\\ /`
+    fi
+
+       
+       ecos_INCLUDES="${ecos_INCLUDES} \"-I${msvc_srcdir}\""
+       ecos_LDADD="-link"
+       ecos_LIBS="advapi32.lib"
+    fi
+    
+
+if test "${MSVC}" = "yes"; then
+  MSVC_TRUE=
+  MSVC_FALSE='#'
+else
+  MSVC_TRUE='#'
+  MSVC_FALSE=
+fi
+    if test "${MSVC}" = "yes" ; then
+        echo "$ac_t""unfortunately yes" 1>&6
+    else
+        echo "$ac_t""no" 1>&6
+    fi
+
+    
+    
+    
+    
+    
+
+    echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6
+echo "configure:1459: checking "the default compiler flags"" >&5
+
+            ecosflags_enable_debug="no"
+    # Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+  case "${enableval}" in
+       yes) ecosflags_enable_debug="yes" ;;
+       *)   ecosflags_enable_debug="no" ;;
+    esac
+fi
+
+
+                    ecosflags_enable_ansi="no"
+    if test "${MSVC}" = "yes" ; then
+      # Check whether --enable-ansi or --disable-ansi was given.
+if test "${enable_ansi+set}" = set; then
+  enableval="$enable_ansi"
+  case "${enableval}" in
+         yes) ecosflags_enable_ansi="yes" ;;
+         *)   ecosflags_enable_ansi="no" ;;
+      esac
+fi
+
+    fi
+
+        if test "${GCC}" = "yes" ; then
+        ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
+        ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual"
+    elif test "${MSVC}" = "yes" ; then
+        ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3"
+        ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX"
+    else
+        { echo "configure: error: "default flags for ${CC} are not known"" 1>&2; exit 1; }
+    fi
+
+        if test "${ecosflags_enable_debug}" = "yes" ; then
+        if test "${GCC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -g -O0"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0"
+        elif test "${MSVC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi"
+        fi
+    else
+                                        if test "${GCC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -O0"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0"
+        elif test "${MSVC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -MD -O2"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2"
+        fi
+    fi
+
+    CFLAGS="${ac_save_CFLAGS}"
+    CXXFLAGS="${ac_save_CXXFLAGS}"
+
+    echo "$ac_t""done" 1>&6
+
+
+    
+
+    
+    
+
+    ecos_tcl_version=""
+    ecos_tcl_incdir=""
+    ecos_tcl_libdir=""
+    ecos_tk_libs=""
+
+                
+    echo $ac_n "checking for Tcl version""... $ac_c" 1>&6
+echo "configure:1531: checking for Tcl version" >&5
+    # Check whether --with-tcl-version or --without-tcl-version was given.
+if test "${with_tcl_version+set}" = set; then
+  withval="$with_tcl_version"
+  
+        ecos_tcl_version=${with_tcl_version}
+    
+else
+  
+        if test "${MSVC}" = "yes" ; then
+           ecos_tcl_version=80
+        elif test "${ac_cv_cygwin}" = "yes" ; then
+           ecos_tcl_version=80
+        else
+           ecos_tcl_version=""
+        fi
+    
+fi
+
+    echo "$ac_t""${ecos_tcl_version}" 1>&6
+
+        echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6
+echo "configure:1553: checking for Tcl installation" >&5
+
+    # Check whether --with-tcl-header or --without-tcl-header was given.
+if test "${with_tcl_header+set}" = set; then
+  withval="$with_tcl_header"
+  :
+fi
+
+    # Check whether --with-tcl-lib or --without-tcl-lib was given.
+if test "${with_tcl_lib+set}" = set; then
+  withval="$with_tcl_lib"
+  :
+fi
+
+    # Check whether --with-tcl or --without-tcl was given.
+if test "${with_tcl+set}" = set; then
+  withval="$with_tcl"
+  :
+fi
+
+
+                                
+    if test "${MSVC}" = "yes" ; then
+
+        if test "${with_tcl_header+set}" = set ; then
+            ecos_tcl_incdir=${with_tcl_header}
+        elif test "${with_tcl+set}" = set ; then
+            ecos_tcl_incdir="${with_tcl}/include"
+        else
+            { echo "configure: error: You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-header=<path>" 1>&2; exit 1; }
+        fi
+  
+                        if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
+            { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; }
+        fi
+        ecos_msvc_tcl_incdir="${ecos_tcl_incdir}"
+        
+    
+    
+    if test "${MSVC}" = "yes" ; then
+      ecos_msvc_tcl_incdir=`cygpath -w ${ecos_msvc_tcl_incdir} | tr \\\\\\\\ /`
+    fi
+
+        ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_tcl_incdir}\""
+
+        if test "${with_tcl_lib+set}" = set; then
+            ecos_tcl_libdir=${with_tcl_lib}
+        elif test "${with_tcl+set}" = set; then
+            ecos_tcl_libdir="${with_tcl}/lib"
+        else
+            { echo "configure: error: You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-lib=<path>" 1>&2; exit 1; }
+        fi
+        
+    
+    
+    if test "${MSVC}" = "yes" ; then
+      ecos_tcl_libdir=`cygpath -w ${ecos_tcl_libdir} | tr \\\\\\\\ /`
+    fi
+
+        ecos_LIBS="${ecos_LIBS} tcl${ecos_tcl_version}.lib"
+        ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\""
+
+                        ecos_tk_libs=""
+
+    else
+                        possibles="${with_tcl_header} ${with_tcl}/include ${prefix}/include /usr/include/tcl${ecos_tcl_version} /usr/include"
+        
+    ecos_tcl_incdir=""
+    for i in ${possibles}; do
+        if test -r "$i/"tcl.h""; then
+            ecos_tcl_incdir=$i
+            break
+        fi
+    done
+
+        if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
+            { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; }
+        else
+                                                                                                            if test "${ecos_tcl_incdir}" != "/usr/include" ; then
+                ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_tcl_incdir}"
+            fi
+        fi
+        possibles="${with_tcl_lib} ${with_tcl}/lib ${libdir} ${prefix}/lib /usr/lib/tcl$${ecos_tcl_version} /usr/lib"
+        
+    ecos_tcl_libdir=""
+    for i in ${possibles}; do
+        if test -r "$i/"tclConfig.sh""; then
+            ecos_tcl_libdir=$i
+            break
+        fi
+    done
+
+        if test \! -r "${ecos_tcl_libdir}/tclConfig.sh" ; then
+            { echo "configure: error: unable to locate Tcl config file tclConfig.sh" 1>&2; exit 1; }
+        else
+            . ${ecos_tcl_libdir}/tclConfig.sh
+            ecos_LIBS="${ecos_LIBS} -ltcl${ecos_tcl_version} ${TCL_LIBS}"
+        fi
+
+        possible_tk_libdir=`echo ${ecos_tcl_libdir} | sed -e 's,tcl,tk,'`
+        possibles="${ecos_tcl_libdir} ${possible_tk_libdir}"
+        
+    ecos_tk_libdir=""
+    for i in ${possibles}; do
+        if test -r "$i/"tkConfig.sh""; then
+            ecos_tk_libdir=$i
+            break
+        fi
+    done
+
+        if test \! -r "${ecos_tk_libdir}/tkConfig.sh" ; then
+            { echo "configure: error: unable to locate Tk config file tkConfig.sh" 1>&2; exit 1; }
+        else
+            . ${ecos_tk_libdir}/tkConfig.sh
+            ecos_tk_libs="-ltk${ecos_tcl_version} ${TK_LIBS}"
+                                    for lib in ${TCL_LIBS} ; do
+                ecos_tk_libs=`echo ${ecos_tk_libs} | sed -e "s!${lib}!!"`
+            done
+        fi
+    fi
+
+    echo "$ac_t""-I${ecos_tcl_incdir} -L${ecos_tcl_libdir}" 1>&6
+
+    
+
+                    if test "${TK_MAJOR_VERSION}" = "8" ; then
+        if test ${TK_MINOR_VERSION} -lt 3 ; then
+            { echo "configure: error: The synthetic target ethernet support requires at least version 8.3 of Tcl/Tk" 1>&2; exit 1; }
+        fi
+    fi
+    
+
+        package_dir=`cd ${srcdir} && /bin/pwd`
+    PACKAGE_VERSION=`dirname ${package_dir}`
+    PACKAGE_VERSION=`basename ${PACKAGE_VERSION}`
+
+                    package_dir=`dirname ${package_dir}`
+    package_dir=`dirname ${package_dir}`
+
+    possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.."
+    possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." 
+    
+    repository_root=""
+    for i in ${possibles}; do
+        if test -d "$i/"acsupport""; then
+            repository_root=$i
+            break
+        fi
+    done
+
+    if test "${repository_root}" = "" ; then
+        { echo "configure: error: Failed to identify this package's position within the eCos repository" 1>&2; exit 1; }
+    fi
+        ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd`
+
+        PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"`
+
+                        PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}"
+    
+    
+    
+    
+    
+
+fi
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile:Makefile.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
+s%@SUPPORTED_TRUE@%$SUPPORTED_TRUE%g
+s%@SUPPORTED_FALSE@%$SUPPORTED_FALSE%g
+s%@CC@%$CC%g
+s%@CXX@%$CXX%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@ecos_CFLAGS@%$ecos_CFLAGS%g
+s%@ecos_CXXFLAGS@%$ecos_CXXFLAGS%g
+s%@ecos_LDADD@%$ecos_LDADD%g
+s%@ecos_INCLUDES@%$ecos_INCLUDES%g
+s%@ecos_LIBS@%$ecos_LIBS%g
+s%@MSVC_SRCDIR@%$MSVC_SRCDIR%g
+s%@MSVC_TRUE@%$MSVC_TRUE%g
+s%@MSVC_FALSE@%$MSVC_FALSE%g
+s%@ecos_tk_libs@%$ecos_tk_libs%g
+s%@ECOS_REPOSITORY@%$ECOS_REPOSITORY%g
+s%@PACKAGE_DIR@%$PACKAGE_DIR%g
+s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g
+s%@PACKAGE_INSTALL@%$PACKAGE_INSTALL%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile:Makefile.in"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/configure.in
@@ -0,0 +1,92 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl ====================================================================
+dnl
+dnl     configure.in
+dnl
+dnl     configure script for eCos synthetic target ethernet
+dnl	host-side support
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos synthetic target support.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/08/07
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+
+AC_INIT(rawether.c)
+
+dnl Pick up the support files from the top-level acsupport directory.
+AC_CONFIG_AUX_DIR(../../../../../../../acsupport)
+
+ECOS_CHECK_BUILD_ne_SRC
+AC_CANONICAL_HOST
+AM_INIT_AUTOMAKE(eCos_synthetic_target_ethernet,0.1,0)
+AM_MAINTAINER_MODE
+
+dnl The current version of the synthetic target is implemented only for
+dnl x86 Linux platforms, so a test is appropriate here. However
+dnl it is not a good idea for the configure script to report an error:
+dnl that would prevent any top-level configury working for other
+dnl platforms. Instead an automake conditional is used to suppress adding
+dnl targets to the build.
+case "${host}" in
+    i[[34567]]86-*-linux-gnu* ) SUPPORTED="yes";;
+    * ) SUPPORTED="no"
+esac
+AM_CONDITIONAL(SUPPORTED, test "${SUPPORTED}" = "yes")
+
+if test "${SUPPORTED}" = "yes" ; then
+    AC_PROG_CC
+    AC_PROG_CXX
+    AC_OBJEXT
+    AC_EXEEXT
+    ECOS_PROG_MSVC
+    ECOS_PROG_STANDARD_COMPILER_FLAGS
+
+    ECOS_PATH_TCL
+    dnl Check that the version of tk is sufficiently recent.
+    dnl For example the text widget's tag -elide facility was
+    dnl added between 8.2 and 8.3. Initial development of
+    dnl the synthetic target used 8.3.1
+    if test "${TK_MAJOR_VERSION}" = "8" ; then
+        if test ${TK_MINOR_VERSION} -lt 3 ; then
+            AC_MSG_ERROR([The synthetic target ethernet support requires at least version 8.3 of Tcl/Tk])
+        fi
+    fi
+    ECOS_PACKAGE_DIRS
+fi
+
+dnl There is no real need for a config.h file at this time, since the code
+dnl is specific to x86 Linux. This may change in future.
+dnl AM_CONFIG_HEADER(config.h:config.h.in)
+
+AC_OUTPUT(Makefile:Makefile.in)
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/ethernet.tcl
@@ -0,0 +1,1226 @@
+# {{{  Banner                                                   
+
+# ============================================================================
+# 
+#      ethernet.tcl
+# 
+#      Ethernet support for the eCos synthetic target I/O auxiliary
+# 
+# ============================================================================
+# ####COPYRIGHTBEGIN####
+#                                                                           
+#  ----------------------------------------------------------------------------
+#  Copyright (C) 2002 Bart Veer
+# 
+#  This file is part of the eCos host tools.
+# 
+#  This program is free software; you can redistribute it and/or modify it 
+#  under the terms of the GNU General Public License as published by the Free 
+#  Software Foundation; either version 2 of the License, or (at your option) 
+#  any later version.
+#  
+#  This program is distributed in the hope that it will be useful, but WITHOUT 
+#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+#  more details.
+#  
+#  You should have received a copy of the GNU General Public License along with
+#  this program; if not, write to the Free Software Foundation, Inc., 
+#  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#  ----------------------------------------------------------------------------
+#                                                                           
+# ####COPYRIGHTEND####
+# ============================================================================
+# #####DESCRIPTIONBEGIN####
+# 
+#  Author(s):   bartv
+#  Contact(s):  bartv
+#  Date:        2002/08/07
+#  Version:     0.01
+#  Description:
+#      Implementation of the ethernet device. This script should only ever
+#      be run from inside the ecosynth auxiliary.
+# 
+# ####DESCRIPTIONEND####
+# ============================================================================
+
+# }}}
+
+# Overview.
+#
+# Linux provides a number of different ways of performing low-level
+# ethernet I/O from user space, including accessing an otherwise
+# unused ethernet card via a PF_PACKET socket, and the tap facility.
+# The necessary functionality is not readily accessible from Tcl,
+# and performing this low-level I/O generally requires special
+# privileges. Therefore the actual I/O happens in a C program
+# rawether, installed suid root,
+#
+# The synthetic ethernet package supports up to four ethernet devices,
+# eth0 to eth3. The target definition file maps these onto the
+# underlying I/O facility. Instantiation requires spawning a rawether
+# process with appropriate arguments, and then waiting for a message
+# from that process indicating whether or not the instantiation
+# succeeded. That message includes the MAC address. A file event
+# handler is installed to handle data detected by raw ether.
+#
+# eCos can send a number of requests: transmit a packet, start the
+# interface (possibly in promiscuous mode), stop the interface,
+# or get the various parameters such as the MAC address. All those
+# requests can just be passed on to the rawether process. Incoming
+# ethernet packets are slightly more complicated: rawether will
+# immediately pass these up to this Tcl script, which will buffer
+# the packets until they are requested by eCos; in addition an
+# interrupt will be raised.
+
+namespace eval ethernet {
+    # The protocol between eCos and this script.
+    variable SYNTH_ETH_TX           0x01
+    variable SYNTH_ETH_RX           0x02
+    variable SYNTH_ETH_START        0x03
+    variable SYNTH_ETH_STOP         0x04
+    variable SYNTH_ETH_GETPARAMS    0x05
+    variable SYNTH_ETH_MULTIALL     0x06
+    
+    # This array holds all the interesting data for all the
+    # interfaces, indexed by the instance id. It is also useful
+    # to keep track of the instance id's associated with ethernet
+    # devices.
+    array set data [list]
+    set ids [list]
+
+    # One-off initialization, for example loading images. If this fails
+    # then all attempts at instantiation will fail as well.
+    variable init_ok 1
+    variable install_dir $synth::device_install_dir
+    variable rawether_executable [file join $ethernet::install_dir "rawether"]
+
+    if { ![file exists $rawether_executable] } {
+	synth::report_error "Ethernet device, rawether executable has not been installed in $ethernet::install_dir.\n"
+	set init_ok 0
+    } elseif { ![file executable $rawether_executable] } {
+	synth::report_error "Ethernet device, installed program $rawether_executable is not executable.\n"
+	set init_ok 0
+    }
+
+    if { $synth::flag_gui } {
+	foreach _image [list "netrecord.xbm"] {
+	    variable image_[file rootname $_image]
+	    if { ! [synth::load_image "ethernet::image_[file rootname $_image]" [file join $ethernet::install_dir $_image]] } {
+		set init_ok 0
+	    }
+	}
+	unset _image
+    }
+    
+    # Maximum number of packets that should be buffered per interface.
+    # This can be changed in the target definition
+    variable max_buffered_packets   16
+
+    if { [synth::tdf_has_option "ethernet" "max_buffer"] } {
+	set ethernet::max_buffered_packets [synth::tdf_get_option "ethernet" "max_buffer"]
+	if { ![string is integer -strict $ethernet::max_buffered_packets] } {
+	    synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n   \
+		                 Entry max_buffer should be a simple integer, not $ethernet::max_buffered_packets\n"
+	    set init_ok 0
+	}
+    }
+
+    # Define hooks for tx and rx packets
+    synth::hook_define "ethernet_tx"
+    synth::hook_define "ethernet_rx"
+
+    # Get a list of known ethernet devices
+    proc devices_get_list { } {
+	set result [list]
+	foreach id $ids {
+	    lappend result $::ethernet::data($id,name)
+	}
+	return $result
+    }
+    
+    # ----------------------------------------------------------------------------
+    proc instantiate { id name data } {
+	if { ! $ethernet::init_ok } {
+	    synth::report_warning "Cannot instantiate ethernet device $name, initialization failed.\n"
+	    return ""
+	}
+	
+	# id is a small number that uniquely identifies this device. It will
+	# be used as an array index.
+	# name is something like eth0 or eth1
+	# There should be no device-specific data
+
+	# The hard work is done by an auxiliary process which needs to be
+	# spawned off. It requires some additional information to map the
+	# eCos device name on to a suitable Linux network device such
+	# as tap0. That information has to come from the config file.
+	if { ![synth::tdf_has_option "ethernet" $name] } {
+	    synth::report_error "Cannot instantiate ethernet device $name\n   \
+		    No entry in target definition file $synth::target_definition\n"
+	    return ""
+	}
+	set use [synth::tdf_get_option "ethernet" $name]
+
+	# Do some validation here, before the rawether process is started.
+	# Typical entries would look like
+	#     eth0 real eth1
+	#     eth1 ethertap [[tap-device] [MAC]]
+	set junk ""
+	set optional ""
+	set mac      ""
+	if { [regexp -- {^\s*real\s*[a-zA-z0-9_]+$} $use] } {
+	    # Real ethernet.
+	} elseif { [regexp -- {^\s*ethertap\s*(.*)$} $use junk optional ] } {
+	    if { "" != $optional } {
+		if { ! [regexp -- {^tap[0-9]+\s*(.*)$} $optional junk mac ] } {
+		    synth::report_error "Cannot instantiate ethernet device $name\n   \
+			    Invalid entry \"$use\" in target definition file $synth::target_definition\n   \
+			    Should be \"ethertap \[<tap-device> \[<MAC address>\]\]\"\n"
+		    return ""
+		}
+		if { "" != $mac } {
+		    if { ! [regexp -- {^\s*([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}\s*} $mac ] } {
+			synth::report_error "Cannot instantiate ethernet device $name\n   \
+				Invalid entry \"$use\" in target definition file $synth::target_definition\n   \
+				MAC address should be of the form xx:xx:xx:xx:xx:xx, all hexadecimal digits.\n"
+			return ""
+		    }
+		}
+	    }
+	} else {
+	    synth::report_error "Cannot instantiate ethernet device $name\n   \
+		    Invalid entry \"$use\" in target definition file $synth::target_definition\n   \
+		    Should be \"real <Linux ethernet device>\" or \"ethertap \[<tap-device> \[<MAC address>\]\]\"\n"
+	    return ""
+	}
+
+	# Now spawn the rawether process. Its stdin and stdout are
+        # pipes connected to ecosynth. Its stderr is redirected to
+	# the current tty to avoid confusion between incoming ethernet
+	# packets and diagnostics.
+	if { [catch { set rawether [open "|$ethernet::rawether_executable $use 2>/dev/tty" w+] } message ] } {
+	    synth::report_error "Failed to spawn rawether process for device $name\n   $message"
+	    return ""
+	}
+
+	# No translation on this pipe please.
+	fconfigure $rawether -translation binary -encoding binary -buffering none 
+
+	# Now wait for the rawether device to initialize. It should send back a single
+	# byte, '0' for failure or '1' for success. Failure is followed by a text
+	# message which should be reported. Success is followed by a six-byte MAC
+	# address.
+	set reply [read $rawether 1]
+	if { "" == $reply } {
+	    synth::report_error "rawether process for device $name exited unexpectedly.\n"
+	    catch { close $rawether }
+	    return ""
+	}
+
+	if { "1" != $reply } {
+	    set message [read $rawether 1024]
+	    synth::report_error "rawether process was unable to initialize eCos device $name ($use)\n    $message"
+	    catch { close $rawether }
+	    return ""
+	}
+
+	set reply [read $rawether 7]
+	if { [string length $reply] != 7 } {
+	    synth::report_error "rawether process for eCos device $name ($use) failed to provide the initialization response.\n"
+	    catch { close $rawether }
+	    return ""
+	}
+	set mac [string range $reply 0 5]
+	set multi [string index $reply 6]
+
+	# Finally allocate an interrupt vector
+	set vector [synth::interrupt_allocate $name]
+	if { -1 == $vector } {
+	    # No more interrupts left. An error will have been reported already.
+	    catch { close $rawether }
+	    return ""
+	}
+	
+	# The device is up and running. Fill in the array entries
+	lappend ethernet::ids                       $id
+	set ethernet::data($id,alive)               1
+	set ethernet::data($id,name)                $name
+	set ethernet::data($id,rawether)            $rawether
+	set ethernet::data($id,packets)             [list]
+	set ethernet::data($id,packet_count)        0
+	set ethernet::data($id,up)                  0
+	set ethernet::data($id,interrupt_vector)    $vector
+	set ethernet::data($id,MAC)                 $mac
+	set ethernet::data($id,multi)               $multi
+
+	# Set up the event handler to handle incoming packets. There should
+	# not be any until the interface is brought up
+	fileevent $rawether readable [list ethernet::handle_packet $name $id $rawether]
+
+	# Finally return the request handler. The eCos device driver will
+	# automatically get back an ack.
+	return ethernet::handle_request
+    }
+
+    # ----------------------------------------------------------------------------
+    # eCos has sent a request to a device instance. Most of these requests should
+    # just be forwarded to rawether. Some care has to be taken to preserve
+    # packet boundaries and avoid confusion. It is also necessary to worry
+    # about the rawether process exiting unexpectedly, which may cause
+    # puts operations to raise an error (subject to buffering).
+    #
+    # Note: it might actually be more efficient to always send a header plus
+    # 1514 bytes of data, reducing the number of system calls at the cost of
+    # some extra data copying, but with at least two process switches per
+    # ethernet transfer efficiency is not going to be particularly good
+    # anyway.
+    
+    proc send_rawether { id packet } {
+	if { $ethernet::data($id,alive) } {
+	    set chan $ethernet::data($id,rawether)
+	    if { [catch { puts -nonewline $chan $packet } ] } {
+		set ethernet::data($id,alive) 0
+		# No further action is needed here, instead the read handler
+		# will detect EOF and report abnormal termination.
+	    }
+	}
+    }
+    
+    proc handle_request { id reqcode arg1 arg2 reqdata reqlen reply_len } {
+
+	if { $reqcode == $ethernet::SYNTH_ETH_TX } {
+	    # Transmit a single packet. To preserve packet boundaries
+	    # this involves a four-byte header containing opcode and
+	    # size, followed by the data itself.
+	    set header [binary format "ccs" $reqcode 0 [string length $reqdata]]
+	    ethernet::send_rawether $id $header
+	    ethernet::send_rawether $id $reqdata
+	    if { $ethernet::logging_enabled } {
+		ethernet::log_packet $ethernet::data($id,name) "tx" $reqdata
+	    }
+	    synth::hook_call "ethernet_tx" $ethernet::data($id,name) $reqdata
+	    
+	} elseif { $reqcode == $ethernet::SYNTH_ETH_RX } {
+	    # Return a single packet to eCos, plus a count of the number
+	    # of remaining packets. All packets are buffered here, not
+	    # in rawether.
+	    if { $ethernet::data($id,packet_count) == 0 } {
+		synth::send_reply 0 0 ""
+	    } else {
+		incr ethernet::data($id,packet_count) -1
+		set packet [lindex $ethernet::data($id,packets) 0]
+		set ethernet::data($id,packets) [lrange $ethernet::data($id,packets) 1 end]
+		synth::send_reply $ethernet::data($id,packet_count) [string length $packet] $packet
+		if { $ethernet::logging_enabled } {
+		    ethernet::log_packet $ethernet::data($id,name) "rx" $packet
+		}
+		synth::hook_call "ethernet_rx" $ethernet::data($id,name) $packet
+	    }
+	} elseif { $reqcode == $ethernet::SYNTH_ETH_START } {
+	    # Start the interface in either normal or promiscuous
+	    # mode, depending on arg1. No reply is expected. Also
+	    # mark the interface as up so that any packets transmitted
+	    # by rawether will not be discarded
+	    set ethernet::data($id,up) 1
+	    set header [binary format "ccs" $reqcode $arg1 0]
+	    ethernet::send_rawether $id $header
+	} elseif { $reqcode == $ethernet::SYNTH_ETH_STOP } {
+	    # Stop the interface. All pending packets should be
+	    # discarded and no new packets should be accepted.
+	    # No reply is expected so just pass this on to rawether
+	    set ethernet::data($id,up) 0
+	    set ethernet::data($id,packets) [list]
+	    set ethernet::data($id,packet_count) 0
+	    set header [binary format "ccs" $reqcode 0 0]
+	    ethernet::send_rawether $id $header
+	} elseif { $reqcode == $ethernet::SYNTH_ETH_GETPARAMS } {
+	    # Retrieve the interrupt number, the MAC address,
+	    # and the multicast flag for this interface. eCos should be
+	    # expecting back 6 bytes of data for the MAC, plus an
+	    # extra byte for the multi flag, and the interrupt
+	    # number as the return code. This is all known locally.
+	    set reply "$ethernet::data($id,MAC)$ethernet::data($id,multi)"
+	    synth::send_reply $ethernet::data($id,interrupt_vector) 7 $reply
+	} elseif { $reqcode == $ethernet::SYNTH_ETH_MULTIALL } {
+	    set header [binary format "ccs" $reqcode $arg1 0]
+	    ethernet::send_rawether $id $header
+	} else {
+	    synth::report_error "Received unexpected request $reqcode for ethernet device"
+	}
+    }
+
+    # ----------------------------------------------------------------------------
+    # Incoming data.
+    #
+    # The rawether process continually reads packets from the low-level device
+    # and tries to forward them on to this script, where they will be received
+    # by an event handler. The packet consists of a four-byte header containing
+    # the size, followed by the ethernet data itself. This ensures that
+    # packet boundaries are preserved. Incoming packets are buffered inside
+    # the auxiliary until eCos sends an RX request, and an interrupt is
+    # generated.
+    #
+    # If eCos stops accepting data or if it cannot process the ethernet packets
+    # quickly enough then the auxiliary could end up buffering an unbounded
+    # amount of data. That is a bad idea, so there is an upper bound on the
+    # number of buffered packets. Any excess packets get dropped.
+    #
+    # Error conditions or EOF indicate that rawether has terminated. This
+    # should not happen during normal operation. rawether should only exit
+    # because of an ecos_exit hook when the channel gets closed, and the
+    # event handler gets removed first.
+    #
+    # Incoming packets are logged when they are received by eCos, not when
+    # they are received from the rawether device. That gives a somewhat more
+    # accurate view of what is happening inside eCos - a packet stuck in
+    # a fifo has little impact.
+    proc _handle_packet_error { msg id } {
+	append msg "    No further I/O will happen on this interface.\n"
+	synth::report_warning $msg
+	set ethernet::data($id,alive) 0
+	fileevent $ethernet::data($id,rawether) readable ""
+	catch { close $ethernet::data($id,rawether) }
+    }
+    
+    proc handle_packet { name id chan } {
+	set header [read $chan 4]
+	if { 4 != [string length $header] } {
+	    ethernet::_handle_packet_error "rawether process for $name has terminated unexpectedly.\n" $id
+	    return
+	}
+
+	binary scan $header "ccs" code arg1 len
+	if { $ethernet::SYNTH_ETH_RX  != $code } {
+	    set msg    "protocol mismatch from rawether process for $name\n"
+	    append msg "    Function code $code not recognised.\n"
+	    ethernet::_handle_packet_error $msg $id
+	    return
+	}
+	if { ($len < 14) || ($len > 1514) } {
+	    set msg    "protocol mismatch from rawether process for $name\n"
+	    append msg "    Invalid transfer length $len\n"
+	    ethernet::_handle_packet_error $msg $id
+	    return
+	}
+
+	set data [read $chan $len]
+	if { $len != [string length $data] } {
+	    set msg    "protocol mismatch from rawether process for $name\n"
+	    append msg "    Expected $len byte ethernet packet, received [string length $data] bytes\n"
+	    ethernet::_handle_packet_error $msg $id
+	    return
+	}
+
+	# The data has been received correctly. Should it be buffered?
+	if { !$ethernet::data($id,up) } {
+	    return
+	}
+	if { $ethernet::data($id,packet_count) >= $ethernet::max_buffered_packets } {
+	    return
+	}
+
+	# Store the packet, and inform eCos there is work to be done
+	lappend ethernet::data($id,packets) $data
+	incr ethernet::data($id,packet_count)
+	synth::interrupt_raise $ethernet::data($id,interrupt_vector)
+	
+    }
+    
+    # ----------------------------------------------------------------------------
+    # When eCos has exited, the rawether processes can and should be
+    # shut down immediately.
+    proc ecos_exited { arg_list } {
+	foreach id $ethernet::ids {
+	    if { $ethernet::data($id,alive) } {
+		set ethernet::data($id,alive) 0
+		fileevent $ethernet::data($id,rawether) readable ""
+		catch { close $ethernet::data($id,rawether) }
+	    }
+	}
+    }
+    synth::hook_add "ecos_exit" ethernet::ecos_exited
+
+    # ----------------------------------------------------------------------------
+    # Read in various data files for use by the filters
+    #
+    # Other possible sources of information include arp, ypcat, and
+    # dns. Those are avoided for now because they involve running
+    # additional processes that might hang for a while. Also arp
+    # would only give useful information for very recently accessed
+    # machines, NIS might not be running, and dns could involve an
+    # expensive lookup while the system is running .
+    
+    array set services [list]
+    array set hosts [list]
+    array set protocols [list]
+    
+    proc read_services { } {
+	catch {
+	    set fd [open "/etc/services" "r"]
+	    while { -1 != [gets $fd line] } {
+		set junk     ""
+		set name     ""
+		set number   ""
+		set protocol ""
+		if { [regexp -- {^([-a-zA-Z0-9_]+)\s*([0-9]+)/((?:tcp)|(?:udp)).*$} $line junk name number protocol] } {
+		    set ethernet::services($number,$protocol) $name
+		}
+	    }
+	    close $fd
+	}
+    }
+
+    proc read_protocols { } {
+	catch {
+	    set fd [open "/etc/protocols" "r"]
+	    while { -1 != [gets $fd line] } {
+		set junk   ""
+		set name   ""
+		set number ""
+		if { [regexp -- {^([-a-zA-Z0-9_]+)\s*([0-9]+)\s.*} $line junk name number] } {
+		    set ethernet::protocols($number) $name
+		}
+	    }
+	    close $fd
+	}
+    }
+    
+    proc read_hosts { } {
+	catch {
+	    set fd [open "/etc/hosts" "r"]
+	    while { -1 != [gets $fd line] } {
+		set junk   ""
+		set name   ""
+		set number ""
+
+		# Deliberately ignore parts of the name after the first .
+		if { [regexp -- {^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})\s*([a-zA-Z0-9]+)(\.|\s|$)} $line junk number name] } {
+		    # The number should be naturalized if it is going to match reliably
+		    scan $line "%d.%d.%d.%d" a b c d
+		    set index [expr (($a & 0x0FF) << 24) | (($b & 0x0FF) << 16) | (($c & 0x0FF) << 8) | ($d & 0x0FF)]
+		    set ethernet::hosts($index) $name
+		}
+	    }
+	    close $fd
+	}
+    }
+    
+    # ----------------------------------------------------------------------------
+    # Filtering support. This is only really used when running in GUI mode.
+    # However all the relevant options are still extracted and validated,
+    # to avoid warnings about unrecognised options.
+    
+    variable logging_enabled 0
+    variable max_show        64
+
+    # Construct a string for the data, either all of it or up to max_show bytes.
+    # This is just hex in chunks of four bytes.
+    proc format_hex_data { data } {
+	set result ""
+
+	set len [string length $data]
+	if { $len > $ethernet::max_show } {
+	    set len $ethernet::max_show
+	}
+	binary scan $data "H[expr 2 * $len]" hex
+	for { set i 0 } { $i < $len } { incr i 4 } {
+	    append result "[string range $hex [expr $i * 2] [expr ($i * 2) + 7]] "
+	}
+	set result [string trimright $result]
+	return $result
+    }
+
+    # Given an IPv4 network address, turn it into a.b.c.d and the
+    # host name as well (if known). The argument should be a 32-bit
+    # integer.
+    proc inet_ipv4_ntoa { number } {
+	set result [format "%d.%d.%d.%d" [expr ($number >> 24) & 0x0FF] [expr ($number >> 16) & 0x0FF] \
+		[expr ($number >> 8) & 0x0FF] [expr $number & 0x0FF]]
+	if { [info exists ethernet::hosts($number) ] } {
+	    append result "($ethernet::hosts($number))"
+	}
+	return $result
+    }
+
+    # Given an ipv4 address encapsulated in an IPv6 address, do the necessary
+    # conversion. We have something like 123:4567, we want a.b.c.d plus
+    # a host address.
+    proc inet_ipv4_in_ipv6_ntoa { top bottom } {
+	if { "" == $top } {
+	    set top 0
+	}
+	if { "" == $bottom } {
+	    set bottom 0
+	}
+	set top "0x$top"
+	set bottom "0x$bottom"
+
+	set ipv4 [expr ($top << 16) | $bottom]
+	return inet_ipv4_ntoa $ipv4
+    }
+    
+    # Ditto for IPv6. The argument should be a 32-digit hexadecimal string.
+    # For now there is no simple way of mapping these onto host names,
+    # unless the address is an IPv4-mapped or compatible one, or one of
+    # special cases such as loopback.
+    proc inet_ipv6_ntoa { number } {
+	# We have something like 12345678abcdef. Start by inserting the appropriate
+	# colons.
+	set result [format "%s:%s:%s:%s:%s:%s:%s:%s" [string range $number 0 3] [string range $number 4 7] \
+		[string range $number 8 11] [string range $number 12 15] [string range $number 16 19] \
+		[string range $number 20 23] [string range $number 24 27] [string range $number 28 31]]
+	# Now eliminate unwanted 0's at the start of each range.
+	regsub {^0+} $result {} result
+	regsub -all {:0+} $result {:} result
+
+	# If we have ended up with sequences of colons, abbreviate
+        # them into pairs.
+	regsub -all {::+} $result {::} result
+
+	# There are a couple of special addresses
+	if { "::1" == $result } {
+	    return "::1(loopback)"
+	} elseif { "::" == $result } {
+	    return "::(IN6ADDR_ANY)"
+	}
+
+	# Look for IPv4-mapped addresses.
+	set junk ""
+	set ipv4_1 ""
+	set ipv4_2 ""
+	if { [regexp -nocase -- {::ffff:([0-9a-f]{0,3}):([0-9a-f]{0,3})$} $result junk ipv4_1 ipv4_2] } {
+	    set result [inet_ipv4_in_ipv6_nto $ipv4_1 $ipv4_2]
+	    return "::FFFF:$result"
+	} elseif { [regexp -nocase -- {::([0-9a-f]{0,3}):([0-9a-f]{0,3})$} $result junk ipv4_1 ipv4_2] } {
+	    set result [inet_ipv4_in_ipv6_nto $ipv4_1 $ipv4_2]
+	    return "::$result"
+	} else {
+	    # Could still be aggregatable global unicast, link-local, site-local or multicast.
+	    # But not decoded further for now.
+	    return $result
+	}
+    }
+    
+    proc log_packet { device direction packet } {
+	if { [string length $packet] < 14 } {
+	    return
+	}
+	binary scan $packet {H2H2H2H2H2H2 H2H2H2H2H2H2 S} dest5 dest4 dest3 dest2 dest1 dest0 src5 src4 src3 src2 src1 src0 eth_protocol
+	set packet [string range $packet 14 end]
+	
+	set ether_msg "$device $direction: [string length $packet] bytes, "
+	append ether_msg [format ">%s:%s:%s:%s:%s:%s <%s:%s:%s:%s:%s:%s" $dest5 $dest4 $dest3 $dest2 $dest1 $dest0 $src5 $src4 $src3 $src2 $src1 $src0]
+	set eth_protocol [expr $eth_protocol & 0x0FFFF]
+	if { $eth_protocol <= 1536 } {
+	    append ether_msg " 802.3 "
+	    if { [string length $packet] < 8 } {
+		return
+	    }
+	    binary scan $packet {a6 S} junk eth_protocol
+	    set packet [string range $packet 8 end]
+	}
+	append ether_msg [format " %04x" $eth_protocol]
+	if { $eth_protocol == 0x0800 } {
+	    append ether_msg "(ip)"
+	} elseif { $eth_protocol == 0x00806 } {
+	    append ether_msg "(arp)"
+	} elseif { $eth_protocol == 0x08035 } {
+	    append ether_msg "(rarp)"
+	}
+	append ether_msg " [ethernet::format_hex_data $packet]\n"
+	synth::output $ether_msg "eth_ether"
+
+	if { 0x0806 == $eth_protocol } {
+	    # An ARP request. This should always be 28 bytes.
+	    if { [string length $packet] < 28 } {
+		return
+	    }
+	    binary scan $packet {SSccS H2H2H2H2H2H2 I H2H2H2H2H2H2 I} hard_type prot_type hard_size prot_size op \
+		    sender5 sender4 sender3 sender2 sender1 sender0 sender_ip \
+		    target5 target4 target3 target2 target1 target0 target_ip
+	    set hard_type [expr $hard_type & 0x0FFFF]
+	    set prot_type [expr $prot_type & 0x0FFFF]
+	    set hard_size [expr $hard_size & 0x0FF]
+	    set prot_size [expr $prot_size & 0x0FF]
+	    set op        [expr $op & 0x0FFFF]
+	    set sender_ip [expr $sender_ip & 0x0FFFFFFFF]
+	    set target_ip [expr $target_ip & 0x0FFFFFFFF]
+
+	    set arp_msg "$device $direction: ARP "
+	    if { $op == 1 } {
+		append arp_msg "request "
+	    } elseif { $op == 2 } {
+		append arp_msg "reply "
+	    } else {
+		append_arp_msg "<unknown opcode> "
+	    }
+	    if { $hard_type != 1 } {
+		append arp_msg "(unexpected hard_type field $hard_type, should be 1) "
+	    }
+	    if { $prot_type != 0x0800 } {
+		append arp_msg "(unexpected prot_type field $prot_type, should be 0x0800) "
+	    }
+	    if { $hard_size != 6 } {
+		append arp_msg "(unexpected hard_size field $hard_size, should be 6) "
+	    }
+	    if { $prot_size != 4 } {
+		append arp_msg "(unexpected prot_size field $prot_size, should be 4) "
+	    }
+	    append arp_msg [format ", sender %s:%s:%s:%s:%s:%s " $sender5 $sender4 $sender3 $sender2 $sender1 $sender0]
+	    append arp_msg [ethernet::inet_ipv4_ntoa $sender_ip]
+	    append arp_msg [format ", target %s:%s:%s:%s:%s:%s " $target5 $target4 $target3 $target2 $target1 $target0]
+	    append arp_msg [ethernet::inet_ipv4_ntoa $target_ip]
+	    append arp_msg "\n"
+
+	    synth::output $arp_msg "eth_arp"
+	    return
+	}
+
+	if { 0x0800 != $eth_protocol } {
+	    return
+	}
+
+	# We have an IP packet. Is this IPv4 or IPv6? The first byte contains
+	# the version and the overall length of the IP header in 32-bit words
+	if { [string length $packet] < 20 } {
+	    return
+	}
+	binary scan $packet {c} tmp
+	set ip_version [expr ($tmp >> 4) & 0x0F]
+	set ip_hdrsize [expr $tmp & 0x0F]
+	if { 4 == $ip_version } {
+	    binary scan $packet {ccSSSccSII} tmp tos len id frag ttl ip_protocol checksum source_ip dest_ip
+	    set ipv4_msg "$device $direction: IPv4"
+	    if { 0 != $tos } {
+		append ipv4_msg [format " tos %02x," [expr $tos & 0x0FF]]
+	    }
+	    append ipv4_msg [format " len %d, id %d," [expr $len & 0x0FFFF] [expr $id & 0x0FFFF]]
+	    if { 0 != $frag } {
+		append ipv4_msg [format " frag %u" [expr 8 * ($frag & 0x01FFF)]]
+		if { 0 != ($frag & 0x04000) } {
+		    append ipv4_msg " DF"
+		}
+		if { 0 != ($frag & 0x02000) } {
+		    append ipv4_msg " MF"
+		}
+		append ipv4_msg ","
+	    }
+	    append ipv4_msg [format " ttl %d," $ttl]
+	    set ip_protocol [expr $ip_protocol & 0x0FF]
+	    if { [info exists ethernet::protocols($ip_protocol)] } {
+		append ipv4_msg " $ethernet::protocols($ip_protocol),"
+	    } else {
+		append ipv4_msg [format " protocol %d" $ip_protocol]
+	    }
+
+	    set source_name [ethernet::inet_ipv4_ntoa $source_ip]
+	    set dest_name   [ethernet::inet_ipv4_ntoa $dest_ip]
+	    append ipv4_msg " >${dest_name}, <${source_name}\n"
+
+	    synth::output $ipv4_msg "eth_ipv4"
+
+	    # If this packet is a fragment other than the first, do not try to decode
+	    # subsequent packets. The header information will not be present.
+	    if { 0 != ($frag & 0x01FFF)} {
+		return
+	    }
+	    set packet [string range $packet [expr 4 * $ip_hdrsize] end]
+	    
+	} elseif { 6 == $ip_version } {
+	    if { [string length $packet] < 40 } {
+		return
+	    }
+	    binary scan $packet {ISccH16H16} flow payload_length next_header hop_limit source_ip dest_ip
+	    set ipv6_msg "$device $direction: IPv6"
+	    set prio [expr ($flow & 0x0F000000) >> 24]
+	    set flow [expr $flow & 0x00FFFFFF]
+	    if { 0 != $flow } {
+		append ipv6_msg [format " flow %04x prio %x," $flow $prio]
+	    }
+	    append ipv6_msg " payload [expr $payload bytes & 0x0FFFF],"
+	    append ipv6_msg " hop limit [expr $hop_limit & 0x0FF],"
+	    set next_header [expr $next_header & 0x0FF]
+	    if { [info exists ethernet::protocols($next_header)] } {
+		append ipv6_msg " $ethernet::protocols($next_header),"
+	    } else {
+		append ipv6_msg [format " protocol %d," $next_header]
+	    }
+
+	    set source_name [ethernet::inet_ipv6_ntoa $source_ip]
+	    set dest_name [ethernet::inet_ipv6_ntoa $dest_ip]
+	    append ipv6_msg " >${dest_name}, <${source_name}\n"
+
+	    synth::output $ipv6_msg "eth_ipv6"
+	    
+	    set packet [string range $packet 40 end]
+	    
+	} else {
+	    synth::output "$device $direction: unknown IP version $ip_version\n" "eth_ipv4"
+	    return
+	}
+
+
+	# Now for some known protocols, icmp, tcp, udp and icmpv6
+	# Possible ipv6-frag should be handled here as well. The
+	# fragment header should be followed by another header such
+	# as tcp or udp.
+	if { 1 == $ip_protocol } {
+	    # ipv4 ICMP
+	    if { [string length $packet] < 4 } {
+		return
+	    }
+	    binary scan $packet {ccS} code type checksum
+
+	    set icmpv4_msg "$device $direction: ICMPv4 "
+	    set error 0
+	    set data  0
+	    switch -- $code {
+		0 {
+		    append icmpv4_msg "ping reply"
+		    if { [string length $packet] >= 8 } {
+			# The id and seq are in the sender's format, not network format.
+			# We have to assume either little or bigendian, so go for the former
+			binary scan $packet {iss} junk id seq
+			append icmpv4_msg [format " id %u, seq %u" [expr $id & 0x0FFFF] [expr $seq & 0x0FFFF]]
+			set data 1
+			set packet [string range $packet 8 end]
+		    }
+		}
+		3 {
+		    append icmpv4_msg "unreachable/"
+		    switch -- $type {
+			 0   { append icmpv4_msg "network" }
+			 1   { append icmpv4_msg "host" }
+			 2   { append icmpv4_msg "protocol" }
+			 3   { append icmpv4_msg "port" }
+			 4   { append icmpv4_msg "frag needed but don't frag set" }
+			 5   { append icmpv4_msg "source route failed" }
+			 6   { append icmpv4_msg "destination network unknown" }
+			 7   { append icmpv4_msg "destination host unknown" }
+			 8   { append icmpv4_msg "source host isolated" }
+			 9   { append icmpv4_msg "destination network prohibited" }
+			10   { append icmpv4_msg "destination host prohibited" }
+			11   { append icmpv4_msg "network for TOS" }
+			12   { append icmpv4_msg "host for TOS" }
+			13   { append icmpv4_msg "communication prohibited" }
+			14   { append icmpv4_msg "host precedence violation" }
+			15   { append icmpv4_msg "precedence cutoff" }
+			default { append icmpv4_msg "unknown" }
+		    }
+		    set error 1
+		}
+		4 {
+		    append icmpv4_msg "source quench"
+		    set error 1
+		}
+		5 {
+		    append icmpv4_msg "redirect/"
+		    switch -- $type {
+			0 { append icmpv4_msg "network" }
+			1 { append icmpv4_msg "host" }
+			2 { append icmpv4_msg "tos & network" }
+			3 { append icmpv4_msg "tos & host" }
+			default { append icmpv4_msg "unknown" }
+		    }
+		    set error 1
+		}
+                8 {
+		    append icmpv4_msg "ping request"
+		    if { [string length $packet] >= 8 } {
+			binary scan $packet {iss} junk id seq
+			append icmpv4_msg [format " id %u, seq %u" [expr $id & 0x0FFFF] [expr $seq & 0x0FFFF]]
+			set data 1
+			set packet [string range $packet 8 end]
+		    }
+		}
+		9 {
+		    append icmpv4_msg "router advertisement"
+		}
+		10 {
+		    append icmpv4_msg "router solicitation"
+		}
+		11 {
+		    append icmpv4_msg "time exceeded/"
+		    switch -- $type {
+			0 { append icmpv4_msg "transit" }
+			1 { append icmpv4_msg "reassembly" }
+			default { append icmpv4_msg "unknown" }
+		    }
+		    set error 1
+		}
+		12 {
+		    append icmpv4_msg "parameter problem/"
+		    switch -- $type {
+			0 { append icmpv4_msg "IP header bad" }
+			1 { append icmpv4_msg "required option missing" }
+			default { append icmpv4_msg "unknown" }
+		    }
+		    set error 1
+		}
+		13 {
+		    append icmpv4_msg "timestamp request"
+		}
+		14 {
+		    append icmpv4_msg "timestamp reply"
+		}
+		15 {
+		    append icmpv4_msg "information request"
+		}
+		16 {
+		    append icmpv4_msg "information reply"
+		}
+		17 {
+		    append icmpv4_msg "address mask request"
+		}
+		18 {
+		    append icmpv4_msg "address mask reply"
+		}
+		default {
+		    append icmpv4_msg "unknown"
+		}
+	    }
+	    if { $error && ([string length $packet] >= 36) } {
+		# The ICMP message contains an IP header and hopefully the TCP or UDP ports as well
+		# Only deal with the simple cases.
+		binary scan $packet {iiccSiccSIISS} icmp_junk1 icmp_junk2 ip_lenver ip_junk1 ip_junk2 ip_junk3 ip_junk4 ip_protocol ip_junk5 \
+			ip_source ip_dest ip_source_port ip_dest_port
+		if { (5 == ($ip_lenver & 0x0F)) && ((6 == $ip_protocol) || (17 == $ip_protocol)) } {
+		    if { 6 == $ip_protocol } {
+			append icmpv4_msg ", tcp"
+		    } else {
+			append icmpv4_msg ", udp"
+		    }
+		    append icmpv4_msg " >[ethernet::inet_ipv4_ntoa $ip_dest]:$ip_dest_port <[ethernet::inet_ipv4_ntoa $ip_source]:$ip_source_port"
+		}
+	    }
+
+	    append icmpv4_msg "\n"
+	    synth::output $icmpv4_msg "eth_icmpv4"
+
+	    # Only some of the requests contain additional data that should be displayed
+	    if { !$data } {
+		return
+	    }
+	    
+	} elseif { 58 == $ip_protocol } {
+	    # ipv6 ICMP
+	    if { [string length $packet] < 4 } {
+		return
+	    }
+	    binary scan $packet {ccS} code type checksum
+
+	    set icmpv6_msg "$device $direction: ICMPv6 "
+	    set error 0
+	    set data  0
+	    switch -- $code {
+		1 {
+		    append icmpv6_msg "unreachable/"
+		    switch -- $type {
+			0 { append icmpv6_msg "no route" }
+			1 { append icmpv6_msg "prohibited" }
+			2 { append icmpv6_msg "not a neighbour" }
+			3 { append icmpv6_msg "any other reason" }
+			4 { append icmpv6_msg "UDP port unreachable" }
+			default { append icmpv6_msg "unknown" }
+		    }
+		    set error 1
+		}
+		2 {
+		    append icmpv6_msg "packet too big"
+		    set error 1
+		}
+		3 {
+		    append icmpv6_msg "time exceeded/"
+		    switch -- $type {
+			0 { append icmpv6_msg "hop limit" }
+			1 { append icmpv6_msg "fragment reassembly" }
+			default { append icmpv6_msg "unknown" }
+		    }
+		    set error 1
+		}
+		4 {
+		    append icmpv6_msg "parameter problem"
+		    switch -- $type {
+			0 { append icmpv6_msg "erroneous header" }
+			1 { append icmpv6_msg "unrecognized next header" }
+			2 { append icmpv6_msg "unrecognized option" }
+			default { append icmpv6_msg "unknown" }
+		    }
+		    set error 1
+		}
+		128 {
+		    append icmpv6_msg "ping request"
+		    # FIXME: is this the same format as for icmpv4?
+		}
+		129 {
+		    append icmpv6_msg "ping reply"
+		    # FIXME: is this the same format as for icmpv4?
+		}
+		130 {
+		    append icmpv6_msg "group membership query"
+		}
+		131 {
+		    append icmpv6_msg "group membership report"
+		}
+		132 {
+		    append icmpv6_msg "group membership reduction"
+		}
+		133 {
+		    append icmpv6_msg "router solicitation"
+		}
+		134 {
+		    append icmpv6_msg "router advertisement"
+		}
+		135 {
+		    append icmpv6_msg "neighbour solicitation"
+		}
+		136 {
+		    append icmpv6_msg "neighbour advertisement"
+		}
+		137 {
+		    append icmpv6_msg "redirect"
+		}
+	    }
+
+	    if { $error && ([string length $packet] >= 44) } {
+		# The ICMP message contains an IPv6 header and hopefully the TCP or UDP ports as well
+		binary scan $packet {isccH16H16SS} icmp_junk1 icmp_junk2 ip_protocol icmp_junk3 ip_source ip_dest ip_source_port ip_dest_port
+		if { 6 == $ip_protocol } {
+		    append icmpv6_msg ", tcp"
+		} elseif { 17 == $ip_protocol } {
+		    append icmpv6_msg ", udp"
+		}
+		append icmpv6_msg " >[ethernet::inet_ipv4_ntoa $ip_dest]:$ip_dest_port <[ethernet::inet_ipv6_ntoa $ip_source]:$ip_source_port"
+	    }
+	    append icmpv6_msg "\n"
+	    synth::output $icmpv6_msg "eth_icmpv6"
+
+	    if { !$data } {
+		return
+	    }
+	    
+	} elseif { 6 == $ip_protocol } {
+	    # TCP
+	    if { [string length $packet] < 20 } {
+		return
+	    }
+	    binary scan $packet {SSIIccSSS} source_port dest_port seq ack hdrsize flags winsize checksum urg
+	    set source_port [expr $source_port & 0x0FFFF]
+	    set dest_port   [expr $dest_port & 0x0FFFF]
+	    set hdrsize     [expr ($hdrsize >> 4) & 0x0F]
+	    set winsize     [expr $winsize & 0x0FFFF]
+	    set urg         [expr $urg & 0x0FFFF]
+
+	    set tcp_msg "$device $direction tcp: "
+	    append tcp_msg " >${dest_name}:${dest_port}"
+	    if { [info exists ethernet::services($dest_port,udp)] } {
+		append tcp_msg "($ethernet::services($dest_port,udp))"
+	    }
+	    append tcp_msg "<${source_name}:$source_port"
+	    if { [info exists ethernet::services($source_port,udp)] } {
+		append tcp_msg "($ethernet::services($source_port,udp))"
+	    }
+
+	    append tcp_msg ", "
+	    if { $flags & 0x08 } {
+		append tcp_msg "PSH "
+	    }
+	    if { $flags & 0x04 } {
+		append tcp_msg "RST "
+	    }
+	    if { $flags & 0x02 } {
+		append tcp_msg "SYN "
+	    }
+	    if { $flags & 0x01 } {
+		append tcp_msg "FIN "
+	    }
+	    append tcp_msg [format "seq %u" $seq]
+	    
+	    if { 0 != ($flags & 0x010) } {
+		append tcp_msg [format ", ACK %u" $ack]
+	    }
+	    append tcp_msg ", win $winsize"
+	    if { 0 != ($flags & 0x020) } {
+		append tcp_msg ", URG $urg"
+	    }
+	    append tcp_msg "\n"
+	    synth::output $tcp_msg "eth_tcp"
+	    
+	    set packet [string range $packet [expr 4 * $hdrsize] end]
+	} elseif { 17 == $ip_protocol } {
+	    # UDP
+	    if { [string length $packet] < 8 } {
+		return
+	    }
+	    set udp_msg "$device $direction: udp "
+	    binary scan $packet {SSSS} source_port dest_port len checksum
+	    set source_port [expr $source_port & 0x0FFFF]
+	    set dest_port   [expr $dest_port   & 0x0FFFF]
+	    append udp_msg [format "%d bytes, " [expr $len & 0x0FFFF]]
+	    append udp_msg " >${dest_name}:$dest_port"
+	    if { [info exists ethernet::services($dest_port,udp)] } {
+		append udp_msg "($ethernet::services($dest_port,udp))"
+	    }
+	    append udp_msg "<${source_name}:$source_port"
+	    if { [info exists ethernet::services($source_port,udp)] } {
+		append udp_msg "($ethernet::services($source_port,udp))"
+	    }
+	    append udp_msg "\n"
+	    synth::output $udp_msg "eth_udp"
+	    set packet [string range $packet 8 end]
+	} else {
+	    # Unknown protocol, so no way of knowing where the data starts.
+	    return
+	}
+
+	# At this point we may have a payload. This should be
+	# dumped in both hex and ascii. The code tries to preserve
+	# alignment.
+	if { [string length $packet] == 0 } {
+	    return
+	}
+	set hexdata_msg "$device $direction: data [format_hex_data $packet]\n"
+	set asciidata_msg "$device $direction: data "
+	set len [string length $packet]
+	if { $len > $ethernet::max_show } {
+	    set len $ethernet::max_show
+	}
+	for { set i 0 } { $i < $len } { incr i } {
+	    set char [string index $packet $i]
+	    if { "\r" == $char } {
+		append asciidata_msg "\\r"
+	    } elseif { "\n" == $char } {
+		append asciidata_msg "\\n"
+	    } elseif { "\t" == $char } {
+		append asciidata_msg "\\t"
+	    } elseif { [string is print -strict $char] } {
+		append asciidata_msg " $char"
+	    } else {
+		append asciidata_msg "??"
+	    }
+	    if { 3 == ($i % 4) } {
+		append asciidata_msg " "
+	    }
+	}
+	append asciidata_msg "\n"
+	synth::output $hexdata_msg "eth_hexdata"
+	synth::output $asciidata_msg "eth_asciidata"
+	
+	return
+    }
+
+    # A utility for handling the ethernet record button on the toolbar
+    proc logging_button_toggle { } {
+	if { $ethernet::logging_enabled } {
+	    set ethernet::logging_enabled 0
+	    .toolbar.ethernet_logging configure -relief flat
+	} else {
+	    set ethernet::logging_enabled 1
+	    .toolbar.ethernet_logging configure -relief sunken
+	}
+    }
+    
+    # A dummy procedure for initialization. All of this could execute at
+    # the toplevel, but there are lots of locals.
+    proc filters_initialize { } {
+	ethernet::read_services
+	ethernet::read_protocols
+	ethernet::read_hosts
+
+	# Add a button on the toolbar for enabling/disabling logging.
+	# Also add an entry to the help menu
+	if { $synth::flag_gui } {
+	    button .toolbar.ethernet_logging -image $ethernet::image_netrecord -borderwidth 2 -relief flat -command ethernet::logging_button_toggle]
+	    pack .toolbar.ethernet_logging -side left -padx 2
+	    synth::register_balloon_help .toolbar.ethernet_logging "Record ethernet traffic"
+
+	    if { [synth::tdf_has_option "ethernet" "logging"] } {
+		set ethernet::logging_enabled [synth::tdf_get_option "ethernet" "logging"]
+	    } else {
+		# Default to logging ethernet traffic. This may not be the right thing to do
+		# because users may see too much output by default, but it is easy enough
+		# to disable.
+		set ethernet::logging_enabled 1
+	    }
+	    if { $ethernet::logging_enabled } {
+		.toolbar.ethernet_logging configure -relief sunken
+	    }
+
+	    set ethernet_help [file join $synth::device_src_dir "doc" "devs-eth-synth-ecosynth.html"]
+	    if { ![file readable $ethernet_help] } {
+		synth::report_warning "Failed to locate synthetic ethernet documentation $ethernet_help\n   \
+			Help->Ethernet target menu option disabled.\n"
+		set ethernet_help ""
+	    }
+	    if { "" == $ethernet_help } {
+		.menubar.help add command -label "Ethernet" -state disabled
+	    } else {
+		.menubar.help add command -label "Ethernet" -command [list synth::handle_help "file://$ethernet_help"]
+	    }
+	}
+
+	if { [synth::tdf_has_option "ethernet" "max_show"] } {
+	    set ethernet::max_show [synth::tdf_get_option "ethernet" "max_show"]
+	    if { ! [string is integer -strict $ethernet::max_show] } {
+		synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n   \
+			             Entry max_show should be a simple integer, not $ethernet::max_show\n"
+		set ethernet::init_ok 0
+	    }
+	}
+
+	# Filters. First, perform some validation.
+	set known_filters [list "ether" "arp" "ipv4" "ipv6" "icmpv4" "icmpv6" "udp" "tcp" "hexdata" "asciidata"]
+	set tdf_filters [synth::tdf_get_options "ethernet" "filter"]
+	array set filter_options [list]
+
+	foreach filter $tdf_filters {
+	    if { 0 == [llength $filter] } {
+		synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n   \
+			             Option \"filter\" requires the name of a known filters.\n"
+		set ethernet::init_ok 0
+		continue
+	    }
+	    set name [lindex $filter 0]
+	    if { [info exists filter_options($name)] } {
+		synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n   \
+			             \"filter $name\" should be defined only once.\n"
+		set ethernet::init_ok 0
+		continue
+	    }
+	    if { -1 == [lsearch -exact $known_filters $name] } {
+		synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n   \
+			             Unknown filter \"$name\".\n   \
+				     Known filters are $known_filters\n"
+		set ethernet::init_ok 0
+		continue
+	    }
+	    set filter_options($name) [lrange $filter 1 end]
+	}
+
+	# We now know about all the filter entries in the target definition file.
+	# Time to create the filters themselves, provided we are running in GUI mode.
+	if { $synth::flag_gui }	{
+	    foreach filter $known_filters {
+		if { ! [info exists filter_options($filter)] } {
+		    synth::filter_add "eth_$filter" -text "ethernet $filter"
+		} else {
+		    array set parsed_options [list]
+		    set message ""
+		    if { ![synth::filter_parse_options $filter_options($filter) parsed_options message] } {
+			synth::report_error \
+			    "Invalid entry in target definition file $synth::target_definition\n   \
+			     Ethernet filter $filter\n   $message"
+			set ethernet::init_ok 0
+		    } else {
+			set parsed_options("-text") "ethernet $filter"
+			synth::filter_add_parsed "eth_$filter" parsed_options
+		    }
+		}
+	    }
+	}
+    }
+    ethernet::filters_initialize
+}
+
+return ethernet::instantiate
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/ethernet.tdf
@@ -0,0 +1,117 @@
+# Target definition file fragment for ethernet devices.
+#
+# The target-side can instantiate up to four ethernet devices,
+# eth0 to eth3. Each instance requires an entry in the
+# target definition file specifying what underlying Linux
+# kernel facility should be used to implement the I/O. This
+# can take the following forms:
+#
+# 1) an existing ethernet device, e.g.
+#        eth0 real eth1
+#    thus mapping the eCos device eth0 on to the Linux device eth1.
+#    The latter network interface must not currently be in use
+#    by Linux. Traffic will flow to and from the real ethernet, and
+#    communication is possible with any machine on the LAN.
+#    
+# 2) the Linux kernel's tap facility.
+#        eth0 ethertap
+#    This will result in a Linux ethernet interface such as
+#    tap3 appearing. The interface can be configured like any
+#    other network device, for example by using the ifconfig
+#    command or by creating a configuration file
+#    /etc/sysconfig/network-scripts/ifcfg-tap3
+#    The result is a virtual ethernet segment visible only
+#    to the Linux host and eCos. Bridge software inside the
+#    Linux host can be used to connect eCos to a larger network.
+#
+#    Optionally a specific tap device can be configured,
+#        eth0 ethertap tap3
+#    By default the code will pick up the next free tap device,
+#    usually tap0. If the Linux interface should come up automatically
+#    then this can be achieved with an ifcfg-tap?? configuration
+#    file. Explicitly specifying the tap device can avoid some
+#    confusion.
+#
+#    Both the eCos and the Linux network interface need a unique
+#    MAC address. There is no real ethernet hardware involved to
+#    supply these addresses, so they have to be invented. The
+#    Linux kernel will automatically invent one for its interface.
+#    By default a random MAC address will also be generated for
+#    the eCos interface, but to make the system more deterministic
+#    it is possible to specify the MAC address to be used. This
+#    facility is only available in conjunction with an explicit
+#    tap device, e.g.:
+#        eth0 ethertap tap3 00:01:02:03:04:05
+#    The MAC address should be in the usual format: six 2-digit
+#    hexadecimal numbers separated by colons. It is the user's
+#    responsibility to make sure that the address specified
+#    does not match any other real or invented address visible
+#    on the local network.
+#
+# It is possible that bursts of ethernet traffic occur, causing
+# packets to arrive faster than they can be forwarded to and
+# processed by eCos. It is desirable that some number of packets
+# be buffered, matching the behaviour of many ethernet devices
+# with built-in fifos. However the number of these packets should
+# be restricted: if eCos stops accepting ethernet packets or
+# cannot handle the data quickly enough, then it is possible that
+# an unlimited number of packets could accumulate in the I/O
+# auxiliary until all available memory and swap space is exhausted.
+# By default up to 16 packets will be buffered per device, but
+# this can be changes with the max_buffer option.
+#
+# The ethernet emulation code can perform logging and limited
+# analysis of each ethernet packet. For example if a particular
+# packet is an IPv4 ICMP request then details of the request
+# will be logged to the main text window. The appearance of the
+# various filters can be controlled here, using the usual
+# options such as -foreground, -background, and -hide.
+#
+# This logging of each ethernet frame can be somewhat time-consuming
+# and, for a long run, require a lot of memory. Logging can be
+# disabled by default if desired, and a button on the toolbar allows
+# this setting to be toggled.
+#
+# Ethernet packets can be up to 1514 bytes, so showing entire packets
+# on a single line can mean very wide lines. In practice the interesting
+# data is usually at the start, so the output can be truncated to a
+# maximum number of bytes. The data is displayed in hex so each byte
+# requires two columns, and some spacing will be added as well to
+# improve legibility.
+
+synth_device ethernet {
+    ## Map eCos devices on to Linux ones.
+    
+    # eth0 real eth1
+    # eth0 ethertap
+    # eth0 ethertap tap3
+    eth0 ethertap tap3 00:FE:42:63:84:A5
+
+    # eth1 ethertap tap4 00:FE:12:34:56:78
+    # eth2 ethertap tap5 00:FE:9A:BC:DE:F0
+    # eth3 real eth2
+
+    ## Maximum number of packets that should be buffered per interface.
+    ## Default 16
+    max_buffer 32
+
+    ## Should packets be logged? The default is yes.
+    # logging  0
+
+    ## Maximum number of data bytes to be shown.
+    ## Default 64
+    # max_show 128
+
+    ## Filters for the various recognised protocols.
+    ## By default all filters are visible and use standard colours.
+    # filter ether     -hide 0
+    # filter arp       -hide 1
+    # filter ipv4      -hide 1
+    # filter ipv6      -hide 1
+    # filter icmpv4    -hide 1
+    # filter icmpv6    -hide 1
+    # filter udp       -hide 1
+    # filter tcp       -hide 1
+    # filter hexdata   -hide 0
+    # filter asciidata -hide 0
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/fromnet.xbm
@@ -0,0 +1,4 @@
+#define fromnet_width 8
+#define fromnet_height 8
+static unsigned char fromnet_bits[] = {
+   0x00, 0x87, 0xa5, 0x95, 0xfd, 0x95, 0xa5, 0x87};
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/netrecord.xbm
@@ -0,0 +1,6 @@
+#define netrecord_width 16
+#define netrecord_height 15
+static unsigned char netrecord_bits[] = {
+   0x00, 0x00, 0xce, 0x39, 0x4a, 0x08, 0xce, 0x09, 0x46, 0x08, 0xca, 0x39,
+   0x00, 0x00, 0x0e, 0x20, 0x4a, 0x24, 0x2a, 0x28, 0xfa, 0x3f, 0x2a, 0x28,
+   0x4a, 0x24, 0x0e, 0x20, 0x00, 0x00};
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/rawether.c
@@ -0,0 +1,757 @@
+//============================================================================
+//
+//     rawether.c
+//
+//     A utility program to perform low-level ethernet operations
+//
+//============================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// ----------------------------------------------------------------------------
+// Copyright (C) 2002 Bart Veer
+//
+// This file is part of the eCos host tools.
+//
+// This program is free software; you can redistribute it and/or modify it 
+// under the terms of the GNU General Public License as published by the Free 
+// Software Foundation; either version 2 of the License, or (at your option) 
+// any later version.
+// 
+// This program is distributed in the hope that it will be useful, but WITHOUT 
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+// more details.
+// 
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 
+// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// ----------------------------------------------------------------------------
+//                                                                          
+//####COPYRIGHTEND####
+//============================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):   bartv
+// Contact(s):  bartv
+// Date:        2002/08/07
+// Version:     0.01
+// Description:
+//
+// This program is fork'ed by the ethernet.tcl script running inside
+// the synthetic target auxiliary. It is responsible for performing
+// low-level ethernet I/O.
+//
+//####DESCRIPTIONEND####
+//============================================================================
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <signal.h>
+#include <limits.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h>
+#include <linux/if_tun.h>
+
+// The protocol between host and target is defined by a private
+// target-side header.
+#include "../src/protocol.h"
+
+// Allow debug builds. Set this flag to 0, 1 or 2
+#define DEBUG 0
+
+// ----------------------------------------------------------------------------
+// Statics.
+
+// Are we using a real ethernet device or ethertap?
+static int real_ether = 0;
+static int ethertap   = 0;
+
+// The six-byte MAC address, which must be returned to eCos
+static unsigned char MAC[6];
+
+// Does the driver support multicasting?
+static int multicast_supported = 0;
+
+// The file descriptor for incoming data ethernet packets.
+// Used for select() together with fd 0 corresponding to ecosynth
+static int ether_fd = -1;
+
+// Is the interface up?
+static int up = 0;
+
+// Space for incoming and outgoing packets. In the case of rx_buffer
+// there are an extra four bytes at the front for the protocol header.
+#define MTU 1514
+static unsigned char tx_buffer[MTU];
+static unsigned char rx_buffer[MTU+4];
+
+// ----------------------------------------------------------------------------
+// A utility buffer for messages.
+#define MSG_SIZE 256
+static unsigned char msg[MSG_SIZE];
+
+// Report an error to ecosynth during initialization. This means a
+// single byte 0, followed by a string.
+static void
+report_error(char* msg)
+{
+    write(1, "0", 1);
+    write(1, msg, strlen(msg));
+    close(1);
+    exit(0);
+}
+
+// Report success to ecosynth. This means a byte 1 followed by
+// the MAC address.
+static void
+report_success(void)
+{
+    write(1, "1", 1);
+    memcpy(msg, MAC, 6);
+    msg[6] = multicast_supported;
+    write(1, msg, 7);
+}
+
+
+// ----------------------------------------------------------------------------
+// Real ethernet. This involves creating a SOCK_RAW socket and binding it
+// to the appropriate interface. Relevant documentation can be found in
+// the man pages (packet(7) and netdevice(7)).
+
+// The device name. Needed for various ioctl()'s.
+static char real_devname[IFNAMSIZ];
+
+// The interface index.
+static int real_ifindex = -1;
+
+// Transmit a single ethernet frame. The socket should be set up so a
+// simple send() operation should do the trick. Errors such as EAGAIN,
+// indicating that the network device is still busy, are ignored.
+// Ethernet is not a reliable communication medium.
+static void
+real_handle_tx(unsigned char* buffer, int size)
+{
+    int result;
+
+    result = send(ether_fd, buffer, size, MSG_DONTWAIT);
+    if (result < 0) {
+        // It appears that one retry is worthwhile, to clear pending
+        // errors or something.
+        result = send(ether_fd, buffer, size, MSG_DONTWAIT);
+    }
+#if (DEBUG > 0)
+    fprintf(stderr, "rawether dbg: tx %d bytes -> %d\n", size, result);
+#endif
+#if (DEBUG > 1)
+    fprintf(stderr, "    %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n",
+            buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5],
+            buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11],
+            buffer[12], buffer[13]);
+#endif    
+}
+
+// Receive a single ethernet frame, using the static rxbuffer. If the
+// interface is not currently up discard it. Otherwise forward it on
+// to ecosynth.
+
+static void
+real_handle_rx(void)
+{
+    int             size;
+    int             result;
+
+    size = recv(ether_fd, rx_buffer + 4, MTU, MSG_TRUNC);
+    
+#if (DEBUG > 0)
+    fprintf(stderr, "rawether dbg: rx returned %d, errno %s (%d)\n", size, (errno < sys_nerr) ? sys_errlist[errno] : "<unknown>", errno);
+#endif
+    
+    if (size < 0) {
+        return;     // Ignore errors, just go around the main loop again.
+    }
+    if ((size < 14) || (size > MTU)) {
+        return;     // Invalid packet size. Discard the packet.
+    }
+
+#if (DEBUG > 1)
+    fprintf(stderr, "    %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n",
+            rx_buffer[4], rx_buffer[5], rx_buffer[6], rx_buffer[7], rx_buffer[8], rx_buffer[9],
+            rx_buffer[10], rx_buffer[11], rx_buffer[12], rx_buffer[13], rx_buffer[14], rx_buffer[15],
+            rx_buffer[16], rx_buffer[17]);
+#endif    
+
+    if (!up) {
+        // eCos is not currently expecting packets, so discard them.
+        // This may not actually be necessary because the interface
+        // is only up when eCos wants it to be up.
+        return;
+    }
+
+    // It looks this packet should get forwarded to eCos.
+    rx_buffer[0] = SYNTH_ETH_RX;
+    rx_buffer[1] = 0;
+    rx_buffer[2] = size & 0x00FF;
+    rx_buffer[3] = (size >> 8) & 0x00FF;
+    do {
+        result = write(1, rx_buffer, 4 + size);
+    } while ((-1 == result) && (EINTR == errno));
+
+    if (result != (size + 4)) {
+        fprintf(stderr, "rawether(%s): failed to send ethernet packet to I/O auxiliary, exiting.\n", real_devname);
+        exit(1);
+    }
+}
+
+// Utility to manipulate interface flags. This involves retrieving the
+// current flags, or'ing in some bits, and'ing out others, and updating.
+static void
+real_update_ifflags(int set_bits, int clear_bits)
+{
+    struct ifreq    request;
+    int             flags;
+    
+    strncpy(request.ifr_name, real_devname, IFNAMSIZ);
+    if (ioctl(ether_fd, SIOCGIFFLAGS, &request) < 0) {
+        fprintf(stderr, "rawether (%s): failed to get interface flags, exiting\n", real_devname);
+        exit(1);
+    }
+    
+    flags = request.ifr_flags;
+
+    flags |= set_bits;
+    flags &= ~clear_bits;
+
+    if (flags == request.ifr_flags) {
+        // Nothing is changing.
+        return;
+    }
+
+    strncpy(request.ifr_name, real_devname, IFNAMSIZ);
+    request.ifr_flags = flags;
+    if (ioctl(ether_fd, SIOCSIFFLAGS, &request) < 0) {
+        fprintf(stderr, "rawether (%s): failed to update interface flags, exiting\n", real_devname);
+        exit(1);
+    }
+}
+
+
+// Starting an interface. This involves bringing the interface up,
+// and optionally setting promiscuous mode.
+// NOTE: is UP really the right thing here? There is no IP address
+// for this interface. In theory this should not matter because
+// we have a bound socket which should receive all packets for
+// this interface.
+
+static void
+real_handle_start(int promiscuous)
+{
+    if (promiscuous) {
+        real_update_ifflags(IFF_UP | IFF_PROMISC, 0);
+    } else {
+        real_update_ifflags(IFF_UP, IFF_PROMISC);
+    }
+    up = 1;
+}
+
+// Stopping an interface means clearing the UP flag
+static void
+real_handle_stop(void)
+{
+    up = 0;
+    real_update_ifflags(0, IFF_UP | IFF_PROMISC);
+}
+
+// Enabling/disabling multicast support.
+static void
+real_handle_multiall(int on)
+{
+    struct packet_mreq req;
+
+    req.mr_ifindex  = real_ifindex;
+    req.mr_type     = PACKET_MR_ALLMULTI;
+    req.mr_alen     = 0;
+    if (setsockopt(ether_fd, SOL_PACKET, on ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP, (void*)&req, sizeof(req)) < 0) {
+        fprintf(stderr, "rawether (%s): failed to manipulate multicast-all flag, exiting\n", real_devname);
+        exit(1);
+    }
+}
+
+// When the application exists make sure that the interface goes down again.
+
+static void
+real_atexit(void)
+{
+    if (up) {
+        real_update_ifflags(0, IFF_UP | IFF_PROMISC);
+    }
+}
+
+static void
+real_init(char* devname)
+{
+    struct sockaddr_ll  addr;
+    struct ifreq        request;
+    
+    if (strlen(devname) >= IFNAMSIZ) {
+        snprintf(msg, MSG_SIZE, "Invalid real network device name \"%s\", too long.\n", devname);
+        report_error(msg);
+    }
+    strcpy(real_devname, devname);
+
+    // All ioctl() operations need a socket. We might as well create the
+    // raw socket immediately and use that.
+    ether_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+    if (ether_fd < 0) {
+        snprintf(msg, MSG_SIZE, "Unable to create a raw socket for accessing network device\n"
+                 "    Error %s (errno %d)\n", (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno);
+        report_error(msg);
+    }
+    
+    strncpy(request.ifr_name, real_devname, IFNAMSIZ);
+    if (ioctl(ether_fd, SIOCGIFINDEX, &request) < 0) {
+        snprintf(msg, MSG_SIZE, "Device %s does not correspond to a valid interface.\n"
+                 "    Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno);
+        report_error(msg);
+    }
+    real_ifindex = request.ifr_ifindex;
+
+    // The interface exists. Now check that it is usable.
+    strncpy(request.ifr_name, real_devname, IFNAMSIZ);
+    if (ioctl(ether_fd, SIOCGIFFLAGS, &request) < 0) {
+        snprintf(msg, MSG_SIZE, "Failed to get current interface flags for %s\n"
+                 "    Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno);
+        report_error(msg);
+    }
+
+    if (request.ifr_flags & (IFF_UP | IFF_RUNNING)) {
+        snprintf(msg, MSG_SIZE, "Network device %s is already up and running.\n"
+                 "    Exclusive access is required\n", real_devname);
+        report_error(msg);
+    }
+    if (request.ifr_flags & IFF_LOOPBACK) {
+        report_error("Loopback devices cannot be used for synthetic target ethernet emulation.\n");
+    }
+    if (request.ifr_flags & IFF_POINTOPOINT) {
+        report_error("Point-to-point devices cannot be used for synthetic target ethernet emulation.\n");
+    }
+    if (request.ifr_flags & IFF_MULTICAST) {
+        multicast_supported = 1;
+    }
+        
+    // Make sure the interface is down. There is no point in receiving packets just yet.
+    real_update_ifflags(0, IFF_UP | IFF_PROMISC);
+    
+    // The flags look ok. Now get hold of the hardware address.
+    strncpy(request.ifr_name, real_devname, IFNAMSIZ);
+    if (ioctl(ether_fd, SIOCGIFHWADDR, &request) < 0) {
+        snprintf(msg, MSG_SIZE, "Failed to get hardware address for %s\n"
+                 "    Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno);
+        report_error(msg);
+    }
+    if (ARPHRD_ETHER != request.ifr_hwaddr.sa_family) {
+        snprintf(msg, MSG_SIZE, "Device %s is not an ethernet device.\n", real_devname);
+        report_error(msg);
+    }
+    memcpy(MAC, request.ifr_hwaddr.sa_data, 6);
+
+    // The device is useable. Now just bind the socket to the appropriate address.
+    addr.sll_family     = AF_PACKET;
+    addr.sll_protocol   = htons(ETH_P_ALL);
+    addr.sll_ifindex    = real_ifindex;
+    if (bind(ether_fd, (struct sockaddr*) &addr, sizeof(addr)) < 0) {
+        snprintf(msg, MSG_SIZE, "Failed to bind socket for direct hardware address to %s\n"
+                 "    Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno);
+        report_error(msg);
+    }
+
+    // Make sure the interface gets shut down when rawether exits.
+    atexit(real_atexit);
+
+    // And that should be it.
+}
+
+// ----------------------------------------------------------------------------
+// Ethertap device.
+//
+// See /usr/src/linux-2.x.y/Documentation/networking/tuntap.txt for more
+// information on the tun/tap driver.
+//
+// Basically during initialization this code opens /dev/net/tun, then
+// performs a TUNSETIFF ioctl() to initialize it. This causes a
+// new network device tap?? to appear. Any ethernet frames written
+// by the Linux kernel to this device can be read from the
+// dev/net/tun file descriptor, and ethernet frames can be written to
+// the same descriptor. The net effect is a virtual ethernet segment
+// with one interface managed by the Linux kernel and another
+// interface (or, theoretically, several) accessible via the file
+// descriptor.
+//
+// The Linux kernel will invent a MAC address for its interface. An
+// additional one is needed for eCos. This is either invented or
+// specified in the target definition file.
+
+static void
+tap_handle_tx(unsigned char* buffer, int size)
+{
+    int result;
+
+    result = write(ether_fd, buffer, size);
+#if (DEBUG > 0)
+    fprintf(stderr, "rawether dbg: tx %d bytes -> %d\n", size, result);
+#endif
+#if (DEBUG > 1)
+    fprintf(stderr, "    %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n",
+            buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5],
+            buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11],
+            buffer[12], buffer[13]);
+#endif    
+}
+
+// Receive a single packet from the socket. It is assumed that the
+// tuntap code inside the kernel will preserve packet boundaries.
+//
+// For now it is assumed that all incoming packets are intended for
+// eCos. That may not be accurate, and additional filtering in
+// software might be appropriate. In promiscuous mode all packets
+// should be accepted, obviously. Otherwise all broadcasts should
+// be accepted, as should all messages intended for this specific
+// interface's MAC address. Multicasts should be accepted only if
+// enabled.
+static void
+tap_handle_rx(void)
+{
+    int             size;
+    int             result;
+
+    // select() has succeeded so this read() should never block.
+    size = read(ether_fd, rx_buffer + 4, MTU);
+#if (DEBUG > 0)
+    fprintf(stderr, "rawether dbg: rx returned %d, errno %s (%d)\n", size, (errno < sys_nerr) ? sys_errlist[errno] : "<unknown>", errno);
+#endif
+    
+    if (size < 0) {
+        return;     // Ignore errors, just go around the main loop again.
+    }
+    if ((size < 14) || (size > MTU)) {
+        return;     // Invalid packet size. Discard the packet.
+    }
+
+#if (DEBUG > 1)
+    fprintf(stderr, "    %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n",
+            rx_buffer[4], rx_buffer[5], rx_buffer[6], rx_buffer[7], rx_buffer[8], rx_buffer[9],
+            rx_buffer[10], rx_buffer[11], rx_buffer[12], rx_buffer[13], rx_buffer[14], rx_buffer[15],
+            rx_buffer[16], rx_buffer[17]);
+#endif    
+
+    if (!up) {
+        // eCos is not currently expecting packets, so discard them.
+        return;
+    }
+
+    // It looks this packet should get forwarded to eCos.
+    rx_buffer[0] = SYNTH_ETH_RX;
+    rx_buffer[1] = 0;
+    rx_buffer[2] = size & 0x00FF;
+    rx_buffer[3] = (size >> 8) & 0x00FF;
+    do {
+        result = write(1, rx_buffer, 4 + size);
+    } while ((-1 == result) && (EINTR == errno));
+
+    if (result != (size + 4)) {
+        fprintf(stderr, "rawether(%s): failed to send ethernet packet to I/O auxiliary, exiting.\n", real_devname);
+        exit(1);
+    }
+}
+
+// Nothing much can be done for start or stop. Just set the flag and
+// let the rx and tx code discard packets when appropriate.
+//
+// For now the device is implicitly promiscuous and accepts all
+// multicasts. Given the nature of a tap device it is unlikely that
+// any packets will arrive which are not destined here.
+// FIXME: this may have to change if bridging is enabled.
+static void
+tap_handle_start(int promiscuous)
+{
+    up = 1;
+}
+
+static void
+tap_handle_stop(void)
+{
+    up = 0;
+}
+
+static void
+tap_handle_multiall(int on)
+{
+}
+
+static void tap_init(int argc, char** argv)
+{
+    char* devname   = NULL;
+    struct ifreq    ifr;
+
+    // Which device? By default let the system pick one, but the user
+    // can override this.
+    if (0 != argc) {
+        devname = argv[0];
+    }
+    
+    // Work out the MAC address. By default a random one is generated,
+    // but the user can specify one to avoid a source of randomness.
+    // This MAC address is not actually needed by any of the code here,
+    // but should be returned to eCos.
+    if (2 == argc) {
+        unsigned int mac_data[6];   // sscanf() needs unsigned ints
+        int result = sscanf(argv[1], "%x:%x:%x:%x:%x:%x",
+                            &(mac_data[0]), &(mac_data[1]), &(mac_data[2]),
+                            &(mac_data[3]), &(mac_data[4]), &(mac_data[5]));
+        if (6 != result) {
+            snprintf(msg, MSG_SIZE, "Invalid MAC address %s\n", argv[1]);
+            report_error(msg);
+        }
+        MAC[0] = mac_data[0];
+        MAC[1] = mac_data[1];
+        MAC[2] = mac_data[2];
+        MAC[3] = mac_data[3];
+        MAC[4] = mac_data[4];
+        MAC[5] = mac_data[5];
+    } else {
+        srand(time(NULL));
+        MAC[0] = 0;
+        MAC[1] = 0x0FF;
+        MAC[2] = rand() & 0x0FF;
+        MAC[3] = rand() & 0x0FF;
+        MAC[4] = rand() & 0x0FF;
+        MAC[5] = rand() & 0x0FF;
+    }
+
+    ether_fd = open("/dev/net/tun", O_RDWR);
+    if (ether_fd < 0) {
+        snprintf(msg, MSG_SIZE, "Failed to open /dev/net/tun, errno %s (%d)\n", (errno < sys_nerr) ? sys_errlist[errno] : "<unknown>", errno);
+        report_error(msg);
+    }
+
+    memset(&ifr, 0, sizeof(ifr));
+    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+    if (NULL != devname) {
+        strncpy(ifr.ifr_name, devname, IFNAMSIZ - 1);
+    }
+    if (ioctl(ether_fd, TUNSETIFF, (void*)&ifr) < 0) {
+        snprintf(msg, MSG_SIZE, "Failed to initialize /dev/net/tun, errno %s (%d)\n", (errno < sys_nerr) ? sys_errlist[errno] : "<unknown>", errno);
+        report_error(msg);
+    }
+
+    // Supporting multicasts is a no-op
+    multicast_supported = 1;
+    
+    // All done.
+}
+
+// ----------------------------------------------------------------------------
+// Receive a single request from ecosynth. This consists of a four-byte
+// header, optionally followed by a tx packet. EOF indicates that
+// ecosynth has exited, so this process should just exit immediately
+// as well. Any problems should be reported to stderr, followed by
+// termination.
+//
+// Currently rawether is single-threaded. Theoretically this could
+// cause a deadlock situation where the I/O auxiliary is trying to send
+// rawether a request and is blocked on the write, while rawether is trying
+// to send data to the I/O auxiliary. In practice the pipes should do
+// enough buffering to avoid complications, especially since rawether
+// gives priority to requests from the auxiliary.
+
+static void
+handle_ecosynth_request(void)
+{
+    unsigned char   req[4];
+    int             result;
+    int             code, arg, size;
+
+    result = read(0, req, 4);
+    if (result == 0) {
+        // select() succeeded but no data. EOF. So exit
+        exit(0);
+    }
+    if (result < 0) {
+        // EINTR? EAGAIN? The latter should not happen since the pipe
+        // has not been put into non-blocking mode.
+        if ((EINTR == errno) || (EAGAIN == errno)) {
+            return;
+        } else {
+            fprintf(stderr, "rawether: unexpected error reading request from ecosynth\n");
+            if (errno < sys_nerr) {
+                fprintf(stderr, "    %s\n", sys_errlist[errno]);
+            }
+            exit(1);
+        }
+    }
+    if (result < 4) {
+        fprintf(stderr, "rawether: unexpected error reading request from ecosynth\n    Expected 4 bytes, only received %d\n", result);
+        exit(1);
+    }
+
+    code = req[0];
+    arg  = req[1];
+    size = req[2] + (req[3] << 8);
+
+#if (DEBUG > 1)
+    fprintf(stderr, "rawether dbg: request %x from auxiliary\n", code);
+#endif    
+
+    switch(code) {
+      case SYNTH_ETH_TX:
+        {
+            if (size < 14) {
+                fprintf(stderr, "rawether: attempt to send invalid ethernet packet of only %d bytes\n"
+                        "Ethernet packets should be at least 14 bytes.\n", size);
+                exit(1);
+            }
+            if (size > MTU) {
+                fprintf(stderr, "rawether: attempt to send invalid ethernet packet of %d bytes\n"
+                        "Only packets of up to %d bytes are supported.\n", size, MTU);
+                exit(1);
+            }
+            do {
+                result = read(0, tx_buffer, size);
+            } while ((-1 == result) && (EINTR == errno));
+            if (0 == result) {
+                // EOF, at an inopportune moment
+                exit(0);
+            }
+            if (result < size) {
+                fprintf(stderr, "rawether: error reading ethernet packet from I/O auxiliary\n"
+                        "Expected %d bytes but only read %d\n", size, result);
+                exit(1);
+            }
+
+            if (real_ether) {
+                real_handle_tx(tx_buffer, size);
+            } else if (ethertap) {
+                tap_handle_tx(tx_buffer, size);
+            }
+            break;
+        }
+      case SYNTH_ETH_START:
+        {
+            if (real_ether) {
+                real_handle_start(arg);
+            } else if (ethertap) {
+                tap_handle_start(arg);
+            }
+            break;
+        }
+
+      case SYNTH_ETH_STOP:
+        {
+            if (real_ether) {
+                real_handle_stop();
+            } else if (ethertap) {
+                tap_handle_stop();
+            }
+            break;
+        }
+
+      case SYNTH_ETH_MULTIALL:
+        {
+            if (real_ether) {
+                real_handle_multiall(arg);
+            } else if (ethertap) {
+                tap_handle_multiall(arg);
+            }
+            break;
+        }
+
+        // SYNTH_ETH_RX and SYNTH_ETH_GETPARAMS are handled inside ethernet.tcl
+        
+      default:
+        fprintf(stderr, "rawether: protocol violation, received unknown request %d\n", code);
+        exit(1);
+    }
+}
+
+// The main loop. This waits for an event either from ecosynth or from
+// the underlying ethernet device, using select. Requests from
+// ecosynth are handled, and take priority to prevent the connecting
+// pipe from filling up and ecosynth blocking. Incoming ethernet
+// frames are forwarded to ecosynth.
+
+static void
+mainloop(void)
+{
+    fd_set          read_set;
+    struct timeval  timeout;
+    int result;
+
+    for ( ; ; ) {
+        FD_ZERO(&read_set);
+        FD_SET(0, &read_set);
+        FD_SET(ether_fd, &read_set);
+        timeout.tv_sec  = 24 * 60 * 60;
+        timeout.tv_usec = 0;
+
+        result = select(ether_fd + 1, &read_set, NULL, NULL, &timeout);
+        if (result <= 0) {
+            continue;
+        }
+
+        if (FD_ISSET(0, &read_set)) {
+            handle_ecosynth_request();
+        } else if (FD_ISSET(ether_fd, &read_set)) {
+            if (real_ether) {
+                real_handle_rx();
+            } else {
+                tap_handle_rx();
+            }
+        }
+    }
+}
+
+// ----------------------------------------------------------------------------
+
+int
+main(int argc, char**argv)
+{
+    // Ignore incoming ctrl-C's. We are in the same process group as the
+    // eCos application which may sensibly be ctrl-C'd, but that should
+    // result in the auxiliary detecting EOF and closing the pipe to
+    // this process, which in turn causes this process to exit completely.
+    signal(SIGINT, SIG_IGN);
+    
+    if (2 > argc ) {
+        report_error("Expected at least one argument, \"real\" or \"ethertap\"\n");
+    }
+    if (0 == strcmp("real", argv[1])) {
+        real_ether = 1;
+        real_init(argv[2]);
+    } else if (0 == strcmp("ethertap", argv[1])) {
+        ethertap = 1;
+        tap_init(argc - 2, argv + 2);
+    } else {
+        snprintf(msg, MSG_SIZE, "Invalid argument %s, expected \"real\" or \"ethertap\"\n", argv[1]);
+        report_error(msg);
+    }
+
+    // If the device-specific initialization succeeded we must be set.
+    report_success();
+
+    mainloop();
+    
+    return 0;
+}
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/host/tonet.xbm
@@ -0,0 +1,4 @@
+#define tonet_width 8
+#define tonet_height 8
+static unsigned char tonet_bits[] = {
+   0x00, 0x87, 0x95, 0xa5, 0xfd, 0xa5, 0x95, 0x87};
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/src/protocol.h
@@ -0,0 +1,72 @@
+#ifndef CYGONCE_DEVS_ETH_ECOSYNTH_PROTOCOL_H
+#define CYGONCE_DEVS_ETH_ECOSYNTH_PROTOCOL_H
+
+//=============================================================================
+//
+//      protocol.h
+//
+//      Protocol between target-side and host-side ethernet support.
+//
+//=============================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting the
+// copyright holder(s).
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//=============================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):   bartv
+// Contributors:bartv
+// Date:        2002-08-08
+// Purpose:     Protocol definitions.
+// Usage:       #include "protocol.h"
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+// Transmit: no arguments, up to 1514 bytes of outgoing data, no reply expected.
+#define SYNTH_ETH_TX            0x01
+// Receive: no arguments or data, the return code indicates whether or not
+// there are more packets to follow, and the return data is up to 1514 bytes.
+#define SYNTH_ETH_RX            0x02
+// Start: one argument, non-zero -> promiscuous mode. No reply.
+#define SYNTH_ETH_START         0x03
+// Stop: no arguments or reply.
+#define SYNTH_ETH_STOP          0x04
+// Settings: no arguments or data. The return code holds the interrupt vector.
+// The return data is six bytes of MAC address, plus a single byte indicating
+// whether or not multicasting is supported. 
+#define SYNTH_ETH_GETPARAMS     0x05
+// Enable/disable multicasting. One argument, enable/disable.
+#define SYNTH_ETH_MULTIALL      0x06
+
+#endif  // CYGONCE_DEVS_ETH_ECOSYNTH_PROTOCOL.H
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/synth/ecosynth/current/src/syntheth.c
@@ -0,0 +1,453 @@
+//==========================================================================
+//
+//      syntheth.c
+//
+//      Network device driver for the synthetic target
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting the
+// copyright holder(s).
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    bartv
+// Contributors: bartv
+// Date:         2002-08-07
+//
+//####DESCRIPTIONEND####
+//==========================================================================
+
+#include <pkgconf/devs_eth_ecosynth.h>
+
+#include <cyg/infra/cyg_type.h>
+#include <cyg/infra/cyg_ass.h>
+#include <cyg/hal/hal_arch.h>
+#include <cyg/infra/diag.h>
+#include <cyg/hal/drv_api.h>
+
+#define __ECOS 1
+#include <sys/types.h>
+#include <cyg/io/eth/netdev.h>
+#include <cyg/io/eth/eth_drv.h>
+#include <cyg/io/eth/eth_drv_stats.h>
+
+#ifdef CYGPKG_NET
+# include <net/if.h>
+#else
+# define IFF_PROMISC 0
+#endif
+
+#include <cyg/hal/hal_io.h>
+#include "protocol.h"
+
+// ----------------------------------------------------------------------------
+// Device instances. The synthetic target ethernet package can support
+// up to four ethernet devices, eth0 to eth3. A synth_eth structure
+// holds the data that is specific to a given device. Each device
+// needs an instance of this structure, followed by ETH_DRV_SC and
+// NETDEVTAB_ENTRY macros. Another macro SYNTH_ETH_INSTANCE takes
+// care of all that, to avoid unnecessary duplication of code here.
+//
+// NOTE: unfortunately this involves duplicating the eth_hwr_funs
+// structure. This could be eliminated but it would require bypassing
+// the ETH_DRV_SC macro.
+
+#define ETHERNET_MINTU 14
+#define ETHERNET_MAXTU 1514
+
+
+typedef struct synth_eth {
+    int             synth_id;           // Device id within the auxiliary
+    int             up;                 // Has there been a call to start()?
+    int             in_send;            // Detect recursive calls
+    int             tx_done;
+    unsigned long   tx_key;             // Allow mbuf's to be freed
+    volatile int    rx_pending;         // There is pending data.
+    int             rx_len;             // Length of buffered data.
+    unsigned char   MAC[6];             // Obtained from the underlying ethernet device
+    cyg_vector_t    interrupt;          // Interrupt number allocated by the auxiliary
+    int             multi_supported;    // Does the driver support multicasting?
+    cyg_handle_t    interrupt_handle;   // Allow the ISR and DSR to be installed.
+    cyg_interrupt   interrupt_data;
+    unsigned char   tx_data[ETHERNET_MAXTU];
+    unsigned char   rx_data[ETHERNET_MAXTU];
+} synth_eth;
+
+#define SYNTH_ETH_INSTANCE( _number_)           \
+static synth_eth synth_eth##_number_ = {        \
+    synth_id:   -1,                             \
+    up:          1,                             \
+    in_send:     0,                             \
+    tx_done:     0,                             \
+    tx_key:      0L,                            \
+    rx_pending:  0,                             \
+    rx_len:      0,                             \
+    MAC:         { 0, 0, 0, 0, 0, 0 },          \
+    interrupt:   0,                             \
+    interrupt_handle: 0                         \
+};                                              \
+ETH_DRV_SC(synth_eth_sc##_number_,              \
+           (void*) &synth_eth##_number_,        \
+           "eth" #_number_,                     \
+           synth_eth_start,                     \
+           synth_eth_stop,                      \
+           synth_eth_ioctl,                     \
+           synth_eth_can_send,                  \
+           synth_eth_send,                      \
+           synth_eth_recv,                      \
+           synth_eth_deliver,                   \
+           synth_eth_poll,                      \
+           synth_eth_intvector);                \
+NETDEVTAB_ENTRY(synth_eth_netdev##_number_,     \
+                "synth_eth" #_number_,          \
+                synth_eth_init,                 \
+                &synth_eth_sc##_number_);
+
+#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH0
+SYNTH_ETH_INSTANCE(0);
+#endif
+#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH1
+SYNTH_ETH_INSTANCE(1);
+#endif
+#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH2
+SYNTH_ETH_INSTANCE(2);
+#endif
+#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH3
+SYNTH_ETH_INSTANCE(3);
+#endif
+
+// ----------------------------------------------------------------------------
+// Data transmits.
+//
+// The eCos application will just send the data to the auxiliary,
+// which will in turn pass it on to the rawether utility. There is no
+// need for any response. Flow control is implicit: if the eCos
+// application tries to send ethernet packets too quickly then those
+// get passed on to the auxiliary, which in turn will pass them on to
+// the rawether process. If rawether is still busy with the previous
+// packet then the auxiliary will block on a pipe write, and in turn
+// the eCos application will block. As long as rawether manages to
+// complete its operations reasonably quickly these blocks should not
+// be noticeable to the user.
+//
+// So can_send() should always return true for an interface that is up
+// and running. The send operation needs to take the sg list, turn it
+// into a single buffer, and transmit it to the auxiliary. At that
+// point the transmission is already complete so eth_drv_dsr() should
+// be called to call deliver() and release the buffer.
+//
+// However there are some complications. The first is polled operation,
+// where eth_drv_dsr() is a no-op and should not really be called at
+// all because there are no interrupts going off. The second is that
+// calling eth_drv_dsr() directly will cause recursive operation:
+// send() -> dsr -> can_send()/send() -> ...
+// This is a bad idea, so can_send() has to check that we are not
+// already inside a send(). Data transmission will proceed merrily
+// once the send has returned.
+
+static int
+synth_eth_can_send(struct eth_drv_sc* sc)
+{
+    synth_eth*  eth = (synth_eth*)(sc->driver_private);
+    return synth_auxiliary_running && eth->up && !eth->in_send && !eth->tx_done;
+}
+
+static void
+synth_eth_send(struct eth_drv_sc* sc,
+               struct eth_drv_sg* sg_list, int sg_len, int total_len,
+               unsigned long key)
+{
+    synth_eth*  eth = (synth_eth*)(sc->driver_private);
+
+    CYG_PRECONDITION((total_len >= ETHERNET_MINTU) && (total_len <= ETHERNET_MAXTU), "Only normal-sized ethernet packets are supported");
+    CYG_PRECONDITION(!eth->in_send && !eth->tx_done, "Ethernet device must not still be in use for transmits");
+
+    eth->in_send = 1;
+    eth->tx_key  = key;
+    if (synth_auxiliary_running && eth->up) {
+        int i;
+        unsigned char* buf = eth->tx_data;
+        for (i = 0; i < sg_len; i++) {
+            memcpy(buf, (void*) sg_list[i].buf, sg_list[i].len);
+            buf += sg_list[i].len;
+            CYG_LOOP_INVARIANT(buf <= &(eth->tx_data[ETHERNET_MAXTU]), "sg list must not exceed ethernet MTU");
+        }
+        CYG_POSTCONDITION(buf == &(eth->tx_data[total_len]), "sg list lengths should match total_len");
+
+        synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_TX, 0, 0, eth->tx_data, total_len,
+                                (void*) 0, (unsigned char*)0, (int*)0, 0);
+    }
+
+    // The transfer has now completed, one way or another, so inform
+    // the higher-level code immediately.
+    eth->tx_done = 1;
+    eth_drv_dsr(eth->interrupt, 0, (cyg_addrword_t) sc);
+    eth->in_send = 0;
+}
+
+// ----------------------------------------------------------------------------
+// Receives.
+//
+// These are rather more complicated because there are real interrupts
+// involved, and polling needs to be supported as well. The actual
+// transfer of data from auxiliary to eCos happens inside deliver(),
+// and the data is buffered up in the synth_eth structure. All that
+// needs to be done here is scatter the existing data into the
+// sg_list. If higher-level code has run out of space then the
+// sg_list may contain null pointers.
+
+static void
+synth_eth_recv(struct eth_drv_sc* sc, struct eth_drv_sg* sg_list, int sg_len)
+{
+    synth_eth*      eth     = (synth_eth*)(sc->driver_private);
+    unsigned char*  buf     = eth->rx_data;
+    int             len     = eth->rx_len;
+    int             i;
+
+    for (i = 0; i < sg_len; i++) {
+        if (0 == sg_list[i].buf) {
+            break;
+        } else if (len <= sg_list[i].len) {
+            memcpy((void*)sg_list[i].buf, buf, len);
+            break;
+        } else {
+            memcpy((void*)sg_list[i].buf, buf, sg_list[i].len);
+            buf += sg_list[i].len;
+            len -= sg_list[i].len;
+        }
+    }
+}
+
+// The ISR does not have to do anything, the DSR does the real work.
+static cyg_uint32
+synth_eth_isr(cyg_vector_t vector, cyg_addrword_t data)
+{
+    cyg_drv_interrupt_acknowledge(vector);
+    return CYG_ISR_CALL_DSR;
+}
+
+// The DSR also does not have to do very much. The data argument is
+// actually the eth_drv_sc structure, which must match the vector.
+// Interrupts only go off when there are pending receives, so set the
+// rx_pending flag and call the generic DSR to do the real work.
+static void
+synth_eth_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data)
+{
+    struct eth_drv_sc* sc = (struct eth_drv_sc*) data;
+    synth_eth* eth        = (synth_eth*)(sc->driver_private);
+    CYG_ASSERT(eth->interrupt == vector, "Interrupt vectors cannot change during a run");
+
+    eth->rx_pending = 1;
+    eth_drv_dsr(vector, count, data);
+}
+
+// ----------------------------------------------------------------------------
+// Delivery. This is invoked by a thread inside the TCP/IP stack, or by
+// the poll function.
+static void
+synth_eth_deliver(struct eth_drv_sc* sc)
+{
+    synth_eth* eth = (synth_eth*)(sc->driver_private);
+
+    if (eth->tx_done) {
+        eth->tx_done = 0;
+        (*sc->funs->eth_drv->tx_done)(sc, eth->tx_key, 1);
+    }
+    while (eth->rx_pending) {
+        int more = 1;
+        eth->rx_pending = 0;
+
+        while (more && eth->up && synth_auxiliary_running) {
+            synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_RX, 0, 0, (void*) 0, 0,
+                                    &more, eth->rx_data, &(eth->rx_len), ETHERNET_MAXTU);
+            CYG_LOOP_INVARIANT(!more || (0 != eth->rx_len), "Auxiliary must send at least one packet if several are available");
+            if (eth->rx_len > 0) {
+                CYG_ASSERT((eth->rx_len >= ETHERNET_MINTU) && (eth->rx_len <= ETHERNET_MAXTU), "Only normal-sized ethernet packets are supported");
+                // Inform higher-level code that data is available.
+                // This should result in a call to recv() with a
+                // suitable sg_list. If out of memory, recv()
+                // will see a null pointer.
+                (*sc->funs->eth_drv->recv)(sc, eth->rx_len);
+            }
+        };
+    }
+}
+
+
+// ----------------------------------------------------------------------------
+// Polling support. Transmits are relatively straightforward because
+// all the hard work is handled by send(). Receives are rather more
+// complicated because interrupts are disabled so we never know when
+// there is really pending data. However deliver() will do the right
+// thing even if there is no data, so simply faking up an interrupt
+// is enough. This does mean extra traffic between application and
+// auxiliary, but polling does rather imply that.
+static void
+synth_eth_poll(struct eth_drv_sc* sc)
+{
+    synth_eth* eth = (synth_eth*)(sc->driver_private);
+    if (synth_auxiliary_running && eth->up) {
+        eth->rx_pending = 1;
+    }
+    synth_eth_deliver(sc);
+}
+
+static int
+synth_eth_intvector(struct eth_drv_sc* sc)
+{
+    synth_eth* eth = (synth_eth*)(sc->driver_private);
+    return eth->interrupt;
+}
+
+// ----------------------------------------------------------------------------
+// ioctl()'s.
+//
+// SET_MAC_ADDRESS is not currently implemented, and probably should
+// not be implemented because the underlying ethernet device may not
+// support it.
+//
+// SET_MC_ALL is supported if the underlying hardware does. This is
+// needed for IPV6 support. More selective multicasting via
+// SET_MC_LIST is not supported, because it imposes too heavy a
+// requirement on the underlying Linux device. SET_MC_LIST can be
+// used to disable multicast support.
+//
+// GET_IF_STATS_UD and GET_IF_STATS are not currently implemented
+static int
+synth_eth_ioctl(struct eth_drv_sc* sc, unsigned long key, void* data, int data_length)
+{
+    synth_eth* eth = (synth_eth*)(sc->driver_private);
+    int result = EINVAL;
+    
+    switch(key) {
+      case ETH_DRV_SET_MC_ALL:
+        {
+            if (eth->multi_supported) {
+                synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_MULTIALL, 1, 0, (unsigned char*) 0, 0,
+                                       (void*)0, (unsigned char*)0, (int*)0, 0);
+                result = 0;
+            }
+            break;
+        }
+      case ETH_DRV_SET_MC_LIST:
+        {
+            struct eth_drv_mc_list* mcl = (struct eth_drv_mc_list*) data;
+            if (eth->multi_supported && (0 == mcl->len)) {
+                synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_MULTIALL, 0, 0, (unsigned char*) 0, 0,
+                                       (void*)0, (unsigned char*)0, (int*)0, 0);
+                result = 0;
+            }
+            break;
+        }
+      default:
+        break;
+    }
+    
+    return result;
+}
+
+// ----------------------------------------------------------------------------
+// Starting and stopping an interface. This includes restarting in
+// promiscuous mode.
+static void
+synth_eth_start(struct eth_drv_sc* sc, unsigned char* enaddr, int flags)
+{
+    synth_eth* eth = (synth_eth*)(sc->driver_private);
+
+    eth->up         = 0;
+    eth->rx_pending = 0;
+    
+    if ((-1 != eth->synth_id) && synth_auxiliary_running) {
+        synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_START, flags & IFF_PROMISC, 0, (void*) 0, 0,
+                                (int*)0, (void*) 0, (int*) 0, 0);
+    }
+    eth->up = 1;
+    if (enaddr != (unsigned char*)0) {
+        memcpy(enaddr, eth->MAC, 6);
+    }
+}
+
+static void
+synth_eth_stop(struct eth_drv_sc* sc)
+{
+    synth_eth* eth = (synth_eth*)(sc->driver_private);
+
+    eth->up         = 0;
+    if ((-1 != eth->synth_id) && synth_auxiliary_running) {
+        synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_STOP, 0, 0, (void*) 0, 0,
+                                (int*) 0, (void*) 0, (int*) 0, 0);
+    }
+    eth->rx_pending = 0;
+}
+
+
+// ----------------------------------------------------------------------------
+// Initialization.
+//
+// This requires instantiating a device of class ethernet with a specific
+// device name held in the eth_drv_sc structure. No additional device data
+// is needed. If a device can be instantiated then the interrupt vector
+// and the MAC address can be obtained, and an interrupt handler can be
+// installed.
+static bool
+synth_eth_init(struct cyg_netdevtab_entry* ndp)
+{
+    bool result = false;
+    struct eth_drv_sc* sc   = (struct eth_drv_sc*)(ndp->device_instance);
+    struct synth_eth*  eth  = (struct synth_eth*)(sc->driver_private);
+
+    if (synth_auxiliary_running) {
+        eth->synth_id = synth_auxiliary_instantiate("devs/eth/synth/ecosynth", SYNTH_MAKESTRING(CYGPKG_DEVS_ETH_ECOSYNTH), "ethernet",
+                                                    sc->dev_name, (const char*) 0);
+        
+        if (-1 != eth->synth_id) {
+            unsigned char data[7];
+            result = true;
+            synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_GETPARAMS, 0, 0, (const unsigned char*) 0, 0,
+                                    &(eth->interrupt), data, 0, 7);
+            memcpy(eth->MAC, data, 6);
+            eth->multi_supported = data[6];
+            cyg_drv_interrupt_create(eth->interrupt,
+                                     0,
+                                     (CYG_ADDRWORD) sc,
+                                     &synth_eth_isr,
+                                     &synth_eth_dsr,
+                                     &(eth->interrupt_handle),
+                                     &(eth->interrupt_data));
+            cyg_drv_interrupt_attach(eth->interrupt_handle);
+            cyg_drv_interrupt_unmask(eth->interrupt);
+        }
+    }
+    (*sc->funs->eth_drv->init)(sc, eth->MAC);
+    return result;
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/ChangeLog
@@ -0,0 +1,36 @@
+2002-09-04  Bart Veer  <bartv@ecoscentric.com>
+
+	* Synthetic target watchdog package created
+
+//===========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/cdl/synth_watchdog.cdl
@@ -0,0 +1,108 @@
+# ====================================================================
+#
+#      synth_watchdog.cdl
+#
+#      Synthetic target watchdog package.
+#
+# ====================================================================
+#####ECOSGPLCOPYRIGHTBEGIN####
+## -------------------------------------------
+## This file is part of eCos, the Embedded Configurable Operating System.
+## Copyright (C) 2002 Bart Veer
+##
+## eCos is free software; you can redistribute it and/or modify it under
+## the terms of the GNU General Public License as published by the Free
+## Software Foundation; either version 2 or (at your option) any later version.
+##
+## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+## WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with eCos; if not, write to the Free Software Foundation, Inc.,
+## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+##
+## As a special exception, if other files instantiate templates or use macros
+## or inline functions from this file, or you compile this file and link it
+## with other works to produce a work based on this file, this file does not
+## by itself cause the resulting work to be covered by the GNU General Public
+## License. However the source code for this file must still be made available
+## in accordance with section (3) of the GNU General Public License.
+##
+## This exception does not invalidate any other reasons why a work based on
+## this file might be covered by the GNU General Public License.
+##
+## Alternative licenses for eCos may be arranged by contacting the
+## copyright holder(s).
+## -------------------------------------------
+#####ECOSGPLCOPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      bartv
+# Original data:  bartv
+# Contributors:
+# Date:           2002-08-07
+#
+#####DESCRIPTIONEND####
+# ====================================================================
+
+cdl_package CYGPKG_DEVS_WATCHDOG_SYNTH {
+    display     "Synthetic target watchdog support"
+    description "
+        The watchdog driver for the eCos synthetic target provides
+        emulation of a watchdog device: if the eCos application starts
+        the watchdog and fails to reset it regularly then the host-side
+        support will detect this and kill the eCos application with a
+        SIGPWR signal."
+    
+    parent      CYGPKG_IO_WATCHDOG
+    implements  CYGINT_WATCHDOG_HW_IMPLEMENTATIONS
+    implements  CYGINT_WATCHDOG_RESETS_ON_TIMEOUT
+
+    cdl_option CYGIMP_WATCHDOG_HARDWARE {
+	parent        CYGPKG_IO_WATCHDOG_IMPLEMENTATION
+	display       "use \"hardware\" watchdog"
+	default_value 1
+	implements    CYGINT_WATCHDOG_IMPLEMENTATIONS
+	compile	      synth_watchdog.cxx
+	description "
+            eCos provides several implementations of a watchdog device.
+            The default is to use the \"hardware\" implementation, which
+            for the synthetic target involves interacting with a
+            watchdog.tcl script running inside the I/O auxiliary."
+    }
+    
+    cdl_component CYGPKG_DEVS_WATCHDOG_SYNTH_OPTIONS {
+	display     "Build options"
+	active_if   CYGIMP_WATCHDOG_HARDWARE
+	flavor      none
+
+	description "
+	    Package-specific build options including control over compiler
+	    flags used only in building this package."
+
+	cdl_option CYGPKG_DEVS_WATCHDOG_SYNTH_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building this package. These flags are used in addition
+                to the set of global flags."
+	}
+        cdl_option CYGPKG_DEVS_WATCHDOG_SYNTH_CFLAGS_REMOVE {
+            display "Suppressed compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building this package. These flags are removed from
+                the set of global flags if present."
+        }
+    }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..738290f78f857fe3c8af532d77fb8953216e334f
GIT binary patch
literal 19131
zc$}qsd0bOx+V;sx0s%r;3=lLdfe66{5-^~36862IRzYYRwy+l2w6(Qu2oZ=x$|gpP
z4j{F5ik8I<+vx;|hzbl+i)gh4UPRkktF_ay)0xb7KPPBA@63Gvy#Dq4PC}k5*K*(Y
zb8?K1jgo|9zJtAk{q>(1iAbbT$ySzBD{D&&nuWzm8*2w^x(ma?$%^4<M|ZQc;H+@4
zqB_{nTx@7;I@#Wy;bL#)>}<<&vU6~@cXhSrtaMx9;_SN8oyxVf^0A?MIZ}MxtOfRT
zPqvlFmE&*2_HnWgvUPgi#$^M8C1Tl!+LQe~h<-j4p*Kk^pa*cVU=bFwmar}qTl>5d
zkLMf|%wv$fttsAimaFZp{G4rgY->+9)@nC9PZze3W6O1Q=lNOlJRH3|Tzz>?e%|ag
ztDSv(9lb<0J|Q+dv7N7&wR$Z(fafUkTOks-gsgF0D|8DDa0>`@dft=n>+k2|>%$iW
z_yq`jgCrt<k6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3?PebEGZ#F-llyGA0k8istw5ctM7)fZrY^0+>uwp|k2;<}BPd5f8iG+b
W(}p||jI>)VVj6ziI)y^Ug8m;qr8Ud|
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/doc/devs-watchdog-synth.html
@@ -0,0 +1,526 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Synthetic Target Watchdog Device</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><H1
+><A
+NAME="DEVS-WATCHDOG-SYNTH">Synthetic Target Watchdog Device</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4"
+></A
+><H2
+>Name</H2
+>Synthetic Target Watchdog Device&nbsp;--&nbsp;Emulate watchdog hardware in the synthetic target</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7"
+></A
+><H2
+>Overview</H2
+><P
+>Some target hardware comes equipped with a watchdog timer. Application
+code can start this timer and after a certain period of time,
+typically a second, the watchdog will trigger. Usually this causes the
+hardware to reboot. The application can prevent this by regularly
+resetting the watchdog. An automatic reboot can be very useful when
+deploying hardware in the field: a hardware glitch could cause the
+unit to hang; or the software could receive an unexpected sequence of
+inputs, never seen in the laboratory, causing the system to lock up.
+Often the hardware is still functional, and a reboot sorts out the
+problem with only a brief interruption in service.
+    </P
+><P
+>The synthetic target watchdog package emulates watchdog hardware.
+During system initialization watchdog device will be instantiated,
+and the <TT
+CLASS="FILENAME"
+>watchdog.tcl</TT
+> script will be loaded by the
+I/O auxiliary. When the eCos application starts the watchdog device,
+the <TT
+CLASS="FILENAME"
+>watchdog.tcl</TT
+> script will start checking the
+state of the eCos application at one second intervals. A watchdog
+reset call simply involves a message to the I/O auxiliary. If the
+<TT
+CLASS="FILENAME"
+>watchdog.tcl</TT
+> script detects that a second has
+<A
+HREF="devs-watchdog-synth.html#SYNTH-WATCHDOG-WALLCLOCK-ELAPSED"
+>elapsed</A
+>
+without a reset then it will send a <TT
+CLASS="LITERAL"
+>SIGPWR</TT
+> signal
+to the eCos application, causing the latter to terminate. If gdb is
+being used to run the application, the user will get a chance to
+investigate what is happening. This behaviour is different from real
+hardware in that there is no automatic reboot, but the synthetic
+target is used only for development purposes, not deployment in the
+field: if a reboot is desired then this can be achieved very easily
+by using gdb commands to run another instance of the application.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-WATCHDOG-SYNTH-INSTALL"
+></A
+><H2
+>Installation</H2
+><P
+>Before a synthetic target eCos application can use a watchdog device
+it is necessary to build and install host-side support. The relevant
+code resides in the <TT
+CLASS="FILENAME"
+>host</TT
+>
+subdirectory of the synthetic target watchdog package, and building it
+involves the standard <B
+CLASS="COMMAND"
+>configure</B
+>,
+<B
+CLASS="COMMAND"
+>make</B
+> and <B
+CLASS="COMMAND"
+>make install</B
+> steps. The
+implementation of the watchdog support does not require any
+executables, just a Tcl script <TT
+CLASS="FILENAME"
+>watchdog.tcl</TT
+> and
+some support files, so the <B
+CLASS="COMMAND"
+>make</B
+> step is a no-op.
+    </P
+><P
+>There are two main ways of building the host-side software. It is
+possible to build both the generic host-side software and all
+package-specific host-side software, including the watchdog support,
+in a single build tree. This involves using the
+<B
+CLASS="COMMAND"
+>configure</B
+> script at the toplevel of the eCos
+repository. For more information on this, see the
+<TT
+CLASS="FILENAME"
+>README.host</TT
+> file at the top of the repository.
+Note that if you have an existing build tree which does not include
+the synthetic target watchdog support then it will be necessary to
+rerun the toplevel configure script: the search for appropriate
+packages happens at configure time.
+    </P
+><P
+>The alternative is to build just the host-side for this package.
+This requires a separate build directory, building directly in the
+source tree is disallowed. The <B
+CLASS="COMMAND"
+>configure</B
+> options
+are much the same as for a build from the toplevel, and the
+<TT
+CLASS="FILENAME"
+>README.host</TT
+> file can be consulted for more
+details. It is essential that the watchdog support be configured with
+the same <TT
+CLASS="OPTION"
+>--prefix</TT
+> option as other eCos host-side
+software, especially the I/O auxiliary provided by the architectural
+synthetic target HAL package, otherwise the I/O auxiliary will be
+unable to locate the watchdog support.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-WATCHDOG-TARGET-CONFIG"
+></A
+><H2
+>Target-side
+Configuration</H2
+><P
+>The watchdog device depends on the generic watchdog support,
+<TT
+CLASS="VARNAME"
+>CYGPKG_IO_WATCHDOG</TT
+>: if the generic support is
+absent then the watchdog device will be inactive. Some templates
+include this generic package by default, but not all. If the
+configuration does not include the generic package then it can be
+added using the eCos configuration tools, for example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ ecosconfig add CYGPKG_IO_WATCHDOG</PRE
+></TD
+></TR
+></TABLE
+><P
+>By default the configuration will use the hardware-specific support,
+i.e. this package. However the generic watchdog package contains an
+alternative implementation using the kernel alarm facility, and that
+implementation can be selected if desired. However usually it will be
+better to rely on an external watchdog facility as provided by the I/O
+auxiliary and the <TT
+CLASS="FILENAME"
+>watchdog.tcl</TT
+> script: if there
+are serious problems within the application, for example memory
+corruption, then an internal software-only implementation will not be
+reliable.
+    </P
+><P
+>The watchdog resolution is currently fixed to one second: if the
+device does not receive a reset signal at least once a second then
+the watchdog will trigger and the eCos application will be terminated
+with a <TT
+CLASS="LITERAL"
+>SIGPWR</TT
+> signal. The current implementation
+does not allow this resolution to be changed.
+    </P
+><P
+>On some targets the watchdog device does not perform a hard reset.
+Instead the device works more or less via the interrupt subsystem,
+allowing application code to install action routines that will be
+called when the watchdog triggers. The synthetic target watchdog
+support effectively does perform a hard reset, by sending a
+<TT
+CLASS="LITERAL"
+>SIGPWR</TT
+> signal to the eCos application, and there is
+no support for action routines.
+    </P
+><P
+>The synthetic target watchdog package provides some configuration
+options for manipulating the compiler flags used for building the
+target-side code. That code is fairly simple, so for nearly all
+applications the default flags will suffice.
+    </P
+><P
+>It should be noted that the watchdog device is subject to selective
+linking. Unless some code explicitly references the device, for
+example by calling the start and reset functions, the watchdog support
+will not appear in the final executable. This is desirable because a
+watchdog device has no effect until started.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-WATCHDOG-WALLCLOCK-ELAPSED"
+></A
+><H2
+>Wallclock versus Elapsed Time</H2
+><P
+>On real hardware the watchdog device uses wallclock time: if the
+device does not receive a reset signal within a set period of time
+then the watchdog will trigger. When developing for the synthetic
+target this is not always appropriate. There may be other processes
+running, using up some or most of the cpu time. For example, the
+application may be written such that it will issue a reset after some
+calculations which are known to complete within half a second, well
+within the one-second resolution of the watchdog device. However if
+other Linux processes are running then the synthetic target
+application may get timesliced, and half a second of computation may
+take several seconds of wallclock time.
+    </P
+><P
+>Another problem with using wallclock time is that it interferes with
+debugging: if the application hits a breakpoint then it is unlikely
+that the user will manage to restart it in less than a second, and the
+watchdog will not get reset in time.
+    </P
+><P
+>To avoid these problems the synthetic target watchdog normally uses
+consumed cpu time rather than wallclock time. If the application is
+timesliced or if it is halted inside gdb then it does not consume any
+cpu time. The application actually has to spend a whole second's worth
+of cpu cycles without issuing a reset before the watchdog triggers.
+    </P
+><P
+>However using consumed cpu time is not a perfect solution either. If
+the application makes blocking system calls then it is not using cpu
+time. Interaction with the I/O auxiliary involves system calls, but
+these should take only a short amount of time so their effects can be
+ignored. If the application makes direct system calls such as
+<TT
+CLASS="FUNCTION"
+>cyg_hal_sys_read</TT
+> then the system behaviour
+becomes undefined. In addition by default the idle thread will make
+blocking <TT
+CLASS="FUNCTION"
+>select</TT
+> system calls, effectively waiting
+until an interrupt occurs. If an application spends much of its time
+idle then the watchdog device may take much longer to trigger than
+expected. It may be desirable to enable the synthetic target HAL
+configuration option <TT
+CLASS="VARNAME"
+>CYGIMP_HAL_IDLE_THREAD_SPIN</TT
+>,
+causing the idle thread to spin rather than block, at the cost of
+wasted cpu cycles.
+    </P
+><P
+>The default is to use consumed cpu time, but this can be changed in
+the target definition file:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device watchdog {
+    use wallclock_time
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-WATCHDOG-GUI"
+></A
+><H2
+>User Interface</H2
+><P
+>When the synthetic target is run in graphical mode the watchdog device
+extends the user interface in two ways. The <SPAN
+CLASS="GUIMENU"
+>Help</SPAN
+>
+menu is extended with an entry for the watchdog-specific
+documentation. There is also a graphical display of the current state
+of the watchdog. Initially the watchdog is asleep:
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN60"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="asleep.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>When application code starts the device the watchdog will begin to
+keep an eye on things (or occasionally both eyes).
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN65"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="awake.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>If the watchdog triggers the display will change again, and optionally
+the user can receive an audible alert. The location of the watchdog
+display within the I/O auxiliary's window can be controlled via
+a <B
+CLASS="COMMAND"
+>watchdog_pack</B
+> entry in the target definition
+file. For example the following can be used to put the watchdog
+display to the right of the central text window:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device watchdog {
+    watchdog_pack -in .main.e -side top
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The user interface section of the generic synthetic target HAL
+documentation can be consulted for more information on window packing.
+    </P
+><P
+>By default the watchdog support will not generate an audible alert
+when the watchdog triggers, to avoid annoying colleagues. Sound can be
+enabled in the target definition file, and two suitable files
+<TT
+CLASS="FILENAME"
+>sound1.au</TT
+> and <TT
+CLASS="FILENAME"
+>sound2.au</TT
+> are
+supplied as standard:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device watchdog {
+    sound sound1.au
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>An absolute path can be specified if desired:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device watchdog {
+    sound /usr/share/emacs/site-lisp/emacspeak/sounds/default-8k/alarm.au
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>Sound facilities are not built into the I/O auxiliary itself, instead
+an external program is used. The default player is
+<B
+CLASS="COMMAND"
+>play</B
+>, a front-end to the
+<SPAN
+CLASS="APPLICATION"
+>sox</SPAN
+> application shipped with some Linux
+distributions. If another player should be used then this can be
+specified in the target definition file:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device watchdog {
+    &#8230;
+    sound_player my_sound_player</PRE
+></TD
+></TR
+></TABLE
+><P
+>The specified program will be run in the background with a single
+argument, the sound file.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-WATCHDOG-SYNTH-ARGS"
+></A
+><H2
+>Command Line Arguments</H2
+><P
+>The watchdog support does not use any command line arguments. All
+configuration is handled through the target definition file.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-WATCHDOG-SYNTH-HOOKS"
+></A
+><H2
+>Hooks</H2
+><P
+>The watchdog support does not provide any hooks for use by other
+scripts. There is rarely any need for customizing the system's
+behaviour when a watchdog triggers because those should be rare
+events, even during application development.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="DEVS-WATCHDOG-SYNTH-TCL"
+></A
+><H2
+>Additional Tcl Procedures</H2
+><P
+>The watchdog support does not provide any additional Tcl procedures or
+variables for use by other scripts.
+    </P
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/doc/makefile
@@ -0,0 +1,34 @@
+#=============================================================================
+#
+#    makefile
+#
+#    For building the synthetic target watchdog package documentation
+#
+#=============================================================================
+#####COPYRIGHTBEGIN####
+#                                                                          
+# ===============================================================
+# Copyright (C) 2002 Bart Veer
+# This material may be distributed only subject to the terms
+# and conditions set forth in the Open Publication License, v1.0
+# or later (the latest version is presently available at
+# http://www.opencontent.org/openpub/)
+# ===============================================================
+#                                                                          
+#####COPYRIGHTEND####
+#=============================================================================
+#####DESCRIPTIONBEGIN####
+#
+# Author(s):     bartv
+# Date:          2002-09-09
+#####DESCRIPTIONEND####
+#=============================================================================
+
+TOPLEVEL   := ../../../../..
+MAIN_SGML  := synth_watchdog.sgml
+MAIN_HTML  := devs-watchdog-synth.html
+MAIN_PDF   := devs-watchdog-synth.pdf
+OTHER_SGML :=
+PICTURES   :=
+
+include $(TOPLEVEL)/pkgconf/rules.doc
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml
@@ -0,0 +1,336 @@
+<!DOCTYPE refentry  PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
+
+<!-- {{{ Banner                         -->
+
+<!-- =============================================================== -->
+<!--                                                                 -->
+<!--     synth_watchdog.sgml                                         -->
+<!--                                                                 -->
+<!--     Synthetic target watchdog device                            -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+<!-- ####COPYRIGHTBEGIN####                                          -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+<!-- Copyright (C) 2002 Bart Veer                                    -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- =============================================================== -->
+<!--                                                                 -->      
+<!-- ####COPYRIGHTEND####                                            -->
+<!-- =============================================================== -->
+<!-- #####DESCRIPTIONBEGIN####                                       -->
+<!--                                                                 -->
+<!-- Author(s):   bartv                                              -->
+<!-- Contact(s):  bartv                                              -->
+<!-- Date:        2002/09/09                                         -->
+<!-- Version:     0.01                                               -->
+<!--                                                                 -->
+<!-- ####DESCRIPTIONEND####                                          -->
+<!-- =============================================================== -->
+
+<!-- }}} -->
+
+<refentry id="devs-watchdog-synth">
+  <refmeta>
+    <refentrytitle>Synthetic Target Watchdog Device</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>Synthetic Target Watchdog Device</refname>
+    <refpurpose>Emulate watchdog hardware in the synthetic target</refpurpose> 
+  </refnamediv>
+
+  <refsect1><title>Overview</title>
+    <para>
+Some target hardware comes equipped with a watchdog timer. Application
+code can start this timer and after a certain period of time,
+typically a second, the watchdog will trigger. Usually this causes the
+hardware to reboot. The application can prevent this by regularly
+resetting the watchdog. An automatic reboot can be very useful when
+deploying hardware in the field: a hardware glitch could cause the
+unit to hang; or the software could receive an unexpected sequence of
+inputs, never seen in the laboratory, causing the system to lock up.
+Often the hardware is still functional, and a reboot sorts out the
+problem with only a brief interruption in service.
+    </para>
+    <para>
+The synthetic target watchdog package emulates watchdog hardware.
+During system initialization watchdog device will be instantiated,
+and the <filename>watchdog.tcl</filename> script will be loaded by the
+I/O auxiliary. When the eCos application starts the watchdog device,
+the <filename>watchdog.tcl</filename> script will start checking the
+state of the eCos application at one second intervals. A watchdog
+reset call simply involves a message to the I/O auxiliary. If the
+<filename>watchdog.tcl</filename> script detects that a second has
+<link linkend="synth-watchdog-wallclock-elapsed">elapsed</link>
+without a reset then it will send a <literal>SIGPWR</literal> signal
+to the eCos application, causing the latter to terminate. If gdb is
+being used to run the application, the user will get a chance to
+investigate what is happening. This behaviour is different from real
+hardware in that there is no automatic reboot, but the synthetic
+target is used only for development purposes, not deployment in the
+field: if a reboot is desired then this can be achieved very easily
+by using gdb commands to run another instance of the application.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-watchdog-synth-install"><title>Installation</title>
+    <para>
+Before a synthetic target eCos application can use a watchdog device
+it is necessary to build and install host-side support. The relevant
+code resides in the <filename class="directory">host</filename>
+subdirectory of the synthetic target watchdog package, and building it
+involves the standard <command>configure</command>,
+<command>make</command> and <command>make install</command> steps. The
+implementation of the watchdog support does not require any
+executables, just a Tcl script <filename>watchdog.tcl</filename> and
+some support files, so the <command>make</command> step is a no-op.
+    </para>
+    <para>
+There are two main ways of building the host-side software. It is
+possible to build both the generic host-side software and all
+package-specific host-side software, including the watchdog support,
+in a single build tree. This involves using the
+<command>configure</command> script at the toplevel of the eCos
+repository. For more information on this, see the
+<filename>README.host</filename> file at the top of the repository.
+Note that if you have an existing build tree which does not include
+the synthetic target watchdog support then it will be necessary to
+rerun the toplevel configure script: the search for appropriate
+packages happens at configure time.
+    </para>
+    <para>
+The alternative is to build just the host-side for this package.
+This requires a separate build directory, building directly in the
+source tree is disallowed. The <command>configure</command> options
+are much the same as for a build from the toplevel, and the
+<filename>README.host</filename> file can be consulted for more
+details. It is essential that the watchdog support be configured with
+the same <option>--prefix</option> option as other eCos host-side
+software, especially the I/O auxiliary provided by the architectural
+synthetic target HAL package, otherwise the I/O auxiliary will be
+unable to locate the watchdog support.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-watchdog-target-config"><title>Target-side
+Configuration</title>
+    <para>
+The watchdog device depends on the generic watchdog support,
+<varname>CYGPKG_IO_WATCHDOG</varname>: if the generic support is
+absent then the watchdog device will be inactive. Some templates
+include this generic package by default, but not all. If the
+configuration does not include the generic package then it can be
+added using the eCos configuration tools, for example:
+    </para>
+    <screen>
+$ ecosconfig add CYGPKG_IO_WATCHDOG
+</screen>
+    <para>
+By default the configuration will use the hardware-specific support,
+i.e. this package. However the generic watchdog package contains an
+alternative implementation using the kernel alarm facility, and that
+implementation can be selected if desired. However usually it will be
+better to rely on an external watchdog facility as provided by the I/O
+auxiliary and the <filename>watchdog.tcl</filename> script: if there
+are serious problems within the application, for example memory
+corruption, then an internal software-only implementation will not be
+reliable.
+    </para>
+    <para>
+The watchdog resolution is currently fixed to one second: if the
+device does not receive a reset signal at least once a second then
+the watchdog will trigger and the eCos application will be terminated
+with a <literal>SIGPWR</literal> signal. The current implementation
+does not allow this resolution to be changed.
+    </para>
+    <para>
+On some targets the watchdog device does not perform a hard reset.
+Instead the device works more or less via the interrupt subsystem,
+allowing application code to install action routines that will be
+called when the watchdog triggers. The synthetic target watchdog
+support effectively does perform a hard reset, by sending a
+<literal>SIGPWR</literal> signal to the eCos application, and there is
+no support for action routines.
+    </para>
+    <para>
+The synthetic target watchdog package provides some configuration
+options for manipulating the compiler flags used for building the
+target-side code. That code is fairly simple, so for nearly all
+applications the default flags will suffice.
+    </para>
+    <para>
+It should be noted that the watchdog device is subject to selective
+linking. Unless some code explicitly references the device, for
+example by calling the start and reset functions, the watchdog support
+will not appear in the final executable. This is desirable because a
+watchdog device has no effect until started.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-watchdog-wallclock-elapsed"><title>Wallclock versus Elapsed Time</title>
+    <para>
+On real hardware the watchdog device uses wallclock time: if the
+device does not receive a reset signal within a set period of time
+then the watchdog will trigger. When developing for the synthetic
+target this is not always appropriate. There may be other processes
+running, using up some or most of the cpu time. For example, the
+application may be written such that it will issue a reset after some
+calculations which are known to complete within half a second, well
+within the one-second resolution of the watchdog device. However if
+other Linux processes are running then the synthetic target
+application may get timesliced, and half a second of computation may
+take several seconds of wallclock time.
+    </para>
+    <para>
+Another problem with using wallclock time is that it interferes with
+debugging: if the application hits a breakpoint then it is unlikely
+that the user will manage to restart it in less than a second, and the
+watchdog will not get reset in time.
+    </para>
+    <para>
+To avoid these problems the synthetic target watchdog normally uses
+consumed cpu time rather than wallclock time. If the application is
+timesliced or if it is halted inside gdb then it does not consume any
+cpu time. The application actually has to spend a whole second's worth
+of cpu cycles without issuing a reset before the watchdog triggers.
+    </para>
+    <para>
+However using consumed cpu time is not a perfect solution either. If
+the application makes blocking system calls then it is not using cpu
+time. Interaction with the I/O auxiliary involves system calls, but
+these should take only a short amount of time so their effects can be
+ignored. If the application makes direct system calls such as
+<function>cyg_hal_sys_read</function> then the system behaviour
+becomes undefined. In addition by default the idle thread will make
+blocking <function>select</function> system calls, effectively waiting
+until an interrupt occurs. If an application spends much of its time
+idle then the watchdog device may take much longer to trigger than
+expected. It may be desirable to enable the synthetic target HAL
+configuration option <varname>CYGIMP_HAL_IDLE_THREAD_SPIN</varname>,
+causing the idle thread to spin rather than block, at the cost of
+wasted cpu cycles.
+    </para>
+    <para>
+The default is to use consumed cpu time, but this can be changed in
+the target definition file:
+    </para>
+    <programlisting>
+synth_device watchdog {
+    use wallclock_time
+    &hellip;
+}
+</programlisting>
+  </refsect1>
+
+  <refsect1 id="synth-watchdog-gui"><title>User Interface</title>
+    <para>
+When the synthetic target is run in graphical mode the watchdog device
+extends the user interface in two ways. The <guimenu>Help</guimenu>
+menu is extended with an entry for the watchdog-specific
+documentation. There is also a graphical display of the current state
+of the watchdog. Initially the watchdog is asleep:
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="asleep.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+When application code starts the device the watchdog will begin to
+keep an eye on things (or occasionally both eyes).
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="awake.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+If the watchdog triggers the display will change again, and optionally
+the user can receive an audible alert. The location of the watchdog
+display within the I/O auxiliary's window can be controlled via
+a <command>watchdog_pack</command> entry in the target definition
+file. For example the following can be used to put the watchdog
+display to the right of the central text window:
+    </para>
+    <programlisting>
+synth_device watchdog {
+    watchdog_pack -in .main.e -side top
+    &hellip;
+}
+</programlisting>
+    <para>
+The user interface section of the generic synthetic target HAL
+documentation can be consulted for more information on window packing.
+    </para>
+    <para>
+By default the watchdog support will not generate an audible alert
+when the watchdog triggers, to avoid annoying colleagues. Sound can be
+enabled in the target definition file, and two suitable files
+<filename>sound1.au</filename> and <filename>sound2.au</filename> are
+supplied as standard:
+    </para>
+    <programlisting>
+synth_device watchdog {
+    sound sound1.au
+    &hellip;
+}
+</programlisting>
+    <para>
+An absolute path can be specified if desired:
+    </para>
+    <programlisting>
+synth_device watchdog {
+    sound /usr/share/emacs/site-lisp/emacspeak/sounds/default-8k/alarm.au
+    &hellip;
+}
+</programlisting>
+    <para>
+Sound facilities are not built into the I/O auxiliary itself, instead
+an external program is used. The default player is
+<command>play</command>, a front-end to the
+<application>sox</application> application shipped with some Linux
+distributions. If another player should be used then this can be
+specified in the target definition file:
+    </para>
+    <programlisting>
+synth_device watchdog {
+    &hellip;
+    sound_player my_sound_player
+</programlisting>
+    <para>
+The specified program will be run in the background with a single
+argument, the sound file.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-watchdog-synth-args"><title>Command Line Arguments</title>
+    <para>
+The watchdog support does not use any command line arguments. All
+configuration is handled through the target definition file.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-watchdog-synth-hooks"><title>Hooks</title>
+    <para>
+The watchdog support does not provide any hooks for use by other
+scripts. There is rarely any need for customizing the system's
+behaviour when a watchdog triggers because those should be rare
+events, even during application development.
+    </para>
+  </refsect1>
+
+  <refsect1 id="devs-watchdog-synth-tcl"><title>Additional Tcl Procedures</title>
+    <para>
+The watchdog support does not provide any additional Tcl procedures or
+variables for use by other scripts.
+    </para>
+  </refsect1>
+
+</refentry>
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/Makefile.am
@@ -0,0 +1,61 @@
+## Process this file with automake to produce Makefile.in
+## =====================================================================
+##
+##     Makefile.am
+##
+##     Build support for the host-side synthetic target support,
+##     the watchdog package
+##
+## =====================================================================
+######COPYRIGHTBEGIN####
+#                                                                          
+# ----------------------------------------------------------------------------
+# Copyright (C) 2002 Bart Veer
+#
+# This file is part of the eCos synthetic target ethernet support.
+#
+# This program is free software; you can redistribute it and/or modify it 
+# under the terms of the GNU General Public License as published by the Free 
+# Software Foundation; either version 2 of the License, or (at your option) 
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful, but WITHOUT 
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+# more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# ----------------------------------------------------------------------------
+#                                                                          
+######COPYRIGHTEND####
+## =====================================================================
+#######DESCRIPTIONBEGIN####
+##
+## Author(s):	bartv
+## Contact(s):	bartv
+## Date:	2002/09/04
+## Version:	0.01
+##
+######DESCRIPTIONEND####
+## =====================================================================
+
+AUTOMAKE_OPTIONS = 1.3 foreign
+
+## Only some platforms are supported. Having the configure script throw
+## an error when attempting to configure on an unsupported platform
+## would be a mistake, since that would prevent any configury from
+## the toplevel on unsupported platforms. Instead an automake conditional
+## is used, leading to null makefiles on unsupported platforms.
+
+if SUPPORTED
+
+## The only thing that needs to be installed is a Tcl script and some
+## data files.
+watchdogdir 		= $(libexecdir)/ecos/@PACKAGE_INSTALL@
+watchdog_DATA		= watchdog.tcl \
+                          watchdog.tdf \
+                          alarm.gif doghouse.gif eye.gif asleep.gif \
+                          sound1.au sound2.au
+endif
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/Makefile.in
@@ -0,0 +1,288 @@
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+######COPYRIGHTBEGIN####
+#                                                                          
+# ----------------------------------------------------------------------------
+# Copyright (C) 2002 Bart Veer
+#
+# This file is part of the eCos synthetic target ethernet support.
+#
+# This program is free software; you can redistribute it and/or modify it 
+# under the terms of the GNU General Public License as published by the Free 
+# Software Foundation; either version 2 of the License, or (at your option) 
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful, but WITHOUT 
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+# more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# ----------------------------------------------------------------------------
+#                                                                          
+######COPYRIGHTEND####
+#######DESCRIPTIONBEGIN####
+######DESCRIPTIONEND####
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+CC = @CC@
+CXX = @CXX@
+ECOS_REPOSITORY = @ECOS_REPOSITORY@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MSVC_SRCDIR = @MSVC_SRCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_DIR = @PACKAGE_DIR@
+PACKAGE_INSTALL = @PACKAGE_INSTALL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+VERSION = @VERSION@
+ecos_CFLAGS = @ecos_CFLAGS@
+ecos_CXXFLAGS = @ecos_CXXFLAGS@
+ecos_INCLUDES = @ecos_INCLUDES@
+ecos_LDADD = @ecos_LDADD@
+ecos_LIBS = @ecos_LIBS@
+ecos_infra_incdir = @ecos_infra_incdir@
+ecos_infra_libdir = @ecos_infra_libdir@
+ecos_libcdl_incdir = @ecos_libcdl_incdir@
+ecos_libcdl_libdir = @ecos_libcdl_libdir@
+ecos_tk_libs = @ecos_tk_libs@
+
+AUTOMAKE_OPTIONS = 1.3 foreign
+
+@SUPPORTED_TRUE@watchdogdir = @SUPPORTED_TRUE@$(libexecdir)/ecos/@PACKAGE_INSTALL@
+@SUPPORTED_TRUE@watchdog_DATA = @SUPPORTED_TRUE@watchdog.tcl \
+@SUPPORTED_TRUE@                          watchdog.tdf \
+@SUPPORTED_TRUE@                          alarm.gif doghouse.gif eye.gif asleep.gif \
+@SUPPORTED_TRUE@                          sound1.au sound2.au
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../../../acsupport/mkinstalldirs
+CONFIG_CLEAN_FILES = 
+DATA =  $(watchdog_DATA)
+
+DIST_COMMON =  Makefile.am Makefile.in acinclude.m4 aclocal.m4 configure \
+configure.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4
+	cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+install-watchdogDATA: $(watchdog_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(watchdogdir)
+	@list='$(watchdog_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(watchdogdir)/$$p"; \
+	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(watchdogdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(watchdogdir)/$$p"; \
+	    $(INSTALL_DATA) $$p $(DESTDIR)$(watchdogdir)/$$p; \
+	  fi; fi; \
+	done
+
+uninstall-watchdogDATA:
+	@$(NORMAL_UNINSTALL)
+	list='$(watchdog_DATA)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(watchdogdir)/$$p; \
+	done
+tags: TAGS
+TAGS:
+
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	-rm -rf $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+	mkdir $(distdir)/=build
+	mkdir $(distdir)/=inst
+	dc_install_base=`cd $(distdir)/=inst && pwd`; \
+	cd $(distdir)/=build \
+	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist
+	-rm -rf $(distdir)
+	@banner="$(distdir).tar.gz is ready for distribution"; \
+	dashes=`echo "$$banner" | sed s/./=/g`; \
+	echo "$$dashes"; \
+	echo "$$banner"; \
+	echo "$$dashes"
+dist: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+dist-all: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+distdir: $(DISTFILES)
+	-rm -rf $(distdir)
+	mkdir $(distdir)
+	-chmod 777 $(distdir)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-watchdogDATA
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-watchdogDATA
+uninstall: uninstall-am
+all-am: Makefile $(DATA)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(watchdogdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am:  clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am:  distclean-generic clean-am
+
+distclean: distclean-am
+	-rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+	-rm -f config.status
+
+.PHONY: uninstall-watchdogDATA install-watchdogDATA tags distdir info-am \
+info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/acinclude.m4
@@ -0,0 +1,45 @@
+dnl Process this file with aclocal to get an aclocal.m4 file. Then
+dnl process that with autoconf.
+dnl ====================================================================
+dnl
+dnl     acinclude.m4
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos host tools.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/09/04
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+dnl Access shared macros.
+dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
+dnl incorporate the macro into aclocal.m4
+sinclude(../../../../../../acsupport/acinclude.m4)
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/aclocal.m4
@@ -0,0 +1,183 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+dnl Process this file with aclocal to get an aclocal.m4 file. Then
+dnl process that with autoconf.
+dnl ====================================================================
+dnl
+dnl     acinclude.m4
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos host tools.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/09/04
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+dnl Access shared macros.
+dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
+dnl incorporate the macro into aclocal.m4
+sinclude(../../../../../../acsupport/acinclude.m4)
+
+# Define a conditional.
+
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "[$]2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
+
new file mode 100644
index 0000000000000000000000000000000000000000..2c8c318b2c41a65e390e5dea1ff5d35fbb875f65
GIT binary patch
literal 5083
zc$~$UTWlQF8OPV&I1Vw{HD&FytarWmvOD&iGhUBR;+&bRo!EqUy~IoEIQH(?9?v#b
zS|vrj7#wI-bwVJ7Brn`rXrzjZpiqfI3qopmXvM9(R8_^LsA?sIsumvdQdN~&q@>?D
zGwZ$j0;b|yYv=6joZtMv%lXc%$HosZEuZr2^Za|!1BRL!+L{}?S{t?2?K``C{qfcV
zt&I~s&Eq@$<7#Ls=}+siqjGR*SNQw8Z=4xzJ2)yI8ttAts2&?{IdM3AduGS-k*3>o
zt=5EmA}b%yv88$WPAjr}R9-&Hma^%S$5SW2Iko)l{HaXn!mRJ^+zk)RwVk>tcK4ig
z_E_-2+k!t`3fy-*e)cx~%y;_kyMsM+2Y%?TJ<tE(x(naB`JScJndO-u|1kCZsmLp5
zTAn?PpSfq~rTe=cKAnE#v~kWpcHaK(kIsJMk#i>>KQsQsS>weEnO~g$-jffWc>1xs
zes%HdFFkqZ(--gk`BM+S{Oq|)zr6VB%g?>`g8kbU&%gf4qpx53**kCi<o9p=`j2lu
z_oqKx`taQsKKbjbmp}T=2k*T7mp{Mv;RnCF{I|FM@zHz#{P^vEU4H+QkN^JZr~kcr
z^{VHKwvPX7sq=UiJ%oSYIq@`Ju@}Eo`;u?Jiu((j#2%jH@3Uir>2)q#$Njm^Xa)}Z
z+7p5GNNd_`=dO;0#o4at;NG(HpCkLj{lg23Gi{@@n~c%n(Ej;3`<AcVx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a}e4&0sxnujVU!X)0!Da_YSk`y~yN%m1fCK__Jaoyx*?hbdv(c>6=&Kgrg
zD=n~Ekd85Pc1E!uYdCG0g{doP<BsKw5gXKtu3Tf~2cSDUr;&3JIRq+lu1CT-7i5f}
zKF0V)1LcjJO|_UVneXz*&6nt4hb+O!8CPt}bqkz=#Aj2mgCe3svtqieAS7eD(zeln
zUMR4_s&`#0ggYxFS>{aP$$$t|SP4s*mPl%MImmW<nMNjIc@;t<)EH)VI#ZkidI;!2
zfnd0=7%HS{!ZkNQAZR=ft2O7;QO>aP3)xIr*FcDgoS_gb-qP$3sJz>OV$JEWct2kd
zqOjp$Wp6!L*?f@h^nJ9eY`@^X^(w5eUErY^P~<HAe0E}RwB+K#?U5=f5?x;g3IYSm
zAV%YYG&VfT%MnoXmYE6#%KLc%6hf7)o^ORf(qSJX+^}*apXX`kYu}m(%TRkI5iL}7
z%~s1%Iwh*R=|^ulGP5AUGu<EOsa_!=LR#1A*5Djb>|#$6mYK=V54VWNoR!@iK!mAl
zG+I=B8#uE!pmL`*#xw_n_==9VmtMNDUwrUf3VlJ;DN_oyPt?kXq79MY(VrIu<He7N
z4FXlA?X!bin8s^N=15)Lz|L4{rNxhV>tMQ0YV@<urb^KTWdoRXqQCM>>;GiwFYMnf
Ir#yT92hmnM(f|Me
new file mode 100644
index 0000000000000000000000000000000000000000..24f4382d3bbea37fc4b6c8270e9a153519fa42cb
GIT binary patch
literal 283
zc${<hbhEHb6k`x(_{hir1pmPR$WZ*r0u*3k&;f~p<QbUWOwkBj<kBg`%EZDE0Ai?m
ziF6nw9%>O#^#V#M9ctkeR%-#PVG>qj;Sfl40I6}A0aVk#$qZ7H08*pmBLULRA*|*j
z0g@6@<?;clacW=?bef_e2ozxuRP&i3u*jtmXdurFh#DoJ8by$Hpc(^3hXzJQh&hcQ
s13}t5Kx#k+wt(#t1Q`glf+G-W7f?IGJuM7yH#0IJ`~_hErMMWZ0a7haQ2+n{
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/configure
@@ -0,0 +1,1171 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=watchdog.tcl
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ac_aux_dir=
+for ac_dir in ../../../../../../acsupport $srcdir/../../../../../../acsupport; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in ../../../../../../acsupport $srcdir/../../../../../../acsupport" 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+
+    echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6
+echo "configure:551: checking that a separate build tree is being used" >&5
+    ecos_cwd=`/bin/pwd`
+    if test "${srcdir}" = "." ; then
+        srcdir=${ecos_cwd}
+    fi
+    if test "${ecos_cwd}" = "${srcdir}" ; then
+        echo "$ac_t""no" 1>&6
+        { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; }
+    else
+        echo "$ac_t""yes" 1>&6
+    fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:570: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:602: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:655: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:712: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=eCos_synthetic_target_watchdog
+
+VERSION=0.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:751: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal
+   echo "$ac_t""found" 1>&6
+else
+   ACLOCAL="$missing_dir/missing aclocal"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:764: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:777: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:790: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:803: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:817: checking whether to enable maintainer-specific portions of Makefiles" >&5
+    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval="$enable_maintainer_mode"
+  USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+  
+
+if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+  MAINT=$MAINTAINER_MODE_TRUE
+  
+
+
+case "${host}" in
+    i[34567]86-*-linux-gnu* ) SUPPORTED="yes";;
+    * ) SUPPORTED="no"
+esac
+
+
+if test "${SUPPORTED}" = "yes"; then
+  SUPPORTED_TRUE=
+  SUPPORTED_FALSE='#'
+else
+  SUPPORTED_TRUE='#'
+  SUPPORTED_FALSE=
+fi
+
+if test "${SUPPORTED}" = "yes" ; then
+    
+
+        package_dir=`cd ${srcdir} && /bin/pwd`
+    PACKAGE_VERSION=`dirname ${package_dir}`
+    PACKAGE_VERSION=`basename ${PACKAGE_VERSION}`
+
+                    package_dir=`dirname ${package_dir}`
+    package_dir=`dirname ${package_dir}`
+
+    possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.."
+    possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." 
+    
+    repository_root=""
+    for i in ${possibles}; do
+        if test -d "$i/"acsupport""; then
+            repository_root=$i
+            break
+        fi
+    done
+
+    if test "${repository_root}" = "" ; then
+        { echo "configure: error: Failed to identify this package's position within the eCos repository" 1>&2; exit 1; }
+    fi
+        ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd`
+
+        PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"`
+
+                        PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}"
+    
+    
+    
+    
+    
+
+fi
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile:Makefile.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
+s%@SUPPORTED_TRUE@%$SUPPORTED_TRUE%g
+s%@SUPPORTED_FALSE@%$SUPPORTED_FALSE%g
+s%@ECOS_REPOSITORY@%$ECOS_REPOSITORY%g
+s%@PACKAGE_DIR@%$PACKAGE_DIR%g
+s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g
+s%@PACKAGE_INSTALL@%$PACKAGE_INSTALL%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile:Makefile.in"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/configure.in
@@ -0,0 +1,73 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl ====================================================================
+dnl
+dnl     configure.in
+dnl
+dnl     configure script for eCos synthetic target watchdog
+dnl	host-side support
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos synthetic target support.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/09/04
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+
+AC_INIT(watchdog.tcl)
+
+dnl Pick up the support files from the top-level acsupport directory.
+AC_CONFIG_AUX_DIR(../../../../../../acsupport)
+
+ECOS_CHECK_BUILD_ne_SRC
+AC_CANONICAL_HOST
+AM_INIT_AUTOMAKE(eCos_synthetic_target_watchdog,0.1,0)
+AM_MAINTAINER_MODE
+
+dnl The current version of the synthetic target is implemented only for
+dnl x86 Linux platforms, so a test is appropriate here. However
+dnl it is not a good idea for the configure script to report an error:
+dnl that would prevent any top-level configury working for other
+dnl platforms. Instead an automake conditional is used to suppress adding
+dnl targets to the build.
+case "${host}" in
+    i[[34567]]86-*-linux-gnu* ) SUPPORTED="yes";;
+    * ) SUPPORTED="no"
+esac
+AM_CONDITIONAL(SUPPORTED, test "${SUPPORTED}" = "yes")
+
+dnl The watchdog host-side support only involves a Tcl
+dnl script and data files, so nothing needs to be compiled    
+if test "${SUPPORTED}" = "yes" ; then
+    ECOS_PACKAGE_DIRS
+fi
+
+AC_OUTPUT(Makefile:Makefile.in)
new file mode 100644
index 0000000000000000000000000000000000000000..a9ba8a6ef4628fdc1a0f5efb93fa6d471743082a
GIT binary patch
literal 14853
zc${r}eO#1fy8kn;jKe?!;y6xZkBIDqNCS;X=5c2b2PA5dkkHIC0<tViETNgT?S5t$
zP!Lc|36Wkv#3CgnwAQx{qoB#lDjBQf&s|@#-AYeut-ITvbLR8=UibYBU~PYRanH;B
zeZJTAy<YC;nNpTG5+7ad5?sRFp9&haQaeo-G$mw;E@1LxoncyNfOucPEJLU@RG6Qr
ziu;K<R2w~O>LW3xN8=udO1y9Wyjc&$&bfd3jQdjp!ygZd%2Cfr4~$u(wmher`=V-r
zJw9l0O4QGuek{M_;hg7^AB(hGr!UD?FLlh$`nl@oFRJn~<I;;a%z12a+>4Dl8#XzA
zyY;b3<%?A+TfH*6^1!^R_vY1hS!>>3=z24yrgQ15T?HF={d~u}8`=(~dz#C)t7|)t
zwEXVBUjLnU&+*>w)BR^Jd^+QMr9l71&_BdUQ2T7tw_g1E?kfx5I``-A{_nRxCG-6&
z3;*-LnH#s)AA6(Z!^<#Np8W8_m+R)g@#Ndgl)QcUw(Hmxdhg{E&$2K4*Pp)m$N&7_
zZ@GD8;h(-?yS#PoAOG|HZ$HAGc#+I^vfq5P>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0_&k&Hg3+;YAx?f1D*Gbzd*3;u$p;Eb14%iO)DK24{QuS?TBY{^XOC6TcHR
d{Oo>zAopSKqQm|`_5hcV|M2bz!HdFU{~y53vef_p
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/doghouse.pov
@@ -0,0 +1,161 @@
+// A simple "doghouse" picture, used for the synthetic target
+// watchdog device host-side.
+//
+// This file is normally built using the following command line:
+//
+// x-povray +Idoghouse.pov +W128 +H128 +D +Q9 +AM2 +A0.9 +FP
+
+#include "consts.inc"
+#include "colors.inc"
+#include "shapes.inc"
+#include "textures.inc"
+#include "skies.inc"
+#include "woods.inc"
+
+camera {
+    location <4.5, 2.2, -5>
+    look_at <2, 2, 2>
+}
+
+light_source {
+    <7, 4, -1.5>
+    color White
+}
+
+sky_sphere { S_Cloud2 scale 2 }
+background { colour LightBlue }
+
+plane {
+    y 0
+    texture {
+        pigment { color red 0.5 green 0.98 blue 0 turbulence 0.5}
+        normal  { bumps 0.4 scale 0.1 }
+    }
+}
+
+fog {
+  distance   40
+  fog_type   Ground_Fog
+  fog_offset 1
+  fog_alt    1
+  colour     rgbf<0, 0.2, 0.2, 0.3>
+  turbulence 0.2
+}
+
+// A plank is a 1x1x0.1 block with a corner at the origin. The edges are
+// slightly rounded, to make sure that the plank boundaries are just
+// about visible.
+#declare Plank =
+  superellipsoid { <0.03,0.03> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood10 } }
+
+// A variant, for the roof
+#declare RoofPlank =
+  superellipsoid { <0.05,0.05> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood14 } }
+
+// The front and back, a rectangle with a triangle on top.
+// Going clockwise from the bottom left, the coordinates are:
+//   <0,0> <0,3.2>, <2.4.5>, <4,3.2>, <4.0>
+// Each is made from five horizontal planks.
+//
+// Note: this doghouse is not intended to be an example of good
+// woodworking. For example, butt joints for the walls are a bad idea.
+// Most importantly the roof should involve lapped joints with a
+// sensible ridge, the current construction is not going to keep the
+// rain out.
+#declare RoofAngle = degrees(atan2(1.3,2));
+#declare RoofAngleR = atan2(1.3,2);
+
+#declare FrontBack =
+  difference {
+      union {
+          object { Plank scale <4,1,1> translate <0,0,0> }
+          object { Plank scale <4,1,1> translate <0,1,0> }
+          object { Plank scale <4,1,1> translate <0,2,0> }
+          object { Plank scale <4,1,1> translate <0,3,0> }
+          object { Plank scale <4,1,1> translate <0,4,0> }
+      }
+      union {
+          box { <0,0,0> <4,4,1> rotate <0,0,RoofAngle> translate <0,3.2,-0.5> }
+          box { <0,0,0> <4,4,1> rotate <0,0, -1 * RoofAngle> translate <2,4.5,-0.5> }
+          pigment { Black }
+      }
+  }
+
+// The front also has some text to name the dog, and a
+// cutout for the opening.
+object {
+    difference {
+        object { FrontBack }
+        union {
+            text {
+                ttf "cyrvetic.ttf" "FIFI" 0.1 0
+                translate <1.2, 2.8, -0.05>
+            }
+            box { <1,0,-0.5> <3,2.2,0.5> }
+            object {
+                cylinder { <0,0,0> <0,0,1> 1 }
+                scale <1,0.33,1>
+                translate <2,2.2,-0.5>
+            }
+            pigment { Black }
+        }
+    }
+}
+
+// The back, nothing fancy needed here. The doghouse is twice
+// as deep as it is wide.
+object { FrontBack translate <0,0,8> }
+
+// A floor, to prevent any bright grass showing inside
+box { <0.05,0,0.05> <3.95,0.05,7.95> texture { T_Wood3 } }
+
+// LHS
+object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,0,0.1> }
+object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,1,0.1> }
+object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,2,0.1> }
+
+// RHS
+object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,0,0.1> }
+object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,1,0.1> }
+object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,2,0.1> }
+
+// Now for the roof. The top of the roof is at <2,4.5,0>, and the
+// corners are at <0,3.2,0> and <4,3.2,0>. The planks are 0.1 units
+// thick.
+
+#declare RoofPlank = 
+    superellipsoid { <0.05,0.05> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood14 } }
+
+#declare RoofPlank_L = object {
+    RoofPlank
+    rotate <0, -90, RoofAngle - 90>
+    scale<1,1,8.5>
+}
+
+#declare RoofPlank_R = object {
+    RoofPlank
+    rotate <0, -90, -90 - RoofAngle>
+    scale<1,1,8.5>
+}
+
+object { RoofPlank_L translate<2 - (1 * cos(RoofAngleR)), 4.5 - (1 * sin(RoofAngleR)), -0.25> }
+object { RoofPlank_L translate<2 - (2 * cos(RoofAngleR)), 4.5 - (2 * sin(RoofAngleR)), -0.25> }
+object { RoofPlank_L translate<2 - (3 * cos(RoofAngleR)), 4.5 - (3 * sin(RoofAngleR)), -0.25> }
+
+object { RoofPlank_R translate<2 + (-0.1 * cos(RoofAngleR)), 4.5 - (-0.1 * sin(RoofAngleR)), -0.25> }
+object { RoofPlank_R translate<2 + (0.9 * cos(RoofAngleR)), 4.5 - (0.9 * sin(RoofAngleR)), -0.25> }
+object { RoofPlank_R translate<2 + (1.9 * cos(RoofAngleR)), 4.5 - (1.9 * sin(RoofAngleR)), -0.25> }
+
+// And just for fun, a dog bowl.
+object {
+    merge { 
+        difference {
+            torus { 1.0 0.5 }
+            box { <-1,-1,-1> <1,0,1> pigment { Black } }
+        }
+	cylinder { <0,0,0> <0,0.2,0> 0.9 }
+    }
+    scale <0.5,0.5,0.5>
+    translate <-0.5,0,-0.7>
+    pigment { Yellow }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..520f5eabc40df6b37eaaf51e48d422ed743c6da9
GIT binary patch
literal 93
zc${<hbhEHb<Y3@p_{hir1pmPR$WZ*r0u*3k&;f~p<QbUsrmQen<kHD0>=iP@An`~G
Vr?8q2kZ}lu;nd10?8eGq4FIMp8CC!Q
new file mode 100644
index 0000000000000000000000000000000000000000..156af9a52f4a7c717f5f0dc75ee3c3b59877e43a
GIT binary patch
literal 4464
zc%1FlS67n>0>*Lne$Ux6=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4c<2<KiIyV(&(AuDQIv&dI)KonJ9>@{g{`#RMXr
zLN7j-Q%Jc~B88fKOjG1gRS&{td$*^OQ+a_TBlq<7fJM(z<UM#PDLD(vOilUx{deDe
G_kRJVoC1UZ
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/watchdog.tcl
@@ -0,0 +1,425 @@
+# {{{  Banner                                                   
+
+# ============================================================================
+# 
+#      watchdog.tcl
+# 
+#      Watchdog support for the eCos synthetic target I/O auxiliary
+# 
+# ============================================================================
+# ####COPYRIGHTBEGIN####
+#                                                                           
+#  ----------------------------------------------------------------------------
+#  Copyright (C) 2002 Bart Veer
+# 
+#  This file is part of the eCos host tools.
+# 
+#  This program is free software; you can redistribute it and/or modify it 
+#  under the terms of the GNU General Public License as published by the Free 
+#  Software Foundation; either version 2 of the License, or (at your option) 
+#  any later version.
+#  
+#  This program is distributed in the hope that it will be useful, but WITHOUT 
+#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+#  more details.
+#  
+#  You should have received a copy of the GNU General Public License along with
+#  this program; if not, write to the Free Software Foundation, Inc., 
+#  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# 
+#  ----------------------------------------------------------------------------
+#                                                                           
+# ####COPYRIGHTEND####
+# ============================================================================
+# #####DESCRIPTIONBEGIN####
+# 
+#  Author(s):   bartv
+#  Contact(s):  bartv
+#  Date:        2002/09/04
+#  Version:     0.01
+#  Description:
+#      Implementation of the watchdog device. This script should only ever
+#      be run from inside the ecosynth auxiliary.
+# 
+# ####DESCRIPTIONEND####
+# ============================================================================
+
+# }}}
+
+namespace eval watchdog {
+
+    # Was initialization successful?
+    variable init_ok 1
+
+    # Has the alarm triggered?
+    variable alarm_triggered 0
+    
+    # The eCos application process id. This is needed to send a SIGPWR signal
+    # if the watchdog triggers, and to access /proc/<pid>/stat to obtain
+    # timing information. Strictly speaking _ppid is not exported by
+    # the I/O auxiliary.
+    if { ! [info exists synth::_ppid] } {
+        synth::report_error "Watchdog initialization failed, _ppid variable required"
+        return ""
+    }
+    variable ecos_pid $synth::_ppid
+
+    # Resolution, i.e. how long to go between checks. Currently this is hard-wired
+    # to one second, or 1000 ms. This may become configurable, either on the
+    # target-side via CDL or on the host-side via the target definition file.
+    # Note that currently the watchdog device and the GUI get updated via the
+    # same timer. If the resolution is changed to e.g. 10 seconds then it might
+    # be a good idea to update the GUI more frequently, although there are
+    # arguments for keeping the animation in step with the real work.
+    variable resolution 1000
+    
+    # Options from the target definition file
+    variable use_wallclock 0
+    variable window_pack   "-in .main.n -side right"
+    variable sound_file    ""
+    variable sound_player  "play"
+
+    if { [synth::tdf_has_device "watchdog"] } {
+        if { [synth::tdf_has_option "watchdog" "use"] } {
+            set _use [synth::tdf_get_option "watchdog" "use"]
+            if { "wallclock_time" == $_use } {
+                set watchdog::use_wallclock 1
+            } elseif { "consumed_cpu_time" == $_use } {
+                set watchdog::use_wallclock 0
+            } else {
+                synth::report_error "Invalid entry in target definition file $synth::target_definition\n\
+                                    \    Device watchdog, option \"use\" should be \"wallclock_time\" or \"consumed_cpu_time\"\n"
+            }
+            unset _use
+        }
+        if { [synth::tdf_has_option "watchdog" "watchdog_pack"] } {
+            set watchdog::window_pack [synth::tdf_get_option "watchdog" "watchdog_pack"]
+            # Too complicated to validate here, instead leave it to a catch statement
+            # when the window actually gets packed
+        }
+        if { [synth::tdf_has_option "watchdog" "sound"] } {
+            set _sound_file [synth::tdf_get_option "watchdog" "sound"]
+            # Look for this sound file in the install tree first, then absolute or relative
+            if { [file exists [file join $synth::device_install_dir $_sound_file] ] } {
+                set _sound_file [file join $synth::device_install_dir $_sound_file]
+            }
+            if { ![file exists $_sound_file] } {
+                synth::report_error "Invalid entry in target definition file $synth::target_definition\n\
+                                    \    Device watchdog, option \"sound\", failed to find $_sound_file\n"
+            } elseif { ! [file readable $_sound_file] } {
+                synth::report_error "Invalid entry in target definition file $synth::target_definition\n\
+                                    \    Device watchdog, option \"sound\", no read access to file $_sound_file\n"
+            } else {
+                set watchdog::sound_file $_sound_file
+            }
+            unset _sound_file
+        }
+        if { [synth::tdf_has_option "watchdog" "sound_player"] } {
+            set watchdog::sound_player [synth::tdf_get_option "watchdog" "sound_player"]
+        }
+    }
+
+    # There is no point in creating the watchdog window if any of the image files are missing
+    if { $synth::flag_gui } {
+        foreach _image [list "doghouse.gif" "alarm.gif" "eye.gif" "asleep.gif"] {
+            variable image_[file rootname $_image]
+            if { ! [synth::load_image "watchdog::image_[file rootname $_image]" [file join $synth::device_install_dir $_image]] } {
+                synth::report_error "Watchdog device, unable to load image $_image\n\
+                                    \    This file should have been installed in $synth::device_install_dir\n"
+                set watchdog::init_ok 0
+            }
+        }
+    }
+    if { $synth::flag_gui && $watchdog::init_ok } {
+        canvas .watchdog -width [image width $image_doghouse] -height [image height $image_doghouse] \
+            -borderwidth 0
+        variable background [.watchdog create image 0 0 -anchor nw -image $image_doghouse]
+    
+        # Eye positions inside the doghouse. The eye is an 8x10 gif,
+        # mostly white but transparent around the corners
+        variable left_eye_x         48
+        variable left_eye_y         70
+        variable right_eye_x        58
+        variable right_eye_y        70
+        
+        # Pupil positions relative to the eye. The pupils are 3x3 rectangles.
+        # The dog can look in one of nine different directions, with both eyes
+        # looking in the same direction (if visible)
+        variable pupil_positions { { 1 6 } { 1 5 } { 1 3 } { 3 1 } { 3 4 } { 3 6 } { 4 3 } { 4 5 } { 4 6 } }
+    
+        # Which eyes are currently visible: none, left, right or both
+        variable eyes "none"
+        # What is the current pupil position?
+        variable pupils 4
+        
+        variable left_eye  [.watchdog create image $left_eye_x $left_eye_y -anchor nw -image $image_eye]
+        variable right_eye [.watchdog create image $right_eye_x $right_eye_y -anchor nw -image $image_eye]
+    
+        variable left_pupil \
+            [.watchdog create rectangle \
+                 [expr $left_eye_x + [lindex [lindex $pupil_positions $pupils] 0]]     \
+                 [expr $left_eye_y + [lindex [lindex $pupil_positions $pupils] 1]]     \
+                 [expr $left_eye_x + [lindex [lindex $pupil_positions $pupils] 0] + 2] \
+                 [expr $left_eye_y + [lindex [lindex $pupil_positions $pupils] 1] + 2] \
+                 -fill black]
+        variable right_pupil \
+            [.watchdog create rectangle \
+                 [expr $right_eye_x + [lindex [lindex $pupil_positions $pupils] 0]]     \
+                 [expr $right_eye_y + [lindex [lindex $pupil_positions $pupils] 1]]     \
+                 [expr $right_eye_x + [lindex [lindex $pupil_positions $pupils] 0] + 2] \
+                 [expr $right_eye_y + [lindex [lindex $pupil_positions $pupils] 1] + 2] \
+                 -fill black]
+
+    
+        # The dog is asleep until the eCos application activates the watchdog device
+        .watchdog lower $left_eye $background
+        .watchdog lower $right_eye $background
+        .watchdog lower $left_pupil $background
+        .watchdog lower $right_pupil $background
+
+        # Prepare for an alarm, but obviously the alarm picture should be hidden for now.
+        variable alarm [.watchdog create image 30 56 -anchor nw -image $image_alarm]
+        .watchdog lower $alarm $background
+
+        # Start asleep
+        variable asleep [.watchdog create image 48 70 -anchor nw -image $image_asleep]
+        
+        # Now try to pack the watchdog window using the option provided by the
+        # user. If that fails, report the error and pack in a default window.
+        if { [catch { eval pack .watchdog $watchdog::window_pack } message] } {
+            synth::report_error "Watchdog device, failed to pack window in $watchdog::window_pack\n    $message"
+            pack .watchdog -in .main.n -side right
+        }
+                   
+        # Updating the display. This happens once a second.
+        # If neither eye is visible, choose randomly between
+        # left-only, right-only or both. Otherwise there is
+        # a one in eight chance of blinking, probably switching
+        # to one of the other eye modes
+        #
+        # Also, the visible pupil(s) will move every second, to one
+        # of nine positions
+        proc gui_update { } {
+        
+            if { "none" == $watchdog::eyes} {
+                set rand [expr int(3 * rand())]
+                if { 0 == $rand } {
+                    set watchdog::eyes "left"
+                    .watchdog raise $watchdog::left_eye   $watchdog::background
+                    .watchdog raise $watchdog::left_pupil $watchdog::left_eye
+                } elseif { 1 == $rand } {
+                    set watchdog::eyes "right"
+                    .watchdog raise $watchdog::right_eye   $watchdog::background
+                    .watchdog raise $watchdog::right_pupil $watchdog::right_eye
+                } else {
+                    set watchdog::eyes "both"
+                    .watchdog raise $watchdog::left_eye    $watchdog::background
+                    .watchdog raise $watchdog::left_pupil  $watchdog::left_eye
+                    .watchdog raise $watchdog::right_eye   $watchdog::background
+                    .watchdog raise $watchdog::right_pupil $watchdog::right_eye
+                }
+            } else {
+                if { 0 == [expr int(8 * rand())] } {
+                    set watchdog::eyes "none"
+                    .watchdog lower $watchdog::left_eye    $watchdog::background
+                    .watchdog lower $watchdog::right_eye   $watchdog::background
+                    .watchdog lower $watchdog::left_pupil  $watchdog::background
+                    .watchdog lower $watchdog::right_pupil $watchdog::background
+
+                    # There is no point in moving the pupils if both eyes are shut
+                    return
+                }
+            }
+
+            set watchdog::pupils [expr int(9 * rand())]
+            set new_pupil_x [lindex [lindex $watchdog::pupil_positions $watchdog::pupils] 0]
+            set new_pupil_y [lindex [lindex $watchdog::pupil_positions $watchdog::pupils] 1]
+
+            if { ("left" == $watchdog::eyes) || ("both" == $watchdog::eyes) } {
+                .watchdog coords $watchdog::left_pupil              \
+                    [expr $watchdog::left_eye_x + $new_pupil_x]     \
+                    [expr $watchdog::left_eye_y + $new_pupil_y]     \
+                    [expr $watchdog::left_eye_x + $new_pupil_x + 2] \
+                    [expr $watchdog::left_eye_y + $new_pupil_y + 2]
+            }
+            if { ("right" == $watchdog::eyes) || ("both" == $watchdog::eyes) } {
+                .watchdog coords $watchdog::right_pupil              \
+                    [expr $watchdog::right_eye_x + $new_pupil_x]     \
+                    [expr $watchdog::right_eye_y + $new_pupil_y]     \
+                    [expr $watchdog::right_eye_x + $new_pupil_x + 2] \
+                    [expr $watchdog::right_eye_y + $new_pupil_y + 2]
+            }
+        }
+
+        # Cancel the gui display when the eCos application has exited.
+        # The watchdog is allowed to go back to sleep. If the application
+        # exited because of the watchdog then of course the alarm picture
+        # should remain visible, otherwise it would be just a flash.
+        proc gui_cancel { } {
+            .watchdog lower $watchdog::left_eye    $watchdog::background
+            .watchdog lower $watchdog::right_eye   $watchdog::background
+            .watchdog lower $watchdog::left_pupil  $watchdog::background
+            .watchdog lower $watchdog::right_pupil $watchdog::background
+            if { ! $watchdog::alarm_triggered } {
+                .watchdog raise $watchdog::asleep      $watchdog::background
+            }
+        }
+        
+        # Raise the alarm. This involves hiding the eyes and raising
+        # the alarm picture. If sound is enabled, the sound player
+        # should be invoked
+        proc gui_alarm { } {
+            .watchdog lower $watchdog::asleep      $watchdog::background
+            .watchdog lower $watchdog::left_eye    $watchdog::background
+            .watchdog lower $watchdog::right_eye   $watchdog::background
+            .watchdog lower $watchdog::left_pupil  $watchdog::background
+            .watchdog lower $watchdog::right_pupil $watchdog::background
+            .watchdog raise $watchdog::alarm       $watchdog::background
+
+            if { "" != $watchdog::sound_file } {
+                # Catch errors on the actual exec, e.g. if the sound player is
+                # invalid, but play the sound in the background. If there are
+                # problems actually playing the sound then the user should
+                # still see a message on stderr. Blocking the entire auxiliary
+                # for a few seconds is not acceptable.
+                if { [catch { eval exec -- $watchdog::sound_player $watchdog::sound_file & } message] } {
+                    synth::report_warning "Watchdog device, failed to play alarm sound file\n    $message\n"
+                }
+            }
+        }
+
+	set _watchdog_help [file join $synth::device_src_dir "doc" "devs-watchdog-synth.html"]
+	if { ![file readable $_watchdog_help] } {
+	    synth::report_warning "Failed to locate synthetic watchdog documentation $_watchdog_help\n\
+			          \    Help->Watchdog target menu option disabled.\n"
+	    set _watchdog_help ""
+	}
+	if { "" == $_watchdog_help } {
+	    .menubar.help add command -label "Watchdog" -state disabled
+	} else {
+	    .menubar.help add command -label "Watchdog" -command [list synth::handle_help "file://$_watchdog_help"]
+	}
+    }
+
+    # Now for the real work. By default the watchdog is asleep. The eCos
+    # application can activate it with a start message, which results
+    # in an "after" timer. That runs once a second to check whether or not
+    # the watchdog should trigger, and also updates the GUI.
+    #
+    # The target-side code should perform a watchdog reset at least once
+    # a second, which involves another message to this script and the
+    # setting of the reset_received flag.
+    #
+    # The update handler gets information about the eCos application using
+    # /proc/<pid>/stat (see man 5 proc). The "state" field is important:
+    # a state of T indicates that the application is stopped, probably
+    # inside gdb, so cannot reset the watchdog. The other important field
+    # is utime, the total number of jiffies (0.01 seconds) executed in
+    # user space. The code maintains an open file handle to the /proc file.
+
+    variable reset_received     0
+    variable after_id           ""
+    variable proc_stat          ""
+    variable last_jiffies       0
+    
+    set _filename "/proc/[set watchdog::ecos_pid]/stat"
+    if { [catch { open $_filename "r" } proc_stat ] } {
+        synth::report_error "Watchdog device, failed to open $_filename\n    $proc_stat\n"
+        set watchdog::init_ok 0
+    }
+    unset _filename
+
+    proc update { } {
+        set watchdog::after_id [after $watchdog::resolution watchdog::update]
+        if { $synth::flag_gui } {
+            watchdog::gui_update
+        }
+        seek $watchdog::proc_stat 0 "start"
+        set line [gets $watchdog::proc_stat]
+        scan $line "%*d %*s %s %*d %*d %*d %*d %*d %*lu %*lu %*lu %*lu %*lu %lu" state jiffies
+
+	# In theory it is possible to examine the state field (the third argument).
+	# If set to T then that indicates the eCos application is traced or
+	# stopped, probably inside gdb, and it would make sense to act as if
+	# the application had sent a reset. Unfortunately the state also appears
+	# to be set to T if the application is blocked in a system call while
+	# being debugged - including the idle select(), making the test useless.
+	# FIXME: figure out how to distinguish between being blocked inside gdb
+	# and being in a system call.
+	#if { "T" == $state } {
+	#    set watchdog::reset_received 1
+	#    return
+	#}
+	
+        # If there has been a recent reset the eCos application can continue to run for a bit longer.
+        if { $watchdog::reset_received } {
+            set watchdog::last_jiffies $jiffies
+            set watchdog::reset_received 0
+            return
+        }
+
+        # We have not received a reset. If the watchdog is using wallclock time then
+        # that is serious. If the watchdog is using elapsed cpu time then the eCos
+        # application may not actually have consumed a whole second of cpu time yet.
+        if { $watchdog::use_wallclock || (($jiffies - $watchdog::last_jiffies) > ($watchdog::resolution / 10)) } {
+            set watchdog::alarm_triggered 1
+            # Report the situation via the main text window
+            synth::report "Watchdog device: the eCos application has not sent a recent reset\n    Raising SIGPWR signal.\n"
+            # Then kill off the eCos application
+            exec kill -PWR $watchdog::ecos_pid
+            # There is no point in another run of the timer
+            after cancel $watchdog::after_id
+            # And if the GUI is running, raise the alarm visually
+            if { $synth::flag_gui } {
+                watchdog::gui_alarm
+            }
+        }
+    }
+
+    # When the eCos application has exited, cancel the timer and
+    # clean-up the GUI. Also get rid of the open file since the
+    # /proc/<pid>/stat file is no longer meaningful
+    proc exit_hook { arg_list } {
+        if { "" != $watchdog::after_id } {
+            after cancel $watchdog::after_id
+        }
+        if { $synth::flag_gui } {
+            watchdog::gui_cancel
+        }
+        close $watchdog::proc_stat
+    }
+    synth::hook_add "ecos_exit" watchdog::exit_hook
+    
+    proc handle_request { id reqcode arg1 arg2 reqdata reqlen reply_len } {
+        if { 0x01 == $reqcode } {
+            # A "start" request. If the watchdog has already started,
+            # this request is a no-op. Otherwise a timer is enabled.
+            # This is made to run almost immediately, so that the
+            # GUI gets a quick update. Setting the reset_received flag
+            # ensures that the watchdog will not trigger immediately
+            set watchdog::reset_received 1
+            if { "" == $watchdog::after_id } {
+                set watchdog::after_id [after 1 watchdog::update]
+            }
+            if { $synth::flag_gui } {
+                .watchdog lower $watchdog::asleep $watchdog::background
+            }
+        } elseif { 0x02 == $reqcode } {
+            # A "reset" request. Just set a flag, the update handler
+            # will detect this next time it runs.
+            set watchdog::reset_received 1
+        }
+    }
+    
+    proc instantiate { id name data } {
+        return watchdog::handle_request
+    }
+}
+
+if { $watchdog::init_ok } {
+    return watchdog::instantiate
+} else {
+    synth::report "Watchdog cannot be instantiated, initialization failed.\n"
+    return ""
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/host/watchdog.tdf
@@ -0,0 +1,63 @@
+synth_device watchdog {
+
+    ## How should the watchdog device decide that the watchdog has
+    ## triggered, assuming the eCos application has failed to
+    ## reset the device in time. There are two options: wallclock
+    ## time, where the watchdog will trigger after a second
+    ## irrespective of what the eCos application has been doing;
+    ## or consumed cpu time, where the watchdog will only trigger
+    ## if the eCos application has actually run for a whole second.
+    ##
+    ## Using wallclock time matches most real hardware,
+    ## but can give spurious results if there are other processes
+    ## running and consuming cpu cycles. Also, if the user has
+    ## halted the application in gdb then the watchdog will trigger
+    ## even though the application has no chance to reset the
+    ## watchdog.
+    ##
+    ## Using consumed cpu cycles avoids these problems.
+    ## However the default implementation of the idle thread action
+    ## is to block in a select() system call, so if the eCos
+    ## application spends most of its time idling but not resetting
+    ## the watchdog then the device will not trigger. The
+    ## configuration option CYGIMP_HAL_IDLE_THREAD_SPIN can be used
+    ## to change the synthetic target HAL's implementation of the
+    ## idle thread action.
+    ##
+    ## The default is to use consumed_cpu_time. Wallclock time can
+    ## be selected by uncommenting the next line.
+    # use wallclock_time
+    # use consumed_cpu_time
+    
+    ## When running in GUI mode there will be a small window showing
+    ## the current state of the watchdog: asleep, watching, or giving
+    ## the alarm. This window can be packed as desired, using one
+    ## of the container frames .main.nw .main.n .main.ne .main.w
+    ## .main.e .main.sw .main.s or .main.se, and with a position of
+    ## left, right, top or bottom. The default is to pack inside the
+    ## .main.n frame, on the right, thus causing the watchdog to
+    ## appear above the central text window.
+    # watchdog_pack -in .main.n -side right
+
+    ## If running in GUI mode, when the watchdog triggers and resets
+    ## the eCos application this will be shown in the display.
+    ## Optionally the watchdog device can also give an audible alert
+    ## when this happens. This is disabled by default to avoid
+    ## annoying co-workers, but can be enabled by specifying a suitable
+    ## sound file. Two such files, sound1.au and sound2.au, are supplied
+    ## with the watchdog device itself. Alternatively the user can
+    ## specify a different sound file using a suitable path
+    # sound sound1.au
+    # sound sound2.au
+    # sound ~/sounds/my_watchdog_alert.au
+
+    ## If sound is enabled then the watchdog device needs some way to
+    ## access the host's sound hardware. Rather than accessing
+    ## /dev/audio or /dev/dsp directly the watchdog.tcl script will
+    ## run an external program. This can avoid complications with
+    ## different sound file formats etc. The default program is
+    ## "play", a front-end to the sox utility, but a different
+    ## program or script can be specified if desired. It will be run
+    ## simply as "<program> <sound file> &"
+    # sound_player play
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/watchdog/synth/current/src/synth_watchdog.cxx
@@ -0,0 +1,159 @@
+//==========================================================================
+//
+//      synth_watchdog.cxx
+//
+//      Watchdog driver for the synthetic target
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting the
+// copyright holder(s).
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    bartv
+// Contributors: bartv
+// Date:         2002-09-04
+//
+//####DESCRIPTIONEND####
+//==========================================================================
+
+#include <pkgconf/system.h>
+#include <pkgconf/devs_watchdog_synth.h>
+
+#ifdef CYGIMP_WATCHDOG_HARDWARE
+
+#include <cyg/hal/hal_arch.h>
+#include <cyg/infra/cyg_type.h>
+#include <cyg/infra/cyg_ass.h>
+#include <cyg/infra/diag.h>
+#include <cyg/hal/hal_io.h>
+
+// FIXME: right now the generic watchdog header depends on the
+// kernel. That should be fixed in the watchdog code, but will
+// affect some device drivers as well
+#include <pkgconf/kernel.h>
+#include <cyg/io/watchdog.hxx>
+
+// Protocol between host and target
+#define SYNTH_WATCHDOG_START    0x01
+#define SYNTH_WATCHDOG_RESET    0x02
+
+// The synthetic target's watchdog implementation involves interaction
+// with a watchdog.tcl script running in the I/O auxiliary. The device
+// must be instantiated during system initialization, preferably via
+// a prioritized C++ static constructor. The generic watchdog package
+// does have a static object, but it is not prioritized. If
+// CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG is enabled then that object's
+// constructor would get called too late.
+//
+// Instead a private class is defined here, and once instance is created.
+// That instance gets referenced by the Cyg_Watchdog members, so
+// selective linking does not get in the way. Instantiation happens inside
+// the constructor, and the main Cyg_Watchdog::start() and reset() functions
+// involve passing a message to the host-side.
+//
+// There is an open issue re. resolution. Usually the hardware imposes
+// limits on what resolutions are valid, in fact there may be only one.
+// With the synthetic target it would be possible to configure the
+// desired resolution either on the target-side using a CDL option, or
+// on the host-side using the target definition file. The resolution
+// would have to be fairly coarse, probably at least 0.1 seconds,
+// to allow for communication overheads. It is not clear whether
+// target-side or host-side configuration is more appropriate, so for
+// now a fixed resolution of one second is used.
+
+class _Synth_Watchdog {
+  public:
+    _Synth_Watchdog();
+    ~_Synth_Watchdog() { }
+
+    cyg_uint64  resolution;
+};
+
+// A static instance of the _Synth_Watchdog class, whose constructor will
+// be called at the right time to instantiate host-side support.
+static _Synth_Watchdog _synth_watchdog_object CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_DRIVERS);
+
+// Id for communicating with the watchdog instance in the auxiliary
+static int aux_id   = -1;
+
+_Synth_Watchdog::_Synth_Watchdog()
+{
+    // SIGPWR is disabled by default. It has to be reenabled.
+    struct cyg_hal_sys_sigset_t blocked;
+    CYG_HAL_SYS_SIGEMPTYSET(&blocked);
+    CYG_HAL_SYS_SIGADDSET(&blocked, CYG_HAL_SYS_SIGPWR);
+    cyg_hal_sys_sigprocmask(CYG_HAL_SYS_SIG_UNBLOCK, &blocked, (cyg_hal_sys_sigset_t*) 0);
+    
+    resolution = 1000000000LL;
+    if (synth_auxiliary_running) {
+        aux_id  = synth_auxiliary_instantiate("devs/watchdog/synth",
+                                              SYNTH_MAKESTRING(CYGPKG_DEVS_WATCHDOG_SYNTH),
+                                              "watchdog",
+                                              (const char*) 0,
+                                              (const char*) 0);
+    }
+}
+
+// Hardware initialization. This has already happened in the
+// _Synth_Watchdog constructor, all that is needed here is to
+// propagate the resolution.
+void
+Cyg_Watchdog::init_hw(void)
+{
+    resolution  = _synth_watchdog_object.resolution;
+}
+
+void
+Cyg_Watchdog::start(void)
+{
+    if (synth_auxiliary_running && (-1 != aux_id)) {
+        synth_auxiliary_xchgmsg(aux_id, SYNTH_WATCHDOG_START, 0, 0,
+                               (const unsigned char*)0, 0,
+                               (int *) 0,
+                               (unsigned char*) 0, (int*) 0, 0);
+    }
+}
+
+void
+Cyg_Watchdog::reset()
+{
+    if (synth_auxiliary_running && (-1 != aux_id)) {
+        synth_auxiliary_xchgmsg(aux_id, SYNTH_WATCHDOG_RESET, 0, 0,
+                               (const unsigned char*)0, 0,
+                               (int *) 0,
+                               (unsigned char*) 0, (int*) 0, 0);
+    }
+}
+
+#endif // CYGIMP_WATCHDOG_HARDWARE
--- a/packages/ecos.db
+++ b/packages/ecos.db
@@ -1321,6 +1321,14 @@ package CYGPKG_DEVS_ETH_MCF5272 {
 }
 
 
+package CYGPKG_DEVS_ETH_ECOSYNTH {
+        alias           { "Synthetic target ethernet driver" ecosyntheth ecosynth_eth_driver }
+        directory       devs/eth/synth/ecosynth
+        script          syntheth.cdl
+        hardware
+        description     "Ethernet driver for the synthetic target"
+}
+
 package CYGPKG_IO_PCI	{
 	alias		{ "PCI configuration library" io_pci }
 	directory	io/pci
@@ -1479,6 +1487,16 @@ package CYGPKG_DEVICES_WATCHDOG_H8300_H8
            Hitachi H8/300H chip."
 }
 
+package CYGPKG_DEVS_WATCHDOG_SYNTH {
+	alias		{ "Watchdog driver for the synthetic target" devices_watchdog_synth device_watchdog_synth }
+	directory	devs/watchdog/synth
+	script          synth_watchdog.cdl
+	hardware
+        description "
+           This package provides a watchdog driver for the eCos
+           synthetic target."
+}
+
 package CYGPKG_IO_WATCHDOG {
 	alias		{ "Watchdog IO device" watchdog io_watchdog }
 	directory	io/watchdog
@@ -3460,6 +3478,8 @@ target linux {
 	packages        { CYGPKG_HAL_SYNTH
                           CYGPKG_HAL_SYNTH_I386
                           CYGPKG_DEVS_FLASH_SYNTH
+			  CYGPKG_DEVS_ETH_ECOSYNTH
+                          CYGPKG_DEVS_WATCHDOG_SYNTH
         }
         description "
     	    The linux target provides the 
--- a/packages/hal/synth/arch/current/ChangeLog
+++ b/packages/hal/synth/arch/current/ChangeLog
@@ -1,3 +1,13 @@
+2002-09-15  Bart Veer  <bartv@ecoscentric.com>
+
+	*  include/hal_io.h
+	   cdl/hal_synth.cdl
+	   src/synth_entry.c, src/synth_intr.c, src/synth_diag.c,
+	   src/synth_protocol.h
+	   doc/*
+	   host/*
+	   Add support for I/O via an I/O auxiliary
+
 2002-08-04  Bart Veer  <bartv@tymora.demon.co.uk>
 
 	* include/hal_io.h: added argv/argv/environ definitions
--- a/packages/hal/synth/arch/current/cdl/hal_synth.cdl
+++ b/packages/hal/synth/arch/current/cdl/hal_synth.cdl
@@ -98,9 +98,29 @@ cdl_package CYGPKG_HAL_SYNTH {
         cdl_option CYGNUM_HAL_RTC_PERIOD {
             display       "Real-time clock period"
             flavor        data
-           calculated     10000
+            calculated    10000
         }
     }
+    # What to do when idling
+    cdl_option CYGIMP_HAL_IDLE_THREAD_SPIN {
+	display	"Spin when idle"
+	default_value	CYGIMP_IDLE_THREAD_YIELD
+	description "
+            By default, whenever the eCos application enters the idle thread
+            the synthetic target HAL will make a select() system call. Effectively
+            this causes the application to block until an interrupt occurs,
+            without consuming any cpu resources, as if the hardware supported
+            some sort of IDLE instruction. Usually this behaviour is desirable.
+            However it interferes with the emulation of some hardware. For
+            example the synthetic watchdog timer device can use consumed cpu time
+            rather than wallclock time to determine whether or not the watchdog
+            has triggered, and if the process is spending nearly all its time
+            blocked in select() then the watchdog will not trigger when it should.
+            There are also some kernel configurations which require that the idle
+            thread does not block."
+    }
+    requires	  { CYGIMP_IDLE_THREAD_YIELD implies CYGIMP_HAL_IDLE_THREAD_SPIN }
+    
     cdl_option CYGBLD_LINKER_SCRIPT {
         display "Linker script"
         flavor data
new file mode 100644
index 0000000000000000000000000000000000000000..ff5d88faeae05276e75a29294bcc9add4af9db06
GIT binary patch
literal 21329
zc%1BbQ*$MZ^YjT%yvfG4ZEIuOwr!ic!N#_2+qP}n8=U-~-=}zQ-kzJTxtXq->8h@g
zkP_$OHWCNp06zu%4~U3}sHmt|SXcl65dgr%!Oq0Z$->LcCLkaH00;p9asYrL0N^Mn
zs3|CDDk%6L@f8;2{UyXFE+#A~E+Qo*E+Z?gpeU~-FQup`udc49q4{5FXliQc=x7`2
zsu}5PnHj2^80ngu8d;hf+gh4fSy?*UnL0bzxH;Q+x>&lnIQ#qi0|0>m0r3F=X#oLw
z0Rd$J0c`;ReF1@fmch~K06;o5ApMtZkdITazvnjq@GS=T4hZ<RZwd<bj|}#R4)uwN
z^#3jh2o4U8hz$K55fl|2{`*g4T>PKEF=2mWqmusqPD_kRNQ_TSPfSnwo0XoJm6e&B
zms^;fT#%byl$Tyvl2cq<R9aS2R+3*<R#H_}SzA|AS5@3lQ&v}3)7aS1*3#JC*4)|A
zR=sx8-_!ox`Z>_wJv=-(IzBu$GBiFuGBq_ZGe0pmJ3YTJy|lEjvbM0cy0X5xyuQA^
zy|=o(x3+({d3d;ge71LXdVG0vd~<#I^z``n{S5+vzW+b|AAuMI?df6aX6Fc?`=1y7
z=L!G}2mk?#Cs~)*9|D6)qdQiYKNx{bDxD=+UoiX|i}^*Es7^kM+ihp)?_){PI2V=5
zh*QXdTqXyV*i3q(ve^VDo5aMww8q%1bfN%Il}m&r0k2mAL3JYVM-Gqs-BJ1Bl01He
zLcTtfS97ICt!|X{vvu<&L6J)T3T&mTl{T+>Zj0EZ`^9{T)bm+=A@GNCyWI7i5>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0S3ShTEGHa_=PRt0%RBiFyI1eScY*phjmzoV;F~fIEG=^g=JWX
zbGU~u0EUm)0xCd=gZPJi7>Jp8h@m)$k9dfE*ov!ohqZW%xwwmW_=a&9jKg>X!q|o{
zfQ)OHjB_{xa#)PJSd2G7jd7TbX&8%l_=lmmh^4rRGoS*hIEr8RkEghasW_0WIFN}L
z0aRE35MTft`H=+xk_BLrAAA{-2OyFwIg>Ftk~i6rIoXpbnUg=ck|(*8O}UgWS(Hs#
zlSMg|JvozM`I2Q>mPc8VNg0+gIh8y4lqWd=LRpo0IhcJ}m;=C<i+PxjIhmFDm<3>&
rjk%bcxtX2WnWLGRk=dG|*_eCznWb5qpLv?Wd78U<nE{}b0|Ed$N;ngQ
--- a/packages/hal/synth/arch/current/doc/hal-synth-arch.html
+++ b/packages/hal/synth/arch/current/doc/hal-synth-arch.html
@@ -3,9 +3,6 @@
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
 <!-- http://www.opencontent.org/openpub/).                           -->
-<!-- Distribution of substantively modified versions of this         -->
-<!-- document is prohibited without the explicit permission of the   -->
-<!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
 <!-- permission is obtained from the copyright holder.               -->
@@ -16,7 +13,7 @@
 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
 <META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
 "><LINK
 REL="NEXT"
 TITLE="Overview"
@@ -31,6 +28,7 @@ ALINK="#0000FF"
 ><DIV
 CLASS="NAVHEADER"
 ><TABLE
+SUMMARY="Header navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -52,6 +50,7 @@ ALIGN="right"
 VALIGN="bottom"
 ><A
 HREF="synth.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -62,9 +61,7 @@ WIDTH="100%"></DIV
 ><DIV
 CLASS="PART"
 ><A
-NAME="HAL-SYNTH-ARCH"
-></A
-><DIV
+NAME="HAL-SYNTH-ARCH"><DIV
 CLASS="TITLEPAGE"
 ><H1
 CLASS="TITLE"
@@ -80,17 +77,47 @@ CLASS="TOC"
 ><A
 HREF="synth.html"
 >Overview</A
-> &#8212; The eCos synthetic target</DT
+>&nbsp;--&nbsp;Overview</DT
+><DT
+><A
+HREF="synth-install.html"
+>Installation</A
+>&nbsp;--&nbsp;Preparing to use the synthetic target</DT
+><DT
+><A
+HREF="synth-running.html"
+>Running a Synthetic Target Application</A
+>&nbsp;--&nbsp;Arguments and configuration files</DT
+><DT
+><A
+HREF="synth-gui.html"
+>The I/O Auxiliary's User Interface</A
+>&nbsp;--&nbsp;Controlling the I/O Auxiliary</DT
+><DT
+><A
+HREF="synth-console.html"
+>The Console Device</A
+>&nbsp;--&nbsp;Show output from the eCos application</DT
 ><DT
 ><A
 HREF="synth-syscalls.html"
 >System Calls</A
-> &#8212; Access Linux system facilities</DT
+>&nbsp;--&nbsp;Access Linux system facilities</DT
+><DT
+><A
+HREF="synth-new-target.html"
+>Writing New Devices - target</A
+>&nbsp;--&nbsp;extending the synthetic target, target-side</DT
+><DT
+><A
+HREF="synth-new-host.html"
+>Writing New Devices - host</A
+>&nbsp;--&nbsp;extending the synthetic target, host-side</DT
 ><DT
 ><A
 HREF="synth-porting.html"
 >Porting</A
-> &#8212; The eCos synthetic target</DT
+>&nbsp;--&nbsp;Adding support for other hosts</DT
 ></DL
 ></DIV
 ></DIV
@@ -100,6 +127,7 @@ CLASS="NAVFOOTER"
 ><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -121,6 +149,7 @@ ALIGN="right"
 VALIGN="top"
 ><A
 HREF="synth.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/layout.fig
@@ -0,0 +1,57 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 0 600 8100 600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 0 900 8100 900
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 0 1800 8100 1800
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 0 3900 8100 3900
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 600 4800 600 5100
+2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+	 0 0 8100 0 8100 5100 0 5100 0 0
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 5400 300 5400 600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 3600 300 3600 600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 1800 300 1800 600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 6300 900 6300 4800
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 6300 300 6300 600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 1800 4800 1800 900
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 6000 1800 6000 3900
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 1800 3600 6300 3600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 2100 4800 2100 5100
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+	 0 4800 8100 4800
+4 0 0 50 0 0 16 0.0000 4 165 810 6825 4425 .main.se\001
+4 0 0 50 0 0 16 0.0000 4 165 720 6825 2700 .main.e\001
+4 0 0 50 0 0 16 0.0000 4 165 840 6825 1425 .main.ne\001
+4 0 0 50 0 0 16 0.0000 4 225 1395 6375 525 .menubar.help\001
+4 0 0 50 0 0 16 0.0000 4 165 915 3450 225 .menubar\001
+4 0 0 50 0 0 16 0.0000 4 165 1455 3600 525 .menubar.view\001
+4 0 0 50 0 0 16 0.0000 4 165 765 3525 825 .toolbar\001
+4 0 0 50 0 0 16 0.0000 4 165 735 3525 1350 .main.n\001
+4 0 0 50 0 0 16 0.0000 4 165 1650 3150 2700 .main.centre.text\001
+4 0 0 50 0 0 16 0.0000 4 165 705 3525 4425 .main.s\001
+4 0 0 50 0 0 16 0.0000 4 150 1050 3300 5025 .status.text\001
+4 0 0 50 0 0 16 0.0000 4 165 885 150 4425 .main.sw\001
+4 0 0 50 0 0 16 0.0000 4 165 795 150 2700 .main.w\001
+4 0 0 50 0 0 16 0.0000 4 165 915 150 1425 .main.nw\001
+4 0 0 50 0 0 16 0.0000 4 165 1320 0 525 .menubar.file\001
+4 0 0 50 0 0 16 0.0000 4 165 1350 1875 525 .menubar.edit\001
new file mode 100644
index 0000000000000000000000000000000000000000..c9f14803cb1f3e2fa75317100431a2529fb788eb
GIT binary patch
literal 3658
zc$@)B4z=+|Nk%v~VIBfj0e}Di00030|Nkri0000U0#*S40{)DTsmtvTqnxzbi?iOm
z`wxcVNJ_wors~SJ?hD8AOxN~}=lag~{tpZahs2^R04OP!%%<}RjY_A~Dk+(?YPa03
z_X`e-OW3jbj83c9Y<9T~kINOOx&5ww<M;e;whtH>r6*WuNOqX0*g?4H_-FztIl0hC
zdFl0XkYb?HnT7Hhx;e^;c^YSlx+?XDwAuL?EBgwI1PW^F%F27D+6#<m`^r)~>zX@E
zyBplh_3IqXfec%hKy6%$tvxI4O$GfeKCz9(jE#<v%st-T6z(41UA|0+yR7@SF3<k~
z-#^Y;sDT1Y-Mdu>*C>PpnE`xA;UC0_6f2sMXfdP4{*6#Da{LG~<OYu-OPV}MCmYI@
zEL#$*=#XDbc{97zbVpL!&2~EjqUk9vXEdPSh<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jak2iTbZ`KKZ7=^teF7r$Du#&NTW&TCM`0Mxk8
zf(*J~aJHtwl_{n(AZ*MAzLB!YSnz}<<W34vlbsf-kcFw~VB_XjK->s0fWK*=bZS^U
z9@Z;?Jk*yDf7ie@U8ifX*}yN{@eX$|aUReJ1{BHh#3)K}idDqo6q~q3Dt6I{Q=Bm2
zU9MrPGMe#>Xhb6!)5yj)y77&0jH4R6fThIP@s4=RqaOFj$3FV;kAMth9zy^CJE;+Y
ACjbBd
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/overview.fig
@@ -0,0 +1,57 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+	 300 300 3300 300 3300 1800 300 1800 300 300
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 2700 300 2700 1800
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 1800 300 1800 1800
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 1800 750 2700 750
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 1800 1350 2700 1350
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 5400 300 5400 1800
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 5400 750 6900 750
+2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
+	 5400 1350 6900 1350
+2 2 0 1 0 7 50 0 -1 4.000 0 0 7 0 0 5
+	 4200 300 6900 300 6900 1800 4200 1800 4200 300
+2 1 0 2 0 7 50 0 -1 6.000 0 0 7 1 1 2
+	1 1 2.00 120.00 240.00
+	1 1 2.00 120.00 240.00
+	 3300 1050 4200 1050
+2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6900 600 7500 600
+2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6900 1125 7500 1125
+2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
+	1 1 1.00 60.00 120.00
+	1 1 1.00 60.00 120.00
+	 6900 1650 7500 1650
+4 0 0 50 0 0 12 0.0000 4 135 375 2850 1200 HAL\001
+4 0 0 50 0 0 12 0.0000 4 135 585 1950 1650 console\001
+4 0 0 50 0 0 12 0.0000 4 135 690 1875 1200 /dev/ser0\001
+4 0 0 50 0 0 12 0.0000 4 135 330 2100 600 eth0\001
+4 0 0 50 0 0 12 0.0000 4 135 390 750 825 eCos\001
+4 0 0 50 0 0 12 0.0000 4 180 825 600 1200 application\001
+4 0 0 50 0 0 12 0.0000 4 180 975 4350 1200 I/O Auxiliary\001
+4 0 0 50 0 0 12 0.0000 4 180 690 4500 825 ecosynth\001
+4 0 0 50 0 0 12 0.0000 4 135 870 5775 675 ethernet.tcl\001
+4 0 0 50 0 0 12 0.0000 4 135 660 5775 1200 serial.tcl\001
+4 0 0 50 0 0 12 0.0000 4 135 825 5775 1725 console.tcl\001
+4 0 0 50 0 0 12 0.0000 4 180 795 7575 675 Linux tap3\001
+4 0 0 50 0 0 12 0.0000 4 180 765 7575 1200 /dev/ttyS1\001
+4 0 0 50 0 0 12 0.0000 4 135 135 7575 1725 X\001
new file mode 100644
index 0000000000000000000000000000000000000000..4e1c20eccdd9853e3ac325216a442645564778a1
GIT binary patch
literal 1928
zc$@)<2Y2{KNk%v~VH^Tx0Du4h00030|Nkri0000S0%iaJ0{)DTsmtvTqnxzbi?iOm
z`wxcVNJ7Agrs~SJ?hD8AOxN~}!=;z^{tpZabGxDlU`+Cq8Klz5v_PZADfMc?YO~w!
z!s`7p!QlkCyg8$(>h;*|ZI|UBdK|vQYwh|GzaR3q_XZdsSZIbAb*QMp*a%tpxENXK
zHfbq=naR1ene^EydJ#IBXo{*=y0e<<s?drWYdU*G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ohoyvEG;TC#UKVWs3ECnXsT12YK^F>
zVX9QE>QtkORclz4s@v!)R-X#iux3@OTfOR7v07HMlC`Vbpz2xA8dj%Hm91>3D_if1
z*Syx14OZRjR^!@KuIBZwTm33j#|qfQI`yqmRclli+gLS?81|`XovLEvn%1gfb+Fsm
zD_gq(+R$>gvwJP=UPFu8)Q0x7s%@<sUJKiA$ac1{eS>Xpi(A~nVYj^Pt#5xDj^G9t
zxWUcs8)l2#<O+AW%x$i7!*N^KzBakYmF{$98(ZYwmb%>Su6MEf+R$3p4b&AbZ-?vK
a=Z53F>Rs-3WqaG-%6GTH1;Abd0suSbx^oo(
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/synth-console.html
@@ -0,0 +1,373 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>The Console Device</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="eCos Synthetic Target"
+HREF="hal-synth-arch.html"><LINK
+REL="PREVIOUS"
+TITLE="The I/O Auxiliary's User Interface"
+HREF="synth-gui.html"><LINK
+REL="NEXT"
+TITLE="System Calls"
+HREF="synth-syscalls.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>eCos Synthetic Target</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="synth-gui.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="synth-syscalls.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SYNTH-CONSOLE">The Console Device</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN435"
+></A
+><H2
+>Name</H2
+>The console device &nbsp;--&nbsp;Show output from the eCos application</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-CONSOLE-DESCRIPTION"
+></A
+><H2
+>Description</H2
+><P
+>The eCos application can generate text output in a variety of ways,
+including calling <TT
+CLASS="FUNCTION"
+>printf</TT
+> or
+<TT
+CLASS="FUNCTION"
+>diag_printf</TT
+>. When the I/O auxiliary is enabled
+the eCos startup code will instantiate a console device to process all
+such output. If operating in text mode the output will simply go to
+standard output, or to a logfile if the <TT
+CLASS="OPTION"
+>-l</TT
+> command
+line option is specified. If operating in graphical mode the output
+will go to the central text window, and optionally to a logfile as
+well. In addition it is possible to control the appearance of the main
+text via the target definition file, and to install extra filters for
+certain types of text.
+    </P
+><P
+>It should be noted that the console device is line-oriented, not
+character-oriented. This means that outputting partial lines is not
+supported, and some functions such as <TT
+CLASS="FUNCTION"
+>fflush</TT
+> and
+<TT
+CLASS="FUNCTION"
+>setvbuf</TT
+> will not operate as expected. This
+limitation prevents much possible confusion when using filters to
+control the appearance of the text window, and has some performance
+benefits - especially when the eCos application generates a great deal
+of output such as when tracing is enabled. For most applications this
+is not a problem, but it is something that developers should be aware
+of. 
+    </P
+><P
+>The console device is output-only, it does not provide any support for
+keyboard input. If the application requires keyboard input then that
+should be handled by a separate eCos device package and matching
+host-side code.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-CONSOLE-INSTALL"
+></A
+><H2
+>Installation</H2
+><P
+>The eCos side of the console device is implemented by the
+architectural HAL itself, in the source file
+<TT
+CLASS="FILENAME"
+>synth_diag.c</TT
+>, rather than in a separate device
+package. Similarly the host-side implementation,
+<TT
+CLASS="FUNCTION"
+>console.tcl</TT
+>, is part of the architectural HAL's
+host-side support. It gets installed automatically alongside the I/O
+auxiliary itself, so no separate installation procedure is required.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-CONSOLE-TDF"
+></A
+><H2
+>Target Definition File</H2
+><P
+>The <A
+HREF="synth-running.html#SYNTH-RUNNING-TDF"
+>target definition file</A
+>
+can contain a number of entries related to the console device. These
+are all optional, they only control the appearance of text output. If
+such control is desired then the relevant options should appear in the
+body of a <B
+CLASS="COMMAND"
+>synth_device</B
+> entry:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device console {
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The first option is <B
+CLASS="COMMAND"
+>appearance</B
+>, used to control the
+appearance of any text generated by the eCos application that does not
+match one of the installed filters. This option takes the same
+argument as any other filter, for example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device console {
+    appearance -foreground white -background black
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>Any number of additional filters can be created with a
+<B
+CLASS="COMMAND"
+>filter</B
+> option, for example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device console {
+    &#8230;
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The first argument gives the new filter a name which will be used in
+the <A
+HREF="synth-gui.html#SYNTH-GUI-TEXT"
+>filters dialog</A
+>. Filter names
+should be unique. The second argument is a Tcl regular expression. The
+console support will match each line of eCos output against this
+regular expression, and if a match is found then the filter will be
+used for this line of text. The above example matches any line of
+output that begins with <TT
+CLASS="LITERAL"
+>TRACE:</TT
+>, which corresponds
+to the eCos infrastructure's tracing facilities. The remaining options
+control the desired appearance for matched text. If some eCos output
+matches the regular expressions for several different filters then
+only the first match will be used.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-CONSOLE-TARGET-CONFIG"
+></A
+><H2
+>Target-side
+  Configuration Options</H2
+><P
+>There are no target-side configuration options related to the console
+device. 
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-CONSOLE-ARGUMENTS"
+></A
+><H2
+>Command Line Arguments</H2
+><P
+>The console device does not use any command-line arguments.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-CONSOLE-HOOKS"
+></A
+><H2
+>Hooks</H2
+><P
+>The console device does not provide any hooks.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN477"
+></A
+><H2
+>Additional Tcl Procedures</H2
+><P
+>The console device does not provide any additional Tcl procedures that
+can be used by other scripts.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="synth-gui.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="hal-synth-arch.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="synth-syscalls.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>The I/O Auxiliary's User Interface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>System Calls</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/synth-gui.html
@@ -0,0 +1,738 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>The I/O Auxiliary's User Interface</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="eCos Synthetic Target"
+HREF="hal-synth-arch.html"><LINK
+REL="PREVIOUS"
+TITLE="Running a Synthetic Target Application"
+HREF="synth-running.html"><LINK
+REL="NEXT"
+TITLE="The Console Device"
+HREF="synth-console.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>eCos Synthetic Target</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="synth-running.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="synth-console.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SYNTH-GUI">The I/O Auxiliary's User Interface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN304"
+></A
+><H2
+>Name</H2
+>User Interface&nbsp;--&nbsp;Controlling the I/O Auxiliary</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-GUI-DESCRIPTION"
+></A
+><H2
+>Description</H2
+><P
+>The synthetic target auxiliary is designed to support both extensions
+and user customization. Support for the desired devices is dynamically
+loaded, and each device can extend the user interface. For example it
+is possible for a device to add menu options, place new buttons on the
+toolbar, create its own sub-window within the overall layout, or even
+create entire new toplevel windows. These subwindows or toplevels
+could show graphs of activity such as interrupts or packets being
+transferred. They could also allow users to interact with the eCos
+application, for example by showing a number of buttons which will be
+mapped on to digital inputs in the eCos application. Different
+applications will have their own I/O requirements, changing the
+host-side support files that get loaded and that may modify the user
+interface. The I/O auxiliary also reads in user configuration scripts
+which can enhance the interface in the same way. Therefore the exact
+user interface will depend on the user and on the eCos application
+being run. However the overall layout is likely to remain the same.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN310"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="screen_main.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>The title bar identifies the window as belonging to an eCos synthetic
+target application and lists both the application name and its process
+id. The latter is especially useful if the application was started
+directly from a shell prompt and the user now wants to attach a gdb
+session. The window has a conventional menu bar with the usual
+entries, plus a toolbar with buttons for common operations such as cut
+and paste. Balloon help is supported.
+    </P
+><P
+>There is a central <A
+HREF="synth-gui.html#SYNTH-GUI-TEXT"
+>text window</A
+>,
+possibly surrounded by various sub-windows for various devices. For
+example there could be a row of emulated LED's above the text window,
+and monitors of ethernet traffic and interrupt activity on the right.
+At the bottom of the window is a status line, including a small
+animation that shows whether or not the eCos application is still
+running.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-GUI-MENUS"
+></A
+><H2
+>Menus and the Toolbar</H2
+><P
+>Usually there will be four menus on the menu bar:
+<SPAN
+CLASS="GUIMENU"
+>File</SPAN
+>, <SPAN
+CLASS="GUIMENU"
+>Edit</SPAN
+>,
+<SPAN
+CLASS="GUIMENU"
+>View</SPAN
+> and <SPAN
+CLASS="GUIMENU"
+>Help</SPAN
+>.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN324"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="menu_file.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>On the <SPAN
+CLASS="GUIMENU"
+>File</SPAN
+> menu there are three entries related to
+saving the current contents of the central text window.
+<SPAN
+CLASS="GUIMENUITEM"
+>Save</SPAN
+> is used to save the currently visible
+contents of the text window. Any text that is hidden because of
+filters will not be written to the savefile. If there has been a
+previous <SPAN
+CLASS="GUIMENUITEM"
+>Save</SPAN
+> or <SPAN
+CLASS="GUIMENUITEM"
+>Save
+As</SPAN
+> operation then the existing savefile will be re-used,
+otherwise the user will be asked to select a suitable file.
+<SPAN
+CLASS="GUIMENUITEM"
+>Save As</SPAN
+> also saves just the currently
+visible contents but will always prompt the user for a filename.
+<SPAN
+CLASS="GUIMENUITEM"
+>Save All</SPAN
+> can be used to save the full
+contents of the text window, including any text that is currently
+hidden. It will always prompt for a new filename, to avoid confusion
+with partial savefiles.
+    </P
+><P
+>Usually the eCos application will be run from inside gdb or from a
+shell prompt. Killing off the application while it is being debugged
+in a gdb session is not a good idea, it would be better to use gdb's
+own <B
+CLASS="COMMAND"
+>kill</B
+> command. Alternatively the eCos
+application itself can use the <TT
+CLASS="FUNCTION"
+>CYG_TEST_EXIT</TT
+> or
+<TT
+CLASS="FILENAME"
+>cyg_hal_sys_exit</TT
+> functionality. However it is
+possible to terminate the application from the I/O auxiliary using
+<SPAN
+CLASS="GUIMENUITEM"
+>Kill eCos</SPAN
+>. A clean shutdown will be
+attempted, but that can fail if the application is currently halted
+inside gdb or if it has crashed completely. As a last resort
+<TT
+CLASS="CONSTANT"
+>SIGKILL</TT
+> will be used.
+    </P
+><P
+>When operating in graphical mode the I/O auxiliary will normally
+continue to run even after the eCos application has exited. This
+allows the user to examine the last few lines of output, and perhaps
+perform actions such as saving the output to a file. The
+<SPAN
+CLASS="GUIMENUITEM"
+>Exit</SPAN
+> menu item can be used to shut down the
+auxiliary. Note that this behaviour can be changed with command line
+arguments <A
+HREF="synth-running.html#SYNTH-RUNNING-ARGUMENTS"
+><TT
+CLASS="OPTION"
+>--exit</TT
+></A
+> and
+<A
+HREF="synth-running.html#SYNTH-RUNNING-ARGUMENTS"
+><TT
+CLASS="OPTION"
+>--no-exit</TT
+></A
+>.
+    </P
+><P
+>If <SPAN
+CLASS="GUIMENUITEM"
+>Exit</SPAN
+> is used while the eCos application
+is still running then the I/O auxiliary will first attempt to
+terminate the application cleanly, and then exit.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN349"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="menu_edit.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>The <SPAN
+CLASS="GUIMENU"
+>Edit</SPAN
+> menu contains the usual entries for
+text manipulation: <SPAN
+CLASS="GUIMENUITEM"
+>Cut</SPAN
+>,
+<SPAN
+CLASS="GUIMENUITEM"
+>Copy</SPAN
+>, <SPAN
+CLASS="GUIMENUITEM"
+>Paste</SPAN
+>,
+<SPAN
+CLASS="GUIMENUITEM"
+>Clear</SPAN
+> and <SPAN
+CLASS="GUIMENUITEM"
+>Select
+All</SPAN
+>. These all operate on the central text window. By
+default this window cannot be edited so the cut, paste and clear
+operations are disabled. If the user wants to edit the contents of the
+text window then the <SPAN
+CLASS="GUIMENUITEM"
+>Read Only</SPAN
+> checkbutton
+should be toggled.
+    </P
+><P
+>The <SPAN
+CLASS="GUIMENUITEM"
+>Preferences</SPAN
+> menu item brings up a
+miscellaneous preferences dialog. One of the preferences relates to
+online help: the I/O auxiliary does not currently have a built-in html
+viewer; instead it will execute an external browser of some sort. With
+the example settings shown, the I/O auxiliary will first attempt to
+interact with an existing mozilla session. If that fails it will try
+to run a new mozilla instance, or as a last result use the Gnome help
+viewer. 
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN363"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="preferences.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>The <SPAN
+CLASS="GUIMENU"
+>View</SPAN
+> menu contains the <SPAN
+CLASS="GUIMENUITEM"
+>System
+Filters</SPAN
+> entry, used to edit the settings for the current
+<A
+HREF="synth-gui.html#SYNTH-GUI-TEXT"
+>filters</A
+>.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN371"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="menu_view.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>The <SPAN
+CLASS="GUIMENU"
+>Help</SPAN
+> menu can be used to activate online help
+for eCos generally, for the synthetic target as a whole, and for
+specific devices supported by the generic target. The Preferences
+dialog can be used to select the browser that will be used.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN377"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="menu_help.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>At the time of writing there is no well-defined toplevel index file
+for all eCos documentation. Hence the relevant menu item is disabled.
+Documentation for the synthetic target and the supported devices
+is stored as part of the package itself so can usually be found fairly
+easily. It may be necessary to set the <TT
+CLASS="ENVAR"
+>ECOS_REPOSITORY</TT
+>
+environment variable.
+    </P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-GUI-TEXT"
+></A
+><H2
+>The Main Text Window</H2
+><P
+>The central text window holds the console output from the eCos
+application: the screen shot above shows DHCP initialization data from
+the TCP/IP stack, and some output from the <TT
+CLASS="FUNCTION"
+>main</TT
+>
+thread at the bottom. Some devices can insert text of their own, for
+example the ethernet device support can be configured to show details
+of incoming and outgoing packets. Mixing the output from the eCos
+application and the various devices can make it easier to understand
+the order in which events occur.
+    </P
+><P
+>The appearance of text from different sources can be controlled by
+means of filters, and it is also possible to hide some of the text.
+For example, if tracing is enabled in the eCos configuration then the
+trace output can be given its own colour scheme, making it stand out
+from the rest of the output. In addition the trace output is generally
+voluminous so it can be hidden by default, made visible only to find
+out more about what was happening when a particular problem occurred.
+Similarly the ethernet device support can output details of the
+various packets being transferred, and using a different background
+colour for this output again makes it easier to distinguish from
+console output.
+    </P
+><P
+>The default appearance for most filters is controlled via the
+<A
+HREF="synth-running.html#SYNTH-RUNNING-TDF"
+>target definition file</A
+>. An
+example entry might be:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>  filter trace {^TRACE:.*} -foreground HotPink1 -hide 1</PRE
+></TD
+></TR
+></TABLE
+><P
+>The various colours and the hide flag for each filter can be changed
+at run-time, using the <SPAN
+CLASS="GUIMENUITEM"
+>System Filters</SPAN
+> item
+on the <SPAN
+CLASS="GUIMENU"
+>View</SPAN
+> menu. This will bring up a dialog like
+the following:
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN395"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="filters.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>It should be noted that the text window is line-oriented, not
+character-oriented. If an eCos application sends a partial line of
+text then that will remain buffered until a newline character is
+received, rather than being displayed immediately. This avoids
+confusion when there is concurrent output from several sources.
+    </P
+><P
+>By default the text window is read-only. This means it will not allow
+cut, paste and clear operations, and keyboard input will be ignored.
+The <SPAN
+CLASS="GUIMENU"
+>Edit</SPAN
+> menu has a checkbutton <SPAN
+CLASS="GUIMENUITEM"
+>Read
+Only</SPAN
+> which can be toggled to allow write operations. For
+example, a user could type in a reminder of what was happening at this
+time, or paste in part of a gdb session. Such keyboard input does not
+get forwarded to the eCos application: if the latter requires keyboard
+input then that should happen via a separate keyboard device.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-GUI-LAYOUT"
+></A
+><H2
+>Positioning Optional Windows</H2
+><P
+>Some devices may create their own subwindows, for example to monitor
+ethernet traffic or to provide additional I/O facilities such as
+emulated LED's or buttons. Usually the target definition file can be
+used to control the <A
+HREF="synth-gui.html#SYNTH-GUI-LAYOUT"
+>layout</A
+> of
+these windows. This requires an understanding of the overall layout of
+the display.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN407"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="layout.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>Subwindows are generally packed in one of eight frames surrounding the
+central text window: <TT
+CLASS="VARNAME"
+>.main.nw</TT
+>,
+<TT
+CLASS="VARNAME"
+>.main.n</TT
+>, <TT
+CLASS="VARNAME"
+>.main.ne</TT
+>,
+<TT
+CLASS="VARNAME"
+>.main.w</TT
+>, <TT
+CLASS="VARNAME"
+>.main.e</TT
+>,
+<TT
+CLASS="VARNAME"
+>.main.sw</TT
+>, <TT
+CLASS="VARNAME"
+>.main.s</TT
+>, and
+<TT
+CLASS="VARNAME"
+>.main.se</TT
+>. To position a row of LED's above the text
+window and towards the left, a target definition file could contain an
+entry such as:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device led {
+    pack -in .main.n -side left
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>Similarly, to put a traffic monitor window on the right of the text
+window would involve something like:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    &#8230;
+    monitor_pack -in .main.e -side bottom
+    &#8230;</PRE
+></TD
+></TR
+></TABLE
+><P
+>Often it will be sufficient to specify a container frame and one of
+<TT
+CLASS="CONSTANT"
+>left</TT
+>, <TT
+CLASS="CONSTANT"
+>right</TT
+>,
+<TT
+CLASS="CONSTANT"
+>top</TT
+> or <TT
+CLASS="CONSTANT"
+>bottom</TT
+>. Full control
+over the positioning requires an understanding of Tcl/Tk and in
+particular the packing algorithm, and an appropriate reference work
+should be consulted.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-GUI-GLOBAL-CONFIG"
+></A
+><H2
+>Global Settings</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>This section still to be written - it should document the interaction
+between X resources and ecosynth, and how users can control settings
+such as the main foreground and background colours.
+    </P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="synth-running.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="hal-synth-arch.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="synth-console.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Running a Synthetic Target Application</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>The Console Device</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/synth-install.html
@@ -0,0 +1,404 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Installation</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="eCos Synthetic Target"
+HREF="hal-synth-arch.html"><LINK
+REL="PREVIOUS"
+TITLE="Overview"
+HREF="synth.html"><LINK
+REL="NEXT"
+TITLE="Running a Synthetic Target Application"
+HREF="synth-running.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>eCos Synthetic Target</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="synth.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="synth-running.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SYNTH-INSTALL">Installation</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN45"
+></A
+><H2
+>Name</H2
+>Installation&nbsp;--&nbsp;Preparing to use the synthetic target</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-INSTALL-HOST"
+></A
+><H2
+>Host-side Software</H2
+><P
+>To get the full functionality of the synthetic target, users must
+build and install the I/O auxiliary ecosynth and various support
+files. It is possible to develop applications for the synthetic target
+without the auxiliary, but only limited I/O facilities will be
+available. The relevant code resides in the <TT
+CLASS="FILENAME"
+>host</TT
+> subdirectory of the synthetic target
+architectural HAL package, and building it involves the standard
+<B
+CLASS="COMMAND"
+>configure</B
+>, <B
+CLASS="COMMAND"
+>make</B
+>, and
+<B
+CLASS="COMMAND"
+>make install</B
+> steps.
+    </P
+><P
+>There are two main ways of building the host-side software. It is
+possible to build both the generic host-side software and all
+package-specific host-side software, including the I/O auxiliary. in a
+single build tree. This involves using the
+<B
+CLASS="COMMAND"
+>configure</B
+> script at the toplevel of the eCos
+repository, which will automatically search the <TT
+CLASS="FILENAME"
+>packages</TT
+> hierarchy for host-side
+software. For more information on this, see the
+<TT
+CLASS="FILENAME"
+>README.host</TT
+> file at the top of the repository.
+Note that if you have an existing build tree which does not include
+the synthetic target architectural HAL package then it will be
+necessary to rerun the toplevel configure script: the search for
+appropriate packages happens at configure time.
+    </P
+><P
+>The alternative is to build just the host-side for this package.
+This involves creating a suitable build directory and running the
+<B
+CLASS="COMMAND"
+>configure</B
+> script. Note that building directly in
+the source tree is not allowed.
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ cd &lt;somewhere suitable&gt;
+$ mkdir synth_build
+$ cd synth_build
+$ &lt;repo&lt;&gt;/packages/hal/synth/arch/&lt;version&gt;/host/configure &lt;options&gt;
+$ make
+$ make install</PRE
+></TD
+></TR
+></TABLE
+><P
+>The code makes extensive use of Tcl/TK and requires version 8.3 or
+later. This is checked by the <B
+CLASS="COMMAND"
+>configure</B
+> script. By
+default it will use the system's Tcl installation in <TT
+CLASS="FILENAME"
+>/usr</TT
+>. If a different, more recent Tcl
+installation should be used then its location can be specified using
+the options <TT
+CLASS="OPTION"
+>--with-tcl=&lt;path&gt;</TT
+>,
+<TT
+CLASS="OPTION"
+>--with-tcl-header=&lt;path&gt;</TT
+> and
+<TT
+CLASS="OPTION"
+>--with-tcl-lib=&lt;path&gt;</TT
+>. For more information on these options
+see the <TT
+CLASS="FILENAME"
+>README.host</TT
+> file at the toplevel of the
+eCos repository.
+    </P
+><P
+>Some users may also want to specify the install location using a
+<TT
+CLASS="OPTION"
+>--prefix=&lt;path&gt;</TT
+> option. The default install
+location is <TT
+CLASS="FILENAME"
+>/usr/local</TT
+>. It is
+essential that the <TT
+CLASS="FILENAME"
+>bin</TT
+>
+subdirectory of the install location is on the user's search
+<TT
+CLASS="ENVAR"
+>PATH</TT
+>, otherwise the eCos application will be unable to
+locate and execute the I/O auxiliary ecosynth.
+    </P
+><P
+>Because ecosynth is run automatically by an eCos application rather
+than explicitly by the user, it is not installed in the <TT
+CLASS="FILENAME"
+>bin</TT
+> subdirectory itself. Instead it is
+installed below <TT
+CLASS="FILENAME"
+>libexec</TT
+>,
+together with various support files such as images. At configure time
+it is usually possible to specify an alternative location for
+<TT
+CLASS="FILENAME"
+>libexec</TT
+> using
+<TT
+CLASS="OPTION"
+>--exec-prefix=&lt;path&gt;</TT
+> or
+<TT
+CLASS="OPTION"
+>--libexecdir=&lt;path&gt;</TT
+>. These options should not
+be used for this package because the eCos application is built
+completely separately and does not know how the host-side was
+configured. 
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-TOOLS"
+></A
+><H2
+>Toolchain</H2
+><P
+>When developing eCos applications for a normal embedded target it is
+necessary to use a suitable cross-compiler and related tools such as
+the linker. Developing for the synthetic target is easier because you
+can just use the standard GNU tools (gcc, g++, ld, &#8230;) which
+were provided with your Linux distribution, or which you used to build
+your own Linux setup. Any reasonably recent version of the tools, for
+example gcc 2.96(Red Hat) as shipped with Red Hat Linux 7, should be
+sufficient.
+    </P
+><P
+>There is one important limitation when using these tools: current gdb
+will not support debugging of eCos threads on the synthetic target. As
+far as gdb is concerned a synthetic target application is
+indistinguishable from a normal Linux application, so it assumes that
+any threads will be created by calls to the Linux
+<TT
+CLASS="FUNCTION"
+>pthread_create</TT
+> function provided by the C
+library. Obviously this is not the case since the application is never
+linked with that library. Therefore gdb never notices the eCos thread
+mechanisms and assumes the application is single-threaded. Fixing this
+is possible but would involve non-trivial changes to gdb.
+    </P
+><P
+>Theoretically it is possible to develop synthetic target applications
+on, for example, a PC running Windows and then run the resulting
+executables on another machine that runs Linux. This is rarely useful:
+if a Linux machine is available then usually that machine will also be
+used for building ecos and the application. However, if for some
+reason it is necessary or desirable to build on another machine then
+this requires a suitable cross-compiler and related tools. If the
+application will be running on a typical PC with an x86 processor then
+a suitable configure triplet would be
+<TT
+CLASS="USERINPUT"
+><B
+>i686-pc-linux-gnu</B
+></TT
+>. The installation
+instructions for the various GNU tools should be consulted for further
+information. 
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-HARDWARE"
+></A
+><H2
+>Hardware Preparation</H2
+><P
+>Preparing a real embedded target for eCos development can be tricky.
+Often the first step is to install suitable firmware, usually RedBoot.
+This means creating and building a special configuration for eCos with
+the RedBoot template, then somehow updating the target's flash chips
+with the resulting RedBoot image. Typically it will also be necessary
+to get a working serial connection, and possibly set up ethernet as
+well. Although usually none of the individual steps are particularly
+complicated, there are plenty of ways in which things can go wrong and
+it can be hard to figure out what is actually happening. Of course
+some board manufacturers make life easier for their developers by
+shipping hardware with RedBoot preinstalled, but even then it is still
+necessary to set up communication between host and target.
+    </P
+><P
+>None of this is applicable to the synthetic target. Instead you can
+just build a normal eCos configuration, link your application with the
+resulting libraries, and you end up with an executable that you can
+run directly on your Linux machine or via gdb. A useful side effect of
+this is that application development can start before any real
+embedded hardware is actually available.
+    </P
+><P
+>Typically the memory map for a synthetic target application will be
+set up such that there is a read-only ROM region containing all the
+code and constant data, and a read-write RAM region for the data. The
+default locations and sizes of these regions depend on the specific
+platform being used for development. Note that the application always
+executes out of ROM: on a real embedded target much of the development
+would involve running RedBoot firmware there, with application code
+and data loaded into RAM; usually this would change for the final
+system; the firmware would be replaced by the eCos application itself,
+configured for ROM bootstrap, and it would perform the appropriate
+hardware initialization. Therefore the synthetic target actually
+emulates the behaviour of a final system, not of a development
+environment. In practice this is rarely significant, although having
+the code in read-only memory can help catch some problems in
+application code.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="synth.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="hal-synth-arch.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="synth-running.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Overview</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Running a Synthetic Target Application</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/synth-new-host.html
@@ -0,0 +1,1734 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Writing New Devices - host</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="eCos Synthetic Target"
+HREF="hal-synth-arch.html"><LINK
+REL="PREVIOUS"
+TITLE="Writing New Devices - target"
+HREF="synth-new-target.html"><LINK
+REL="NEXT"
+TITLE="Porting"
+HREF="synth-porting.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>eCos Synthetic Target</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="synth-new-target.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="synth-porting.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SYNTH-NEW-HOST">Writing New Devices - host</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN726"
+></A
+><H2
+>Name</H2
+>Writing New Devices&nbsp;--&nbsp;extending the synthetic target, host-side</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-DESCRIPTION"
+></A
+><H2
+>Description</H2
+><P
+>On the host-side adding a new device means writing a Tcl/Tk script
+that will handle instantiation and subsequent requests from the
+target-side. These scripts all run in the same full interpreter,
+extended with various commands provided by the main I/O auxiliary
+code, and running in an overall GUI framework. Some knowledge of
+programming with Tcl/Tk is required to implement host-side device
+support.
+    </P
+><P
+>Some devices can be implemented entirely using a Tcl/Tk script. For
+example, if the final system will have some buttons then those can be
+emulated in the synthetic target using a few Tk widgets. A simple
+emulation could just have the right number of buttons in a row. A more
+advanced emulation could organize the buttons with the right layout,
+perhaps even matching the colour scheme, the shapes, and the relative
+sizes. With other devices it may be necessary for the Tcl script to
+interact with an external program, because the required functionality
+cannot easily be accessed from a Tcl script. For example interacting
+with a raw ethernet device involves some <TT
+CLASS="FUNCTION"
+>ioctl</TT
+>
+calls, which is easier to do in a C program. Therefore the
+<TT
+CLASS="FILENAME"
+>ethernet.tcl</TT
+> script which implements the
+host-side ethernet support spawns a separate program
+<TT
+CLASS="FILENAME"
+>rawether</TT
+>, written in C, that performs the
+low-level I/O. Raw ethernet access usually also requires root
+privileges, and running a small program <TT
+CLASS="FILENAME"
+>rawether</TT
+>
+with such privileges is somewhat less of a security risk than the
+whole eCos application, the I/O auxiliary, and various dynamically
+loaded Tcl scripts.
+    </P
+><P
+>Because all scripts run in a single interpreter, some care has
+to be taken to avoid accidental sharing of global variables. The best
+way to avoid problems is to have each script create its own Tcl
+namespace, so for example the <TT
+CLASS="FILENAME"
+>ethernet.tcl</TT
+> script
+creates a namespace <TT
+CLASS="VARNAME"
+>ethernet::</TT
+> and all variables
+and procedures reside in this namespace. Similarly the I/O auxiliary
+itself makes use of a <TT
+CLASS="VARNAME"
+>synth::</TT
+> namespace.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-BUILD"
+></A
+><H2
+>Building and Installation</H2
+><P
+>When an eCos device driver or application code instantiates a device,
+the I/O auxiliary will attempt to load a matching Tcl script. The
+third argument to <TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+>
+specifies the type of device, for example <TT
+CLASS="LITERAL"
+>ethernet</TT
+>,
+and the I/O auxiliary will append a <TT
+CLASS="FILENAME"
+>.tcl</TT
+> suffix
+and look for a script <TT
+CLASS="FILENAME"
+>ethernet.tcl</TT
+>.
+    </P
+><P
+>If the device being instantiated is application-specific rather than
+part of an eCos package, the I/O auxiliary will look first in the
+current directory, then in <TT
+CLASS="FILENAME"
+>~/.ecos/synth</TT
+>. If it is part of an eCos
+package then the auxiliary will expect to find the Tcl script and any
+support files below <TT
+CLASS="FILENAME"
+>libexec/ecos</TT
+> in the install tree - note
+that the same install tree must be used for the I/O auxiliary itself
+and for any device driver support. The directory hierarchy below
+<TT
+CLASS="FILENAME"
+>libexec/ecos</TT
+> matches the
+structure of the eCos repository, allowing multiple versions of a
+package to be installed to allow for incompatible protocol changes.
+    </P
+><P
+>The preferred way to build host-side software is to use
+<B
+CLASS="COMMAND"
+>autoconf</B
+> and <B
+CLASS="COMMAND"
+>automake</B
+>. Usually
+this involves little more than copying the
+<TT
+CLASS="FILENAME"
+>acinclude.m4</TT
+>, <TT
+CLASS="FILENAME"
+>configure.in</TT
+>
+and <TT
+CLASS="FILENAME"
+>Makefile.am</TT
+> files from an existing package,
+for example the synthetic target ethernet driver, and then making
+minor edits. In <TT
+CLASS="FILENAME"
+>acinclude.m4</TT
+> it may be necessary
+to adjust the path to the root of the repository.
+<TT
+CLASS="FILENAME"
+>configure.in</TT
+> may require a similar change, and
+the <TT
+CLASS="FUNCTION"
+>AC_INIT</TT
+> macro invocation will have to be
+changed to match one of the files in the new package. A critical macro
+in this file is <TT
+CLASS="FILENAME"
+>ECOS_PACKAGE_DIRS</TT
+> which will set
+up the correct install directory. <TT
+CLASS="FILENAME"
+>Makefile.am</TT
+> may
+require some more changes, for example to specify the data files that
+should be installed (including the Tcl script). These files should
+then be processed using <B
+CLASS="COMMAND"
+>aclocal</B
+>,
+<B
+CLASS="COMMAND"
+>autoconf</B
+> and <B
+CLASS="COMMAND"
+>automake</B
+> in that
+order. Actually building the software then just involves
+<B
+CLASS="COMMAND"
+>configure</B
+>, <B
+CLASS="COMMAND"
+>make</B
+> and
+<B
+CLASS="COMMAND"
+>make install</B
+>, as per the instructions in the
+toplevel <TT
+CLASS="FILENAME"
+>README.host</TT
+> file.
+    </P
+><P
+>To assist developers, if the environment variable
+<TT
+CLASS="ENVAR"
+>ECOSYNTH_DEVEL</TT
+> is set then a slightly different
+algorithm is used for locating device Tcl scripts. Instead of looking
+only in the install tree the I/O auxiliary will also look in the
+source tree, and if the script there is more recent than the installed
+version it will be used in preference. This allows developers to
+modify the master copy without having to run <B
+CLASS="COMMAND"
+>make
+install</B
+> all the time.
+    </P
+><P
+>If a script needs to know where it has been installed it can examine
+the Tcl variable <TT
+CLASS="VARNAME"
+>synth::device_install_dir</TT
+> . This
+variable gets updated whenever a  script is loaded, so if the
+value may be needed later it should be saved away in a device-specific
+variable. 
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-INSTANTIATION"
+></A
+><H2
+>Instantiation</H2
+><P
+>The I/O auxiliary will <B
+CLASS="COMMAND"
+>source</B
+> the device-specific
+Tcl script when the eCos application first attempts to instantiate a
+device of that type. The script should return a procedure that will be
+invoked to instantiate a device.
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>namespace eval ethernet {
+    &#8230;
+    proc instantiate { id instance data } {
+        &#8230;
+        return ethernet::handle_request
+    }
+}
+return ethernet::instantiate</PRE
+></TD
+></TR
+></TABLE
+><P
+>The <TT
+CLASS="VARNAME"
+>id</TT
+> argument is a unique identifier for this
+device instance. It will also be supplied on subsequent calls to the
+request handler, and will match the return value of
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+> on the target side. A
+common use for this value is as an array index to support multiple
+instances of this types of device. The <TT
+CLASS="VARNAME"
+>instance</TT
+> and
+<TT
+CLASS="VARNAME"
+>data</TT
+> arguments match the corresponding arguments to
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+> on the target side, so
+a typical value for <TT
+CLASS="VARNAME"
+>instance</TT
+> would be
+<TT
+CLASS="LITERAL"
+>eth0</TT
+>, and <TT
+CLASS="VARNAME"
+>data</TT
+> is used to pass
+arbitrary initialization parameters from target to host.
+    </P
+><P
+>The actual work done by the instantiation procedure is obviously
+device-specific. It may involve allocating an <A
+HREF="synth-new-host.html#SYNTH-NEW-HOST-INTERRUPTS"
+>interrupt vector</A
+>, adding a
+device-specific subwindow to the display, opening a real Linux device,
+establishing a socket connection to some server, spawning a separate
+process to handle the actual I/O, or a combination of some or all of
+the above.
+    </P
+><P
+>If the device is successfully instantiated then the return value
+should be a handler for subsequent I/O requests. Otherwise the return
+value should be an empty string, and on the target-side the
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+> call will return
+<TT
+CLASS="LITERAL"
+>-1</TT
+>. The script is responsible for providing
+<A
+HREF="synth-new-host.html#SYNTH-NEW-HOST-OUTPUT"
+>diagnostics</A
+> explaining
+why the device could not be instantiated.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-REQUESTS"
+></A
+><H2
+>Handling Requests</H2
+><P
+>When the target-side calls
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_xchgmsg</TT
+>, the I/O auxiliary will
+end up calling the request handler for the appropriate device instance
+returned during instantiation:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>namespace eval ethernet {
+    &#8230;
+    proc handle_request { id request arg1 arg2 txdata txlen max_rxlen } {
+        &#8230;
+        if { &lt;some condition&gt; } {
+            synth::send_reply &lt;error code&gt; 0 ""
+            return
+        }
+        &#8230;
+        synth::send_reply &lt;reply code&gt; $packet_len $packet
+    }
+    &#8230;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The <TT
+CLASS="VARNAME"
+>id</TT
+> argument is the same device id that was
+passed to the instantiate function, and is typically used as an array
+index to access per-device data. The <TT
+CLASS="VARNAME"
+>request</TT
+>,
+<TT
+CLASS="VARNAME"
+>arg1</TT
+>, <TT
+CLASS="VARNAME"
+>arg2</TT
+>, and
+<TT
+CLASS="VARNAME"
+>max_rxlen</TT
+> are the same values that were passed to
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_xchgmsg</TT
+> on the target-side,
+although since this is a Tcl script obviously the numbers have been
+converted to strings. The <TT
+CLASS="VARNAME"
+>txdata</TT
+> buffer is raw data
+as transmitted by the target, or an empty string if the I/O operation
+does not involve any additional data. The Tcl procedures
+<B
+CLASS="COMMAND"
+>binary scan</B
+>, <B
+CLASS="COMMAND"
+>string index</B
+> and
+<B
+CLASS="COMMAND"
+>string range</B
+> may be found especially useful when
+manipulating this buffer. <TT
+CLASS="VARNAME"
+>txlen</TT
+> is provided for
+convenience, although <B
+CLASS="COMMAND"
+>string length $txdata</B
+> would
+give the same information.
+    </P
+><P
+>The code for actually processing the request is of course device
+specific. If the target does not expect a reply then the request
+handler should just return when finished. If a reply is expected then
+there should be a call to <B
+CLASS="COMMAND"
+>synth::send_reply</B
+>. The
+first argument is the reply code, and will be turned into a 32-bit
+integer on the target side. The second argument specifies the length
+of the reply data, and the third argument is the reply data itself.
+For some devices the Tcl procedure <B
+CLASS="COMMAND"
+>binary format</B
+>
+may prove useful. If the reply involves just a code and no additional
+data, the second and third arguments should be <TT
+CLASS="LITERAL"
+>0</TT
+>
+and an empty string respectively.
+    </P
+><P
+>Attempts to send a reply when none is expected, fail to send a reply
+when one is expected, or send a reply that is larger than the
+target-side expects, will all be detected by the I/O auxiliary and
+result in run-time error messages.
+    </P
+><P
+>It is not possible for the host-side code to send unsolicited messages
+to the target. If host-side code needs attention from the target, for
+example because some I/O operation has completed, then an interrupt
+should be raised.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-INTERRUPTS"
+></A
+><H2
+>Interrupts</H2
+><P
+>The I/O auxiliary provides a number of procedures for interrupt
+handling. 
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::interrupt_allocate &lt;name&gt;
+synth::interrupt_get_max
+synth::interrupt_get_devicename &lt;vector&gt;
+synth::interrupt_raise &lt;vector&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::interrupt_allocate</B
+> is normally called during
+device instantiation, and returns the next free interrupt vector. This
+can be passed on to the target-side device driver in response to a
+suitable request, and it can then install an interrupt handler on that
+vector. Interrupt vector <TT
+CLASS="LITERAL"
+>0</TT
+> is used within the
+target-side code for the real-time clock, so the allocated vectors
+will start at <TT
+CLASS="LITERAL"
+>1</TT
+>. The argument identifies the
+device, for example <TT
+CLASS="LITERAL"
+>eth0</TT
+>. This is not actually used
+internally, but can be accessed by user-initialization scripts that
+provide some sort of interrupt monitoring facility (typically via the
+<TT
+CLASS="LITERAL"
+>interrupt</TT
+> <A
+HREF="synth-new-host.html#SYNTH-NEW-HOST-HOOKS"
+>hook</A
+>). It is possible for a
+single device to allocate multiple interrupt vectors, but the
+synthetic target supports a maximum of 32 such vectors.
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::interrupt_get_max</B
+> returns the highest
+interrupt vector that has been allocated, or <TT
+CLASS="LITERAL"
+>0</TT
+> if
+there have been no calls to
+<B
+CLASS="COMMAND"
+>synth::interrupt_allocate</B
+>.
+<B
+CLASS="COMMAND"
+>synth::interrupt_get_devicename</B
+> returns the string
+that was passed to <B
+CLASS="COMMAND"
+>synth::interrupt_allocate</B
+> when
+the vector was allocated.
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::interrupt_raise</B
+> can be called any time after
+initialization. The argument should be the vector returned by
+<B
+CLASS="COMMAND"
+>synth::interrupt_allocate</B
+> for this device. It will
+activate the normal eCos interrupt handling mechanism so, subject to
+interrupts being enabled and this particular interrupt not being
+masked out, the appropriate ISR will run.
+    </P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>At this time it is not possible for a device to allocate a specific
+interrupt vector. The order in which interrupt vectors are assigned to
+devices effectively depends on the order in which the eCos devices get
+initialized, and that may change if the eCos application is rebuilt. A
+future extension may allow devices to allocate specific vectors, thus
+making things more deterministic. However that will introduce new
+problems, in particular the code will have to start worrying about
+requests for vectors that have already been allocated.
+    </P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-ARGS"
+></A
+><H2
+>Flags and Command Line Arguments</H2
+><P
+>The generic I/O auxiliary code will process the standard command line
+arguments, and will set various flag variables accordingly. Some of
+these should be checked by device-specific scripts.
+    </P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="VARNAME"
+>synth::flag_gui</TT
+></DT
+><DD
+><P
+>This is set when the I/O auxiliary is operating in graphical mode
+rather than text mode. Some functionality such as filters and the GUI
+layout are only available in graphical mode.
+        </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    if { $synth::flag_gui } {
+        &#8230;
+    }</PRE
+></TD
+></TR
+></TABLE
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>synth::flag_verbose</TT
+></DT
+><DD
+><P
+>The user has requested additional information during startup. Each
+device driver can decide how much additional information, if any,
+should be produced.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>synth::flag_keep_going</TT
+></DT
+><DD
+><P
+>The user has specified <TT
+CLASS="OPTION"
+>-k</TT
+> or
+<TT
+CLASS="OPTION"
+>--keep-going</TT
+>, so even if an error occurs the I/O
+auxiliary and the various device driver scripts should continue running
+if at all possible. Diagnostics should still be generated.
+        </P
+></DD
+></DL
+></DIV
+><P
+>Some scripts may want to support additional command line arguments.
+This facility should be used with care since there is no way to
+prevent two different scripts from trying to use the same argument.
+The following Tcl procedures are available:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::argv_defined &lt;name&gt;
+synth::argv_get_value &lt;name&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::argv_defined</B
+> returns a boolean to indicate
+whether or not a particular argument is present. If the argument is
+the name part of a name/value pair, an <TT
+CLASS="LITERAL"
+>=</TT
+> character
+should be appended. Typical uses might be:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    if { [synth::argv_defined "-o13"] } {
+        &#8230;
+    }
+
+    if { [synth::argv_defined "-mark="] } {
+        &#8230;
+    }</PRE
+></TD
+></TR
+></TABLE
+><P
+>The first call checks for a flag <TT
+CLASS="LITERAL"
+>-o13</TT
+> or
+<TT
+CLASS="LITERAL"
+>--o13</TT
+> - the code treats options with single and
+double hyphens interchangeably. The second call checks for an argument
+of the form <TT
+CLASS="LITERAL"
+>-mark=&lt;value&gt;</TT
+> or a pair of
+arguments <TT
+CLASS="LITERAL"
+>-mark &lt;value&gt;</TT
+>. The value part of a
+name/value pair can be obtained using
+<B
+CLASS="COMMAND"
+>synth::argv_get_value</B
+>;
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    variable speed 1
+    if { [synth::argv_defined "-mark="] } {
+        set mark [synth::argv_get_value "-mark="]
+        if { ![string is integer $mark] || ($mark &#60; 1) || ($mark &#62; 9) } {
+            &lt;issue diagnostic&gt;
+        } else {
+            set speed $mark
+        }
+    }</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::argv_get_value</B
+> should only be used after a
+successful call to <B
+CLASS="COMMAND"
+>synth::argv_defined</B
+>.
+At present there is no support for some advanced forms of command line
+argument processing. For example it is not possible to repeat a
+certain option such as <TT
+CLASS="OPTION"
+>-v</TT
+> or
+<TT
+CLASS="OPTION"
+>--verbose</TT
+>, with each occurrence increasing the level
+of verbosity. 
+    </P
+><P
+>If a script is going to have its own set of command-line arguments
+then it should give appropriate details if the user specifies
+<TT
+CLASS="OPTION"
+>--help</TT
+>. This involves a hook function:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>namespace eval my_device {
+    proc help_hook { } {
+        puts " -o13          : activate the omega 13 device"
+        puts " -mark &lt;speed&gt; : set speed. Valid values are 1 to 9."
+    }
+
+    synth::hook_add "help" my_device::help_hook
+}</PRE
+></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-TDF"
+></A
+><H2
+>The Target Definition File</H2
+><P
+>Most device scripts will want to check entries in the target
+definition file for run-time configuration information. The Tcl
+procedures for this are as follows:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::tdf_has_device &lt;name&gt;
+synth::tdf_get_devices
+synth::tdf_has_option &lt;devname&gt; &lt;option&gt;
+synth::tdf_get_option &lt;devname&gt; &lt;option&gt;
+synth::tdf_get_options &lt;devname&gt; &lt;option&gt;
+synth::tdf_get_all_options &lt;devname&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::tdf_has_device</B
+> can be used to check whether
+or not the target definition file had an entry
+<TT
+CLASS="LITERAL"
+>synth_device&nbsp;&lt;name&gt;</TT
+>. Usually the name
+will match the type of device, so the
+<TT
+CLASS="FILENAME"
+>console.tcl</TT
+> script will look for a target
+definition file entry <TT
+CLASS="LITERAL"
+>console</TT
+>.
+<B
+CLASS="COMMAND"
+>synth::tdf_get_devices</B
+> returns a list of all
+device entries in the target definition file.
+    </P
+><P
+>Once it is known that the target definition file has an entry for a
+certain device, it is possible to check for options within the entry.
+<B
+CLASS="COMMAND"
+>synth::tdf_has_option</B
+> just checks for the presence,
+returning a boolean:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    if { [synth::tdf_has_option "console" "appearance"] } {
+        &#8230;
+    }</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::tdf_get_option</B
+> returns a list of all the
+arguments for a given option. For example, if the target definition
+file contains an entry:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device console {
+    appearance -foreground white -background black
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+    filter xyzzy {.*xyzzy.*} -foreground PapayaWhip
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>A call
+<B
+CLASS="COMMAND"
+>synth::tdf_get_option&nbsp;console&nbsp;appearance</B
+>
+will return the list <TT
+CLASS="LITERAL"
+>{-foreground white -background
+black}</TT
+>. This list can be manipulated using standard Tcl routines
+such as <B
+CLASS="COMMAND"
+>llength</B
+> and <B
+CLASS="COMMAND"
+>lindex</B
+>. Some
+options can occur multiple times in one entry, for example
+<TT
+CLASS="OPTION"
+>filter</TT
+> in the <TT
+CLASS="LITERAL"
+>console</TT
+> entry.
+<B
+CLASS="COMMAND"
+>synth::tdf_get_options</B
+> returns a list of lists,
+with one entry for each option occurrence.
+<B
+CLASS="COMMAND"
+>synth::tdf_get_all_options</B
+> returns a list of lists
+of all options. This time each entry will include the option name as
+well.
+    </P
+><P
+>The I/O auxiliary will not issue warnings about entries in the target
+definition file for devices which were not loaded, unless the
+<TT
+CLASS="OPTION"
+>-v</TT
+> or <TT
+CLASS="OPTION"
+>--verbose</TT
+> command line
+argument was used. This makes it easier to use a single target
+definition file for different applications. However the auxiliary will
+issue warnings about options within an entry that were ignored,
+because often these indicate a typing mistake of some sort. Hence a
+script should always call <B
+CLASS="COMMAND"
+>synth::tdf_has_option</B
+>,
+<B
+CLASS="COMMAND"
+>synth:;tdf_get_option</B
+> or
+<B
+CLASS="COMMAND"
+>synth::tdf_get_options</B
+> for all valid options, even
+if some of the options preclude the use of others.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-HOOKS"
+></A
+><H2
+>Hooks</H2
+><P
+>Some scripts may want to take action when particular events occur, for
+example when the eCos application has exited and there is no need for
+further I/O. This is supported using hooks:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>namespace eval my_device {
+    &#8230;
+    proc handle_ecos_exit { arg_list } {
+        &#8230;
+    }
+    synth::hook_add "ecos_exit" my_device::handle_ecos_exit
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>It is possible for device scripts to add their own hooks and call all
+functions registered for those hooks. A typical use for this is by
+user initialization scripts that want to monitor some types of I/O.
+The available Tcl procedures for manipulating hooks are:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::hook_define &lt;name&gt;
+synth::hook_defined &lt;name&gt;
+synth::hook_add &lt;name&gt; &lt;function&gt;
+synth::hook_call &lt;name&gt; &lt;args&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::hook_define</B
+> creates a new hook with the
+specified name. This hook must not already exist.
+<B
+CLASS="COMMAND"
+>synth::hook_defined</B
+> can be used to check for the
+existence of a hook. <B
+CLASS="COMMAND"
+>synth::hook_add</B
+> allows other
+scripts to register a callback function for this hook, and
+<B
+CLASS="COMMAND"
+>synth::hook_call</B
+> allows the owner script to invoke
+all such callback functions. A hook must already be defined before a
+callback can be attached. Therefore typically device scripts will only
+use standard hooks and their own hooks, not hooks created by some
+other device, because the order of device initialization is not
+sufficiently defined. User scripts run from
+<TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+> can use any hooks that have been
+defined.
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::hook_call</B
+> takes an arbitrary list of
+arguments, for example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    synth::hook_call "ethernet_rx" "eth0" $packet</PRE
+></TD
+></TR
+></TABLE
+><P
+>The callback function will always be invoked with a single argument,
+a list of the arguments that were passed to
+<B
+CLASS="COMMAND"
+>synth::hook_call</B
+>: 
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    proc rx_callback { arg_list } {
+        set device [lindex $arg_list 0]
+        set packet [lindex $arg_list 1]
+    }</PRE
+></TD
+></TR
+></TABLE
+><P
+>Although it might seem more appropriate to use Tcl's
+<B
+CLASS="COMMAND"
+>eval</B
+> procedure and have the callback functions
+invoked with the right number of arguments rather than a single list,
+that would cause serious problems if any of the data contained special
+characters such as <TT
+CLASS="LITERAL"
+>[</TT
+> or <TT
+CLASS="LITERAL"
+>$</TT
+>. The
+current implementation of hooks avoids such problems, at the cost of
+minor inconvenience when writing callbacks.
+    </P
+><P
+>A number of hooks are defined as standard. Some devices will add
+additional hooks, and the device-specific documentation should be
+consulted for those. User scripts can add their own hooks if desired.
+    </P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>exit</TT
+></DT
+><DD
+><P
+>This hook is called just before the I/O auxiliary exits. Hence it
+provides much the same functionality as <TT
+CLASS="FUNCTION"
+>atexit</TT
+> in
+C programs. The argument list passed to the callback function will be
+empty. 
+        </P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>ecos_exit</TT
+></DT
+><DD
+><P
+>This hook is called when the eCos application has exited. It is used
+mainly to shut down I/O operations: if the application is no longer
+running then there is no point in raising interrupts or storing
+incoming packets. The callback argument list will be empty.
+        </P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>ecos_initialized</TT
+></DT
+><DD
+><P
+>The synthetic target HAL will send a request to the I/O auxiliary once
+the static constructors have been run. All devices should now have been
+instantiated. A script could now check how many instances there are of
+a given type of device, for example ethernet devices, and create a
+little monitor window showing traffic on all the devices. The
+<TT
+CLASS="LITERAL"
+>ecos_initialized</TT
+> callbacks will be run just before
+the user's <TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+> script. The callback
+argument list will be empty.
+        </P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>help</TT
+></DT
+><DD
+><P
+>This hook is also invoked once static constructors have been run, but
+only if the user specified <TT
+CLASS="OPTION"
+>-h</TT
+> or
+<TT
+CLASS="OPTION"
+>--help</TT
+>. Any scripts that add their own command line
+arguments should add a callback to this hook which outputs details of
+the additional arguments. The callback argument list will be empty.
+        </P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>interrupt</TT
+></DT
+><DD
+><P
+>Whenever a device calls <B
+CLASS="COMMAND"
+>synth::interrupt_raise</B
+> the
+<TT
+CLASS="LITERAL"
+>interrupt</TT
+> hook will be called with a single
+argument, the interrupt vector. The main use for this is to allow
+user scripts to monitor interrupt traffic.
+        </P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-OUTPUT"
+></A
+><H2
+>Output and Filters</H2
+><P
+>Scripts can use conventional facilities for sending text output to the
+user, for example calling <B
+CLASS="COMMAND"
+>puts</B
+> or directly
+manipulating the central text widget
+<TT
+CLASS="VARNAME"
+>.main.centre.text</TT
+>. However in nearly all cases it
+is better to use output facilities provided by the I/O auxiliary
+itself: 
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::report &lt;msg&gt;
+synth::report_warning &lt;msg&gt;
+synth::report_error &lt;msg&gt;
+synth::internal_error &lt;msg&gt;
+synth::output &lt;msg&gt; &lt;filter&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::report</B
+> is intended for messages related to
+the operation of the I/O auxiliary itself, especially additional
+output resulting from <TT
+CLASS="OPTION"
+>-v</TT
+> or
+<TT
+CLASS="OPTION"
+>--verbose</TT
+>. If running in text mode the output will go
+to standard output. If running in graphical mode the output will go to
+the central text window. In both modes, use of <TT
+CLASS="OPTION"
+>-l</TT
+> or
+<TT
+CLASS="OPTION"
+>--logfile</TT
+> will modify the behaviour.
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::report_warning</B
+>,
+<B
+CLASS="COMMAND"
+>synth::report_error</B
+> and
+<B
+CLASS="COMMAND"
+>synth::internal_error</B
+> have the obvious meaning,
+including prepending strings such as <TT
+CLASS="LITERAL"
+>Warning:</TT
+> and
+<TT
+CLASS="LITERAL"
+>Error:</TT
+>. When the eCos application informs the I/O
+auxiliary that all static constructors have run, if at that point
+there have been any calls to <B
+CLASS="COMMAND"
+>synth::error</B
+> then the
+I/O auxiliary will exit. This can be suppressed with command line
+arguments <TT
+CLASS="OPTION"
+>-k</TT
+> or <TT
+CLASS="OPTION"
+>--keep-going</TT
+>.
+<B
+CLASS="COMMAND"
+>synth::internal_error</B
+> will output some information
+about the current state of the I/O auxiliary and then exit
+immediately. Of course it should never be necessary to call this
+function. 
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::output</B
+> is the main routine for outputting
+text. The second argument identifies a filter. If running in text mode
+the filter is ignored, but if running in graphical mode the filter can
+be used to control the appearance of this output. A typical use would
+be:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    synth::output $line "console"</PRE
+></TD
+></TR
+></TABLE
+><P
+>This outputs a single line of text using the
+<TT
+CLASS="LITERAL"
+>console</TT
+> filter. If running in graphical mode the
+default appearance of this text can be modified with the
+<TT
+CLASS="OPTION"
+>appearance</TT
+> option in the
+<B
+CLASS="COMMAND"
+>synth_device&nbsp;console</B
+> entry of the target
+definition file. The <SPAN
+CLASS="GUIMENUITEM"
+>System filters</SPAN
+> menu
+option can be used to change the appearance at run-time.
+    </P
+><P
+>Filters should be created before they are used. The procedures
+available for this are:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::filter_exists &lt;name&gt;
+synth::filter_get_list
+synth::filter_add &lt;name&gt; [options]
+synth::filter_parse_options &lt;options&gt; &lt;parsed_options&gt; &lt;message&gt;
+synth::filter_add_parsed &lt;name&gt; &lt;parsed_options&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::filter_exists</B
+> can be used to check whether
+or not a particular filter already exists: creating two filters with
+the same name is not allowed.
+<B
+CLASS="COMMAND"
+>synth::filter_get_list</B
+> returns a list of the
+current known filters. <B
+CLASS="COMMAND"
+>synth::filter_add</B
+> can be
+used to create a new filter. The first argument names the new filter,
+and the remaining arguments control the initial appearance. A typical
+use might be:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    synth::filter_add "my_device_tx" -foreground yellow -hide 1</PRE
+></TD
+></TR
+></TABLE
+><P
+>It is assumed that the supplied arguments are valid, which typically
+means that they are hard-wired in the script. If instead the data
+comes out of a configuration file and hence may be invalid, the
+I/O auxiliary provides a parsing utility. Typical usage would be:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    array set parsed_options [list]
+    set message ""
+    if { ![synth::filter_parse_options $console_appearance parsed_options message] } {
+        synth::report_error \
+	        "Invalid entry in target definition file $synth::target_definition\
+	         \n  synth_device \"console\", entry \"appearance\"\n$message"
+    } else {
+        synth::filter_add_parsed "console" parsed_options
+    }</PRE
+></TD
+></TR
+></TABLE
+><P
+>On success <TT
+CLASS="VARNAME"
+>parsed_options</TT
+> will be updated with an
+internal representation of the desired appearance, which can then be
+used in a call to <B
+CLASS="COMMAND"
+>synth::filter_add_parsed</B
+>. On
+failure <TT
+CLASS="VARNAME"
+>message</TT
+> will be updated with details of the
+parsing error that occurred.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-HOST-GUI"
+></A
+><H2
+>The Graphical Interface</H2
+><P
+>When the I/O auxiliary is running in graphical mode, many scripts will
+want to update the user interface in some way. This may be as simple
+as adding another entry to the help menu for the device, or adding a
+new button to the toolbar. It may also involve adding new subwindows,
+or even creating entire new toplevel windows. These may be simple
+monitor windows, displaying additional information about what is going
+on in the system in a graphical format. Alternatively they may emulate
+actual I/O operations, for example button widgets could be used to
+emulate real physical buttons.
+    </P
+><P
+>The I/O auxiliary does not provide many procedures related to the
+graphical interface. Instead it is expected that scripts will just
+update the widget hierarchy directly.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN1018"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="layout.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
+>So adding a new item to the <SPAN
+CLASS="GUIMENU"
+>Help</SPAN
+> menu involves a
+<B
+CLASS="COMMAND"
+>.menubar.help&nbsp;add</B
+> operation with suitable
+arguments. Adding a new button to the toolbar involves creating a
+child window in <TT
+CLASS="VARNAME"
+>.toolbar</TT
+> and packing it
+appropriately. Scripts can create their own subwindows and then pack
+it into one of <TT
+CLASS="VARNAME"
+>.main.nw</TT
+>,
+<TT
+CLASS="VARNAME"
+>.main.n</TT
+>, <TT
+CLASS="VARNAME"
+>.main.ne</TT
+>,
+<TT
+CLASS="VARNAME"
+>.main.w</TT
+>, <TT
+CLASS="VARNAME"
+>.main.e</TT
+>,
+<TT
+CLASS="VARNAME"
+>.main.sw</TT
+>, <TT
+CLASS="VARNAME"
+>.main.s</TT
+> or
+<TT
+CLASS="VARNAME"
+>.main.se</TT
+>. Normally the user should be allowed to
+<A
+HREF="synth-gui.html#SYNTH-GUI-LAYOUT"
+>control</A
+> this via the target
+definition file. The central window <TT
+CLASS="VARNAME"
+>.main.centre</TT
+>
+should normally be left alone by other scripts since it gets used for
+text output.
+    </P
+><P
+>The following graphics-related utilities may be found useful:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth::load_image &lt;image name&gt; &lt;filename&gt;
+synth::register_ballon_help &lt;widget&gt; &lt;message&gt;
+synth::handle_help &lt;URL&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><B
+CLASS="COMMAND"
+>synth::load_image</B
+> can be used to add a new image to
+the current interpreter. If the specified file has a
+<TT
+CLASS="FILENAME"
+>.xbm</TT
+> extension then the image will be a
+monochrome bitmap, otherwise it will be a colour image of some sort.
+A boolean will be returned to indicate success or failure, and
+suitable diagnostics will be generated if necessary.
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::register_balloon_help</B
+> provides balloon help
+for a specific widget, usually a button on the toolbar.
+    </P
+><P
+><B
+CLASS="COMMAND"
+>synth::handle_help</B
+> is a utility routine that can be
+installed as the command for displaying online help, for example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    .menubar.help add command -label "my device" -command \
+        [list synth::handle_help "file://$path"]</PRE
+></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="synth-new-target.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="hal-synth-arch.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="synth-porting.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Writing New Devices - target</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Porting</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/synth-new-target.html
@@ -0,0 +1,823 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Writing New Devices - target</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="eCos Synthetic Target"
+HREF="hal-synth-arch.html"><LINK
+REL="PREVIOUS"
+TITLE="System Calls"
+HREF="synth-syscalls.html"><LINK
+REL="NEXT"
+TITLE="Writing New Devices - host"
+HREF="synth-new-host.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>eCos Synthetic Target</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="synth-syscalls.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="synth-new-host.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SYNTH-NEW-TARGET">Writing New Devices - target</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN524"
+></A
+><H2
+>Name</H2
+>Writing New Devices&nbsp;--&nbsp;extending the synthetic target, target-side</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN527"><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN528"><P
+></P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;cyg/hal/hal_io.h
+      </PRE
+></TD
+></TR
+></TABLE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int synth_auxiliary_instantiate</CODE
+>(const char* package, const char* version, const char* device, const char* instance, const char* data);</CODE
+></P
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void synth_auxiliary_xchgmsg</CODE
+>(int device_id, int request, int arg1, int arg2, const unsigned char* txdata, int txlen, int* reply, unsigned char* rxdata, int* rxlen, int max_rxlen);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-TARGET-DESCRIPTION"
+></A
+><H2
+>Description</H2
+><P
+>In some ways writing a device driver for the synthetic target is very
+similar to writing one for a real target. Obviously it has to provide
+the standard interface for that class of device, so for example an
+ethernet device has to provide <TT
+CLASS="FUNCTION"
+>can_send</TT
+>,
+<TT
+CLASS="FUNCTION"
+>send</TT
+>, <TT
+CLASS="FUNCTION"
+>recv</TT
+> and similar
+functions. Many devices will involve interrupts, so the driver
+contains ISR and DSR functions and will call
+<TT
+CLASS="FUNCTION"
+>cyg_drv_interrupt_create</TT
+>,
+<TT
+CLASS="FUNCTION"
+>cyg_drv_interrupt_acknowledge</TT
+>, and related
+functions.
+    </P
+><P
+>In other ways writing a device driver for the synthetic target is very
+different. Usually the driver will not have any direct access to the
+underlying hardware. In fact for some devices the I/O may not involve
+real hardware, instead everything is emulated by widgets on the
+graphical display. Therefore the driver cannot just peek and poke
+device registers, instead it must interact with host-side code by
+exchanging message. The synthetic target HAL provides a function
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_xchgmsg</TT
+> for this purpose.
+    </P
+><P
+>Initialization of a synthetic target device driver is also very
+different. On real targets the device hardware already exists when the
+driver's initialization routine runs. On the synthetic target it is
+first necessary to instantiate the device inside the I/O auxiliary, by
+a call to <TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+>. That
+function performs a special message exchange with the I/O auxiliary,
+causing it to load a Tcl script for the desired type of device and run
+an instantiation procedure within that script.
+    </P
+><P
+>Use of the I/O auxiliary is optional: if the user does not specify
+<TT
+CLASS="OPTION"
+>--io</TT
+> on the command line then the auxiliary will not
+be started and hence most I/O operations will not be possible. Device
+drivers should allow for this possibility, for example by just
+discarding any data that gets written. The HAL exports a flag
+<TT
+CLASS="VARNAME"
+>synth_auxiliary_running</TT
+> which should be checked.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-TARGET-INSTANTIATE"
+></A
+><H2
+>Instantiating a Device</H2
+><P
+>Device instantiation should happen during the C++ prioritized static
+constructor phase of system initialization, before control switches to
+<TT
+CLASS="FUNCTION"
+>cyg_user_start</TT
+> and general application code. This
+ensures that there is a clearly defined point at which the I/O
+auxiliary knows that all required devices have been loaded. It can
+then perform various consistency checks and clean-ups, run the user's
+<TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+> script, and make the main window
+visible.
+    </P
+><P
+>For standard devices generic eCos I/O code will call the device
+initialization routines at the right time, iterating through the
+<TT
+CLASS="VARNAME"
+>DEVTAB</TT
+> table in a static constructor. The same
+holds for network devices and file systems. For more custom devices
+code like the following can be used:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#include &lt;cyg/infra/cyg_type.h&gt;
+class mydev_init {
+  public:
+    mydev_init() {
+        &#8230;
+    }
+};
+static mydev_init mydev_init_object CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Some care has to be taken because the object
+<TT
+CLASS="VARNAME"
+>mydev_init_object</TT
+> will typically not be referenced
+by other code, and hence may get eliminated at link-time. If the code
+is part of an eCos package then problems can be avoided by putting the
+relevant file in <TT
+CLASS="FILENAME"
+>libextras.a</TT
+>:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>cdl_package CYGPKG_DEVS_MINE {
+    &#8230;
+    compile -library=libextras.a init.cxx
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>For devices inside application code the same can be achieved by
+linking the relevant module as a <TT
+CLASS="FILENAME"
+>.o</TT
+> file rather
+than putting it in a <TT
+CLASS="FILENAME"
+>.a</TT
+> library.
+    </P
+><P
+>In the device initialization routine the main operation is a call to
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+>. This takes five
+arguments, all of which should be strings:
+    </P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="VARNAME"
+>package</TT
+></DT
+><DD
+><P
+>For device drivers which are eCos packages this should be a directory
+path relative to the eCos repository, for example
+<TT
+CLASS="LITERAL"
+>devs/eth/synth/ecosynth</TT
+>. This will allow the I/O
+auxiliary to find the various host-side support files for this package
+within the install tree. If the device is application-specific and not
+part of an eCos package then a NULL pointer can be used, causing the
+I/O auxiliary to search for the support files in the current directory
+and then in <TT
+CLASS="FILENAME"
+>~/.ecos/synth</TT
+>
+instead. 
+        </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>version</TT
+></DT
+><DD
+><P
+>For eCos packages this argument should be the version of the package
+that is being used, for example <TT
+CLASS="LITERAL"
+>current</TT
+>. A simple
+way to get this version is to use the
+<TT
+CLASS="FUNCTION"
+>SYNTH_MAKESTRING</TT
+> macro on the package name.
+If the device is application-specific then a NULL pointer should be
+used. 
+        </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>device</TT
+></DT
+><DD
+><P
+>This argument specifies the type of device being instantiated, for
+example <TT
+CLASS="LITERAL"
+>ethernet</TT
+>. More specifically the I/O
+auxiliary will append a <TT
+CLASS="FILENAME"
+>.tcl</TT
+> suffix, giving
+the name of a Tcl script that will handle all I/O requests for the
+device. If the application requires several instances of a type
+of device then the script will only be loaded once, but the script
+will contain an instantiation procedure that will be called for each
+device instance. 
+        </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>instance</TT
+></DT
+><DD
+><P
+>If it is possible to have multiple instances of a device then this
+argument identifies the particular instance, for example
+<TT
+CLASS="LITERAL"
+>eth0</TT
+> or <TT
+CLASS="LITERAL"
+>eth1</TT
+>. Otherwise a NULL
+pointer can be used.
+        </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>data</TT
+></DT
+><DD
+><P
+>This argument can be used to pass additional initialization data from
+eCos to the host-side support. This is useful for devices where eCos
+configury must control certain aspects of the device, rather than
+host-side configury such as the target definition file, because eCos
+has compile-time dependencies on some or all of the relevant options.
+An example might be an emulated frame buffer where eCos has been
+statically configured for a particular screen size, orientation and
+depth. There is no fixed format for this string, it will be
+interpreted only by the device-specific host-side Tcl script. However
+the string length should be limited to a couple of hundred bytes to
+avoid possible buffer overflow problems.
+        </P
+></DD
+></DL
+></DIV
+><P
+>Typical usage would look like:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>    if (!synth_auxiliary_running) {
+      return;
+    }
+    id = synth_auxiliary_instantiate("devs/eth/synth/ecosynth",
+             SYNTH_MAKESTRING(CYGPKG_DEVS_ETH_ECOSYNTH),
+             "ethernet",
+             "eth0",
+             (const char*) 0);</PRE
+></TD
+></TR
+></TABLE
+><P
+>The return value will be a device identifier which can be used for
+subsequent calls to <TT
+CLASS="FUNCTION"
+>synth_auxiliary_xchgmsg</TT
+>. If
+the device could not be instantiated then <TT
+CLASS="LITERAL"
+>-1</TT
+> will
+be returned. It is the responsibility of the host-side software to
+issue suitable diagnostics explaining what went wrong, so normally the
+target-side code should fail silently.
+    </P
+><P
+>Once the desired device has been instantiated, often it will be
+necessary to do some additional initialization by a message exchange.
+For example an ethernet device might need information from the
+host-side about the MAC address, the <A
+HREF="synth-new-target.html#SYNTH-NEW-TARGET-INTERRUPTS"
+>interrupt vector</A
+>, and
+whether or not multicasting is supported.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-TARGET-XCHGMSG"
+></A
+><H2
+>Communicating with a Device</H2
+><P
+>Once a device has been instantiated it is possible to perform I/O by
+sending messages to the appropriate Tcl script running inside the
+auxiliary, and optionally getting back replies. I/O operations are
+always initiated by the eCos target-side, it is not possible for the
+host-side software to initiate data transfers. However the host-side
+can raise interrupts, and the interrupt handler inside the target can
+then exchange one or more messages with the host.
+    </P
+><P
+>There is a single function to perform I/O operations,
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_xchgmsg</TT
+>. This takes the following
+arguments: 
+    </P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="VARNAME"
+>device_id</TT
+></DT
+><DD
+><P
+>This should be one of the identifiers returned by a previous
+call to <TT
+CLASS="FUNCTION"
+>synth_auxiliary_instantiate</TT
+>, specifying the
+particular device which should perform some I/O.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>request</TT
+></DT
+><DD
+><P
+>Request are just signed 32-bit integers that identify the particular
+I/O operation being requested. There is no fixed set of codes, instead
+each type of device can define its own.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>arg1</TT
+>, <TT
+CLASS="VARNAME"
+>arg2</TT
+></DT
+><DD
+><P
+>For some requests it is convenient to pass one or two additional
+parameters alongside the request code. For example an ethernet device
+could define a multicast-all request, with <TT
+CLASS="VARNAME"
+>arg1</TT
+>
+controlling whether this mode should be enabled or disabled. Both
+<TT
+CLASS="VARNAME"
+>arg1</TT
+> and <TT
+CLASS="VARNAME"
+>arg2</TT
+> should be signed
+32-bit integers, and their values are interpreted only by the
+device-specific Tcl script.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>txdata</TT
+>, <TT
+CLASS="VARNAME"
+>txlen</TT
+></DT
+><DD
+><P
+>Some I/O operations may involve sending additional data, for example
+an ethernet packet. Alternatively a control operation may require many
+more parameters than can easily be encoded in <TT
+CLASS="VARNAME"
+>arg1</TT
+>
+and <TT
+CLASS="VARNAME"
+>arg2</TT
+>, so those parameters have to be placed in
+a suitable buffer and extracted at the other end.
+<TT
+CLASS="VARNAME"
+>txdata</TT
+> is an arbitrary buffer of
+<TT
+CLASS="VARNAME"
+>txlen</TT
+> bytes that should be sent to the host-side.
+There is no specific upper bound on the number of bytes that can be
+sent, but usually it is a good idea to allocate the transmit buffer
+statically and keep transfers down to at most several kilobytes.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>reply</TT
+></DT
+><DD
+><P
+>If the host-side is expected to send a reply message then
+<TT
+CLASS="VARNAME"
+>reply</TT
+> should be a pointer to an integer variable
+and will be updated with a reply code, a simple 32-bit integer. The
+synthetic target HAL code assumes that the host-side and target-side
+agree on the protocol being used: if the host-side will not send a
+reply to this message then the <TT
+CLASS="VARNAME"
+>reply</TT
+> argument
+should be a NULL pointer; otherwise the host-side must always send
+a reply code and the <TT
+CLASS="VARNAME"
+>reply</TT
+> argument must be valid.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>rxdata</TT
+>, <TT
+CLASS="VARNAME"
+>rxlen</TT
+></DT
+><DD
+><P
+>Some operations may involve additional data coming from the host-side,
+for example an incoming ethernet packet. <TT
+CLASS="VARNAME"
+>rxdata</TT
+>
+should be a suitably-sized buffer, and <TT
+CLASS="VARNAME"
+>rxlen</TT
+> a
+pointer to an integer variable that will end up containing the number
+of bytes that were actually received. These arguments will only be
+used if the host-side is expected to send a reply and hence the
+<TT
+CLASS="VARNAME"
+>reply</TT
+> argument was not NULL.
+         </P
+></DD
+><DT
+><TT
+CLASS="VARNAME"
+>max_rxlen</TT
+></DT
+><DD
+><P
+>If a reply to this message is expected and that reply may involve
+additional data, <TT
+CLASS="VARNAME"
+>max_rxlen</TT
+> limits the size of that
+reply. In other words, it corresponds to the size of the
+<TT
+CLASS="VARNAME"
+>rxdata</TT
+> buffer.
+         </P
+></DD
+></DL
+></DIV
+><P
+>Most I/O operations involve only some of the arguments. For example
+transmitting an ethernet packet would use the
+<TT
+CLASS="VARNAME"
+>request</TT
+>, <TT
+CLASS="VARNAME"
+>txdata</TT
+> and
+<TT
+CLASS="VARNAME"
+>txlen</TT
+> fields (in addition to
+<TT
+CLASS="VARNAME"
+>device_id</TT
+> which is always required), but would not
+involve <TT
+CLASS="VARNAME"
+>arg1</TT
+> or <TT
+CLASS="VARNAME"
+>arg2</TT
+> and no
+reply would be expected. Receiving an ethernet packet would involve
+<TT
+CLASS="VARNAME"
+>request</TT
+>, <TT
+CLASS="VARNAME"
+>rxdata</TT
+>,
+<TT
+CLASS="VARNAME"
+>rxlen</TT
+> and <TT
+CLASS="VARNAME"
+>max_rxlen</TT
+>; in addition
+<TT
+CLASS="VARNAME"
+>reply</TT
+> is needed to get any reply from the host-side
+at all, and could be used to indicate whether or not any more packets
+are buffered up. A control operation such as enabling multicast mode
+would involve <TT
+CLASS="VARNAME"
+>request</TT
+> and <TT
+CLASS="VARNAME"
+>arg1</TT
+>,
+but none of the remaining arguments.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-NEW-TARGET-INTERRUPTS"
+></A
+><H2
+>Interrupt Handling</H2
+><P
+>Interrupt handling in the synthetic target is much the same as on a
+real target. An interrupt object is created using
+<TT
+CLASS="FUNCTION"
+>cyg_drv_interrupt_create</TT
+>, attached, and unmasked.
+The emulated device - in other words the Tcl script running inside the
+I/O auxiliary - can raise an interrupt. Subject to interrupts being
+disabled and the appropriate vector being masked, the system will
+invoke the specified ISR function. The synthetic target HAL
+implementation does have some limitations: there is no support for
+nested interrupts, interrupt priorities, or a separate interrupt
+stack. Supporting those might be appropriate when targetting a
+simulator that attempts to model real hardware accurately, but not for
+the simple emulation provided by the synthetic target.
+    </P
+><P
+>Of course the actual implementation of the ISR and DSR functions will
+be rather different for a synthetic target device driver. For real
+hardware the device driver will interact with the device by reading
+and writing device registers, managing DMA engines, and the like. A
+synthetic target driver will instead call
+<TT
+CLASS="FUNCTION"
+>synth_auxiliary_xchgmsg</TT
+> to perform the I/O
+operations.
+    </P
+><P
+>There is one other significant difference between interrupt handling
+on the synthetic target and on real hardware. Usually the eCos code
+will know which interrupt vectors are used for which devices. That
+information is fixed when the target hardware is designed. With the
+synthetic target interrupt vectors are assigned to devices on the host
+side, either via the target definition file or dynamically when the
+device is instantiated. Therefore the initialization code for a
+target-side device driver will need to request interrupt vector
+information from the host-side, via a message exchange. Such interrupt
+vectors will be in the range 1 to 31 inclusive, with interrupt 0 being
+reserved for the real-time clock.
+    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="synth-syscalls.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="hal-synth-arch.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="synth-new-host.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>System Calls</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Writing New Devices - host</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/hal/synth/arch/current/doc/synth-porting.html
+++ b/packages/hal/synth/arch/current/doc/synth-porting.html
@@ -3,9 +3,6 @@
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
 <!-- http://www.opencontent.org/openpub/).                           -->
-<!-- Distribution of substantively modified versions of this         -->
-<!-- document is prohibited without the explicit permission of the   -->
-<!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
 <!-- permission is obtained from the copyright holder.               -->
@@ -16,14 +13,14 @@
 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
 <META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
 "><LINK
 REL="HOME"
 TITLE="eCos Synthetic Target"
 HREF="hal-synth-arch.html"><LINK
 REL="PREVIOUS"
-TITLE="System Calls"
-HREF="synth-syscalls.html"></HEAD
+TITLE="Writing New Devices - host"
+HREF="synth-new-host.html"></HEAD
 ><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
@@ -34,6 +31,7 @@ ALINK="#0000FF"
 ><DIV
 CLASS="NAVHEADER"
 ><TABLE
+SUMMARY="Header navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -50,7 +48,8 @@ WIDTH="10%"
 ALIGN="left"
 VALIGN="bottom"
 ><A
-HREF="synth-syscalls.html"
+HREF="synth-new-host.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -70,17 +69,15 @@ ALIGN="LEFT"
 WIDTH="100%"></DIV
 ><H1
 ><A
-NAME="SYNTH-PORTING"
->Porting</A
-></H1
+NAME="SYNTH-PORTING">Porting</H1
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
-NAME="AEN92"
+NAME="AEN1049"
 ></A
 ><H2
 >Name</H2
->Porting&nbsp;--&nbsp;The eCos synthetic target</DIV
+>Porting&nbsp;--&nbsp;Adding support for other hosts</DIV
 ><DIV
 CLASS="REFSECT1"
 ><A
@@ -96,7 +93,7 @@ straightforward, for example a port to L
 an x86. Porting to Unix or Unix-like operating systems other than
 Linux may be possible, but would involve more effort. Porting to a
 completely different operating system such as Windows would be very
-difficult. The text below completes the eCos Porting Guide.
+difficult. The text below complements the eCos Porting Guide.
     </P
 ></DIV
 ><DIV
@@ -128,12 +125,11 @@ to update the toplevel <TT
 CLASS="FILENAME"
 >ecos.db</TT
 > database with an
-entry for the new HAL package, and a new target entry will be needed
-as well.
+entry for the new HAL package, and a new target entry will be needed.
     </P
 ><P
->Obviously a different processor will have different register sets
-and calling conventions, so the code for saving and restoring thread
+>Obviously a different processor will have different register sets and
+calling conventions, so the code for saving and restoring thread
 contexts and for implementing <TT
 CLASS="FUNCTION"
 >setjmp</TT
@@ -142,20 +138,21 @@ CLASS="FUNCTION"
 CLASS="FUNCTION"
 >longjmp</TT
 > will need to be updated. The exact way of
-performing Linux system calls will also vary: on i386linux this
-usually involves pushing some registers on the stack and then
-executing an <TT
+performing Linux system calls will vary: on x86 linux this usually
+involves pushing some registers on the stack and then executing an
+<TT
 CLASS="LITERAL"
 >int&nbsp;0x080</TT
-> trap instruction, but
-on a different processor the arguments might be passed in registers
-instead and certainly a different trap instruction will be used. The
-startup code is also written in assembler, but needs to do little more
-than jump to the main <TT
+> trap instruction, but on a different
+processor the arguments might be passed in registers instead and
+certainly a different trap instruction will be used. The startup code
+is written in assembler, but needs to do little more than extract the
+process' argument and environment variables and then jump to the main
+<TT
 CLASS="FUNCTION"
 >linux_entry</TT
-> function
-provided by the architectural synthetic target HAL package.
+> function provided by the
+architectural synthetic target HAL package.
     </P
 ><P
 >The header file <TT
@@ -164,7 +161,7 @@ CLASS="FILENAME"
 > provided by the
 architectural HAL package provides various structure definitions,
 function prototypes, and macros related to system calls. These are
-correct for i386linux, but there may be problems on other processors.
+correct for x86 linux, but there may be problems on other processors.
 For example a structure field that is currently defined as a 32-bit
 number may in fact may be a 64-bit number instead.
     </P
@@ -185,7 +182,10 @@ but usually eCos applications can and sh
 ><P
 >Other HAL functionality such as interrupt handling, diagnostics, and
 the system clock are provided by the architectural HAL package and
-should work on different processors with few if any changes.
+should work on different processors with few if any changes. There may
+be some problems in the code that interacts with the I/O auxiliary
+because of lurking assumptions about endianness or the sizes of
+various data types.
     </P
 ><P
 >When porting to other processors, a number of sources of information
@@ -205,11 +205,11 @@ NAME="SYNTH-PORTING-UNIX"
 >Other Unix Platforms</H2
 ><P
 >Porting to a Unix or Unix-like operating system other than Linux would
-be somewhat more involved. The first requirement involves toolchains:
-the GNU compilers, gcc and g++, must definitely be used; use of other
-GNU tools such as the linker may be needed as well, because eCos
-depends on functionality such as prioritizing C++ static constructors,
-and other linkers may not implement this or may implement it in a
+be somewhat more involved. The first requirement is toolchains: the
+GNU compilers, gcc and g++, must definitely be used; use of other GNU
+tools such as the linker may be needed as well, because eCos depends
+on functionality such as prioritizing C++ static constructors, and
+other linkers may not implement this or may implement it in a
 different and incompatible way. A closely related requirement is the
 use of ELF format for binary executables: if the operating system
 still uses an older format such as COFF then there are likely to be
@@ -241,6 +241,16 @@ simple system calls, and instead wrapper
 implemented at the variant HAL level.
     </P
 ><P
+>The generic I/O auxiliary code should be fairly portable to other Unix
+platforms. However some of the device drivers may contain code that is
+specific to Linux, for example the <TT
+CLASS="LITERAL"
+>PF_PACKET</TT
+> socket
+address family and the ethertap virtual tunnelling interface. These
+may prove quite difficult to port.
+    </P
+><P
 >The remaining porting task is to implement one or more platform HAL
 packages, one per processor type that is supported. This should
 involve much the same work as a port to <A
@@ -255,39 +265,6 @@ However there is still a good chance tha
 been ported already, so its source code may contain much useful
 information. 
     </P
-><DIV
-CLASS="CAUTION"
-><P
-></P
-><TABLE
-CLASS="CAUTION"
-BORDER="1"
-WIDTH="100%"
-><TR
-><TD
-ALIGN="CENTER"
-><B
->Caution</B
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-><P
->Users should be aware that future enhancements to the synthetic target
-code, especially in areas related to I/O, may be much more closely
-tied to Linux. For example access to ethernet facilities might be
-implemented using the <TT
-CLASS="LITERAL"
->PF_PACKET</TT
-> socket address
-family, or the virtual tunnelling interface. Porting such code to
-other Unix operating systems may prove rather more difficult.
-    </P
-></TD
-></TR
-></TABLE
-></DIV
 ></DIV
 ><DIV
 CLASS="REFSECT1"
@@ -348,6 +325,7 @@ CLASS="NAVFOOTER"
 ><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -358,7 +336,8 @@ WIDTH="33%"
 ALIGN="left"
 VALIGN="top"
 ><A
-HREF="synth-syscalls.html"
+HREF="synth-new-host.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -367,6 +346,7 @@ ALIGN="center"
 VALIGN="top"
 ><A
 HREF="hal-synth-arch.html"
+ACCESSKEY="H"
 >Home</A
 ></TD
 ><TD
@@ -380,7 +360,7 @@ VALIGN="top"
 WIDTH="33%"
 ALIGN="left"
 VALIGN="top"
->System Calls</TD
+>Writing New Devices - host</TD
 ><TD
 WIDTH="34%"
 ALIGN="center"
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/doc/synth-running.html
@@ -0,0 +1,964 @@
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/).                           -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Running a Synthetic Target Application</TITLE
+><meta name="MSSmartTagsPreventParsing" content="TRUE">
+<META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="eCos Synthetic Target"
+HREF="hal-synth-arch.html"><LINK
+REL="PREVIOUS"
+TITLE="Installation"
+HREF="synth-install.html"><LINK
+REL="NEXT"
+TITLE="The I/O Auxiliary's User Interface"
+HREF="synth-gui.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>eCos Synthetic Target</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="synth-install.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="synth-gui.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SYNTH-RUNNING">Running a Synthetic Target Application</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN95"
+></A
+><H2
+>Name</H2
+>Execution&nbsp;--&nbsp;Arguments and configuration files</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-RUNNING-DESCRIPTION"
+></A
+><H2
+>Description</H2
+><P
+>The procedure for configuring and building eCos and an application for
+the synthetic target is the same as for any other eCos target. Once an
+executable has been built it can be run like any Linux program, for
+example from a shell prompt,
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ ecos_hello &lt;options&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+>or using gdb:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ gdb --nw --quiet --args ecos_hello &lt;options&gt;
+(gdb) run
+Starting program: ecos_hello &lt;options&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+>By default use of the I/O auxiliary is disabled. If its I/O facilities
+are required then the option <TT
+CLASS="OPTION"
+>--io</TT
+> must be used.
+    </P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>In future the default behaviour may change, with the I/O auxiliary
+being started by default. The option <TT
+CLASS="OPTION"
+>--nio</TT
+> can be
+used to prevent the auxiliary from being run.
+    </P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-RUNNING-ARGUMENTS"
+></A
+><H2
+>Command-line Arguments</H2
+><P
+>The syntax for running a synthetic target application is:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ &lt;ecos_app&gt; [options] [-- [app_options]]</PRE
+></TD
+></TR
+></TABLE
+><P
+>Command line options up to the <TT
+CLASS="OPTION"
+>--</TT
+> are passed on to
+the I/O auxiliary. Subsequent arguments are not passed on to the
+auxiliary, and hence can be used by the eCos application itself. The
+full set of arguments can be accessed through the variables
+<TT
+CLASS="VARNAME"
+>cyg_hal_sys_argc</TT
+> and
+<TT
+CLASS="VARNAME"
+>cyg_hal_sys_argv</TT
+>. 
+    </P
+><P
+>The following options are accepted as standard:
+    </P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="OPTION"
+>--io</TT
+></DT
+><DD
+><P
+>This option causes the eCos application to spawn the I/O auxiliary
+during HAL initialization. Without this option only limited I/O will
+be available.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>--nio</TT
+></DT
+><DD
+><P
+>This option prevents the eCos application from spawning the I/O
+auxiliary. In the current version of the software this is the default.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-nw</TT
+>, <TT
+CLASS="OPTION"
+>--no-windows</TT
+></DT
+><DD
+><P
+>The I/O auxiliary can either provide a graphical user interface, or it
+can run in a text-only mode. The default is to provide the graphical
+interface, but this can be disabled with <TT
+CLASS="OPTION"
+>-nw</TT
+>.
+Emulation of some devices, for example buttons connected to digital
+inputs, requires the graphical interface.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-w</TT
+>, <TT
+CLASS="OPTION"
+>--windows</TT
+></DT
+><DD
+><P
+>The <TT
+CLASS="OPTION"
+>-w</TT
+> causes the I/O auxiliary to provide a
+graphical user interface. This is the default.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-v</TT
+>, <TT
+CLASS="OPTION"
+>--version</TT
+></DT
+><DD
+><P
+>The <TT
+CLASS="OPTION"
+>-v</TT
+> option can be used to determine the version of
+the I/O auxiliary being used and where it has been installed. Both the
+auxiliary and the eCos application will exit immediately.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-h</TT
+>, <TT
+CLASS="OPTION"
+>--help</TT
+></DT
+><DD
+><P
+><TT
+CLASS="OPTION"
+>-h</TT
+> causes the I/O auxiliary to list all accepted
+command-line arguments. This happens after all devices have been
+initialized, since the host-side support for some of the devices may
+extend the list of recognised options. After this both the auxiliary
+and the eCos application will exit immediately. This option implies
+<TT
+CLASS="OPTION"
+>-nw</TT
+>. 
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-k</TT
+>, <TT
+CLASS="OPTION"
+>--keep-going</TT
+></DT
+><DD
+><P
+>If an error occurs in the I/O auxiliary while reading in any of the
+configuration files or initializing devices, by default both the 
+auxiliary and the eCos application will exit. The <TT
+CLASS="OPTION"
+>-k</TT
+>
+option can be used to make the auxiliary continue in spite of errors,
+although obviously it may not be fully functional.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-nr</TT
+>, <TT
+CLASS="OPTION"
+>--no-rc</TT
+></DT
+><DD
+><P
+>Normally the auxiliary processes two <A
+HREF="synth-running.html#SYNTH-RUNNING-USER-CONFIG"
+>user configuration files</A
+>
+during startup: <TT
+CLASS="FILENAME"
+>initrc.tcl</TT
+> and
+<TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+>. This can be suppressed using the
+<TT
+CLASS="OPTION"
+>-nr</TT
+> option.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-x</TT
+>, <TT
+CLASS="OPTION"
+>--exit</TT
+></DT
+><DD
+><P
+>When providing a graphical user interface the I/O auxiliary will
+normally continue running even after the eCos application has exited.
+This allows the user to take actions such as saving the current
+contents of the main text window. If run with <TT
+CLASS="OPTION"
+>-x</TT
+> then
+the auxiliary will exit as soon the application exits.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-nx</TT
+>, <TT
+CLASS="OPTION"
+>--no-exit</TT
+></DT
+><DD
+><P
+>When the graphical user interface is disabled with
+<TT
+CLASS="OPTION"
+>-nw</TT
+> the I/O auxiliary will normally exit immediately
+when the eCos application exits. Without the graphical frontend there
+is usually no way for the user to interact directly with the
+auxiliary, so there is no point in continuing to run once the eCos
+application will no longer request any I/O operations. Specifying the
+<TT
+CLASS="OPTION"
+>-nx</TT
+> option causes the auxiliary to continue running
+even after the application has exited.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-V</TT
+>, <TT
+CLASS="OPTION"
+>--verbose</TT
+></DT
+><DD
+><P
+>This option causes the I/O auxiliary to output some additional
+information, especially during initialization.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-l &lt;file&gt;</TT
+>, <TT
+CLASS="OPTION"
+>--logfile &lt;file&gt;</TT
+></DT
+><DD
+><P
+>Much of the output of the eCos application and the I/O auxiliary is
+simple text, for example resulting from eCos
+<TT
+CLASS="FUNCTION"
+>printf</TT
+> or <TT
+CLASS="FUNCTION"
+>diag_printf</TT
+> calls.
+When running in graphical mode this output goes to a central text
+window, and can be saved to a file or edited via menus. The
+<TT
+CLASS="OPTION"
+>-l</TT
+> can be used to automatically generate an
+additional logfile containing all the text. If graphical
+mode is disabled then by default all the text just goes to the current
+standard output. Specifying <TT
+CLASS="OPTION"
+>-l</TT
+> causes most of the
+text to go into a logfile instead, although some messages such as
+errors generated by the auxiliary itself will still go to stdout as
+well. 
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-t &lt;file&gt;</TT
+>, <TT
+CLASS="OPTION"
+>--target &lt;file&gt;</TT
+></DT
+><DD
+><P
+>During initialization the I/O auxiliary reads in a target definition
+file. This file holds information such as which Linux devices should
+be used to emulate the various eCos devices. The <TT
+CLASS="OPTION"
+>-t</TT
+>
+option can be used to specify which target definition should be used
+for the current run, defaulting to <TT
+CLASS="FILENAME"
+>default.tdf</TT
+>.
+It is not necessary to include the <TT
+CLASS="FILENAME"
+>.tdf</TT
+> suffix,
+this will be appended automatically if necessary.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-geometry &lt;geometry&gt;</TT
+></DT
+><DD
+><P
+>This option can be used to control the size and position of the main
+window, as per X conventions.
+         </P
+></DD
+></DL
+></DIV
+><P
+>The I/O auxiliary loads support for the various devices dynamically
+and some devices may accept additional command line arguments. Details
+of these can be obtained using the <TT
+CLASS="OPTION"
+>-h</TT
+> option or by
+consulting the device-specific documentation. If an unrecognised
+command line argument is used then a warning will be issued.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-RUNNING-TDF"
+></A
+><H2
+>The Target Definition File</H2
+><P
+>The eCos application will want to access devices such as
+<TT
+CLASS="VARNAME"
+>eth0</TT
+> or <TT
+CLASS="VARNAME"
+>/dev/ser0</TT
+>. These need to
+be mapped on to Linux devices. For example some users may all traffic
+on the eCos <TT
+CLASS="VARNAME"
+>/dev/ser0</TT
+> serial device to go via the
+Linux serial device <TT
+CLASS="VARNAME"
+>/dev/ttyS1</TT
+>, while ethernet I/O
+for the eCos <TT
+CLASS="VARNAME"
+>eth0</TT
+> device should be mapped to the
+Linux ethertap device <TT
+CLASS="VARNAME"
+>tap3</TT
+>. Some devices may need
+additional configuration information, for example to limit the
+number of packets that should be buffered within the I/O auxiliary.
+The target definition file provides all this information.
+    </P
+><P
+>By default the I/O auxiliary will look for a file
+<TT
+CLASS="FILENAME"
+>default.tdf</TT
+>. An alternative target definition can
+be specified on the command line using <TT
+CLASS="OPTION"
+>-t</TT
+>, for
+example:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ bridge_app --io -t twineth</PRE
+></TD
+></TR
+></TABLE
+><P
+>A <TT
+CLASS="FILENAME"
+>.tdf</TT
+> suffix will be appended automatically if
+necessary. If a relative pathname is used then the I/O auxiliary will
+search for the target definition file in the current directory, then
+in <TT
+CLASS="FILENAME"
+>~/.ecos/synth/</TT
+>, and finally
+in its install location.
+    </P
+><P
+>A typical target definition file might look like this:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device console {
+    # appearance -foreground white -background black
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+}
+
+synth_device ethernet {
+    eth0 real eth1
+    eth1 ethertap tap4 00:01:02:03:FE:06
+
+    ## Maximum number of packets that should be buffered per interface.
+    ## Default 16
+    #max_buffer 32
+
+    ## Filters for the various recognised protocols.
+    ## By default all filters are visible and use standard colours.
+    filter ether  -hide 0
+    #filter arp    -hide 1
+    #filter ipv4   -hide 1
+    #filter ipv6   -hide 1
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>A target definition file is actually a Tcl script that gets run in the
+main interpreter of the I/O auxiliary during initialization. This
+provides a lot of flexibility if necessary. For example the script
+could open a socket to a resource management server of some sort to
+determine which hardware facilities are already in use and adapt
+accordingly. Another possibility is to adapt based on <A
+HREF="synth-new-host.html#SYNTH-NEW-HOST-ARGS"
+>command line arguments</A
+>. Users who
+are not familiar with Tcl programming should still be able to edit a
+simple target definition file without too much difficulty, using a
+mixture of cut'n'paste, commenting or uncommenting various lines, and
+making small edits such as changing <TT
+CLASS="LITERAL"
+>tap4</TT
+> to
+<TT
+CLASS="LITERAL"
+>eth2</TT
+>. 
+    </P
+><P
+>Each type of device will have its own entry in the target definition
+file, taking the form:
+    </P
+><TABLE
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>synth_device &lt;device type&gt; {
+    &lt;options&gt;
+}</PRE
+></TD
+></TR
+></TABLE
+><P
+>The documentaton for each synthetic target device should provide
+details of the options available for that device, and often a suitable
+fragment that can be pasted into a target definition file and edited.
+There is no specific set of options that a given device will always
+provide. However in practice many devices will use common code
+exported by the main I/O auxiliary, or their implementation will
+involve some re-use of code for an existing device. Hence certain
+types of option are common to many devices.
+    </P
+><P
+>A good example of this is filters, which control the appearance of
+text output. The above target definition file defines a filter
+<TT
+CLASS="VARNAME"
+>trace</TT
+> for output from the eCos application. The
+regular expression will match output from the infrastructure package's
+tracing facilities when <TT
+CLASS="VARNAME"
+>CYGDBG_USE_TRACING</TT
+> and
+<TT
+CLASS="VARNAME"
+>CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE</TT
+> are enabled.
+With the current settings this output will not be visible by default,
+but can be made visible using the menu item <SPAN
+CLASS="GUIMENUITEM"
+>System
+Filters</SPAN
+>. If made visible the trace output will appear in
+an unusual colour, so users can easily distinguish the trace output
+from other text. All filters accept the following options:
+    </P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="OPTION"
+>-hide [0|1]</TT
+></DT
+><DD
+><P
+>This controls whether or not text matching this filter should be
+invisible by default or not. At run-time the visibility of each filter
+can be controlled using the <SPAN
+CLASS="GUIMENUITEM"
+>System Filters</SPAN
+>
+menu item.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-foreground &lt;colour&gt;</TT
+></DT
+><DD
+><P
+>This specifies the foreground colour for all text matching this
+filter. The colour can be specified using an RGB value such as
+<TT
+CLASS="LITERAL"
+>#F08010</TT
+>, or a symbolic name such as
+<TT
+CLASS="LITERAL"
+>"light steel blue"</TT
+>. The X11 utility
+<SPAN
+CLASS="APPLICATION"
+>showrgb</SPAN
+> can be used to find out
+about the available colours.
+         </P
+></DD
+><DT
+><TT
+CLASS="OPTION"
+>-background &lt;colour&gt;</TT
+></DT
+><DD
+><P
+>This specifies the background colour for all text matching the filter.
+As with <TT
+CLASS="OPTION"
+>-foreground</TT
+> the colour can be specified using
+a symbolic name or an RGB value.
+         </P
+></DD
+></DL
+></DIV
+><P
+>Some devices may create their own subwindows, for example to monitor
+ethernet traffic or to provide additional I/O facilities such as
+emulated LED's or buttons. Usually the target definition file can be
+used to control the <A
+HREF="synth-gui.html#SYNTH-GUI-LAYOUT"
+>layout</A
+> of
+these windows.
+    </P
+><P
+>The I/O auxiliary will not normally warn about
+<B
+CLASS="COMMAND"
+>synth_device</B
+> entries in the target definition file
+for devices that are not actually needed by the current eCos
+application. This makes it easier to use a single file for several
+different applications. However it can lead to confusion if an entry
+is spelled incorrectly and hence does not actually get used. The
+<TT
+CLASS="OPTION"
+>-V</TT
+> command line option can be used to get warnings
+about unused device entries in the target definition file.
+    </P
+><P
+>If the body of a <B
+CLASS="COMMAND"
+>synth_device</B
+> command contains an
+unrecognised option and the relevant device is in use, the I/O
+auxiliary will always issue a warning about such options.
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-RUNNING-USER-CONFIG"
+></A
+><H2
+>User Configuration Files</H2
+><P
+>During initialization the I/O auxiliary will execute two user
+configuration files, <TT
+CLASS="FILENAME"
+>initrc.tcl</TT
+> and
+<TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+>. It will look for these files in the
+directory <TT
+CLASS="FILENAME"
+>~/.ecos/synth/</TT
+>. If
+that directory does not yet exist it will be created and populated
+with initial dummy files.
+    </P
+><P
+>Both of these configuration files are Tcl scripts and will be run in
+the main interpreter used by the I/O auxiliary itself. This means that
+they have full access to the internals of the auxiliary including the
+various Tk widgets, and they can perform file or socket I/O if
+desired. The section <A
+HREF="synth-new-host.html"
+>Writing New Devices - host</A
+> contains
+information about the facilities available on the host-side for
+writing new device drivers, and these can also be used in the
+initialization scripts.
+    </P
+><P
+>The <TT
+CLASS="FILENAME"
+>initrc.tcl</TT
+> script is run before the auxiliary
+has processed any requests from the eCos application, and hence before
+any devices have been instantiated. At this point the generic
+command-line arguments has been processed, the target definition file
+has been read in, and the hooks functionality has been initialized. If
+running in graphical mode the main window will have been created, but
+has been withdrawn from the screen to allow new widgets to be added
+without annoying screen flicker. A typical
+<TT
+CLASS="FILENAME"
+>initrc.tcl</TT
+> script could add some menu or toolbar
+options, or install a hook function that will be run when the
+eCos application exits.
+    </P
+><P
+>The <TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+> script is run after eCos has
+performed all its device initialization and after C++ static
+constructors have run, and just before the call to
+<TT
+CLASS="FUNCTION"
+>cyg_start</TT
+> which will end up transferring control
+to the application itself. A typical <TT
+CLASS="FILENAME"
+>mainrc.tcl</TT
+>
+script could look at what interrupt vectors have been allocated to
+which devices and create a little monitor window that shows interrupt
+activity. 
+    </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SYNTH-RUNNING-SESSION"
+></A
+><H2
+>Session Information</H2
+><P
+>When running in graphical mode, the I/O auxiliary will read in a file
+<TT
+CLASS="FILENAME"
+>~/.ecos/synth/guisession</TT
+> containing session
+information. This file should not normally be edited manually, instead
+it gets updated automatically when the auxiliary exits. The purpose of
+this file is to hold configuration options that are manipulated via
+the graphical interface, for example which browser should be used to
+display online help.
+    </P
+><DIV
+CLASS="WARNING"
+><P
+></P
+><TABLE
+CLASS="WARNING"
+BORDER="1"
+WIDTH="100%"
+><TR
+><TD
+ALIGN="CENTER"
+><B
+>Warning</B
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+><P
+>GUI session functionality is not yet available in the current release.
+When that functionality is fully implemented it is possible that some
+target definition file options may be removed, to be replaced by
+graphical editing via a suitable preferences dialog, with the
+current settings saved in the session file.
+    </P
+></TD
+></TR
+></TABLE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="synth-install.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="hal-synth-arch.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="synth-gui.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Installation</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>The I/O Auxiliary's User Interface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/hal/synth/arch/current/doc/synth-syscalls.html
+++ b/packages/hal/synth/arch/current/doc/synth-syscalls.html
@@ -3,9 +3,6 @@
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
 <!-- http://www.opencontent.org/openpub/).                           -->
-<!-- Distribution of substantively modified versions of this         -->
-<!-- document is prohibited without the explicit permission of the   -->
-<!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
 <!-- permission is obtained from the copyright holder.               -->
@@ -16,17 +13,17 @@
 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
 <META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
 "><LINK
 REL="HOME"
 TITLE="eCos Synthetic Target"
 HREF="hal-synth-arch.html"><LINK
 REL="PREVIOUS"
-TITLE="Overview"
-HREF="synth.html"><LINK
+TITLE="The Console Device"
+HREF="synth-console.html"><LINK
 REL="NEXT"
-TITLE="Porting"
-HREF="synth-porting.html"></HEAD
+TITLE="Writing New Devices - target"
+HREF="synth-new-target.html"></HEAD
 ><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
@@ -37,6 +34,7 @@ ALINK="#0000FF"
 ><DIV
 CLASS="NAVHEADER"
 ><TABLE
+SUMMARY="Header navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -53,7 +51,8 @@ WIDTH="10%"
 ALIGN="left"
 VALIGN="bottom"
 ><A
-HREF="synth.html"
+HREF="synth-console.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -66,7 +65,8 @@ WIDTH="10%"
 ALIGN="right"
 VALIGN="bottom"
 ><A
-HREF="synth-porting.html"
+HREF="synth-new-target.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -76,13 +76,11 @@ ALIGN="LEFT"
 WIDTH="100%"></DIV
 ><H1
 ><A
-NAME="SYNTH-SYSCALLS"
->System Calls</A
-></H1
+NAME="SYNTH-SYSCALLS">System Calls</H1
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
-NAME="AEN51"
+NAME="AEN483"
 ></A
 ><H2
 >Name</H2
@@ -90,21 +88,17 @@ NAME="AEN51"
 ><DIV
 CLASS="REFSYNOPSISDIV"
 ><A
-NAME="AEN54"
-></A
-><H2
+NAME="AEN486"><H2
 >Synopsis</H2
 ><DIV
 CLASS="FUNCSYNOPSIS"
 ><A
-NAME="AEN55"
-></A
-><P
+NAME="AEN487"><P
 ></P
 ><TABLE
-BORDER="0"
-BGCOLOR="#E0E0E0"
-WIDTH="100%"
+BORDER="5"
+BGCOLOR="#E0E0F0"
+WIDTH="70%"
 ><TR
 ><TD
 ><PRE
@@ -118,7 +112,7 @@ CLASS="FUNCSYNOPSISINFO"
 ><CODE
 ><CODE
 CLASS="FUNCDEF"
->int cyg_hal_sys_xyz</CODE
+>int cyg_hal_sys_xyzzy</CODE
 >(...);</CODE
 ></P
 ><P
@@ -281,6 +275,7 @@ CLASS="NAVFOOTER"
 ><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -291,7 +286,8 @@ WIDTH="33%"
 ALIGN="left"
 VALIGN="top"
 ><A
-HREF="synth.html"
+HREF="synth-console.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -300,6 +296,7 @@ ALIGN="center"
 VALIGN="top"
 ><A
 HREF="hal-synth-arch.html"
+ACCESSKEY="H"
 >Home</A
 ></TD
 ><TD
@@ -307,7 +304,8 @@ WIDTH="33%"
 ALIGN="right"
 VALIGN="top"
 ><A
-HREF="synth-porting.html"
+HREF="synth-new-target.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -316,7 +314,7 @@ HREF="synth-porting.html"
 WIDTH="33%"
 ALIGN="left"
 VALIGN="top"
->Overview</TD
+>The Console Device</TD
 ><TD
 WIDTH="34%"
 ALIGN="center"
@@ -326,7 +324,7 @@ VALIGN="top"
 WIDTH="33%"
 ALIGN="right"
 VALIGN="top"
->Porting</TD
+>Writing New Devices - target</TD
 ></TR
 ></TABLE
 ></DIV
--- a/packages/hal/synth/arch/current/doc/synth.html
+++ b/packages/hal/synth/arch/current/doc/synth.html
@@ -3,9 +3,6 @@
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
 <!-- http://www.opencontent.org/openpub/).                           -->
-<!-- Distribution of substantively modified versions of this         -->
-<!-- document is prohibited without the explicit permission of the   -->
-<!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
 <!-- permission is obtained from the copyright holder.               -->
@@ -16,7 +13,7 @@
 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
 <META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
 "><LINK
 REL="HOME"
 TITLE="eCos Synthetic Target"
@@ -25,8 +22,8 @@ REL="PREVIOUS"
 TITLE="eCos Synthetic Target"
 HREF="hal-synth-arch.html"><LINK
 REL="NEXT"
-TITLE="System Calls"
-HREF="synth-syscalls.html"></HEAD
+TITLE="Installation"
+HREF="synth-install.html"></HEAD
 ><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
@@ -37,6 +34,7 @@ ALINK="#0000FF"
 ><DIV
 CLASS="NAVHEADER"
 ><TABLE
+SUMMARY="Header navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -54,6 +52,7 @@ ALIGN="left"
 VALIGN="bottom"
 ><A
 HREF="hal-synth-arch.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -66,7 +65,8 @@ WIDTH="10%"
 ALIGN="right"
 VALIGN="bottom"
 ><A
-HREF="synth-syscalls.html"
+HREF="synth-install.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -76,9 +76,7 @@ ALIGN="LEFT"
 WIDTH="100%"></DIV
 ><H1
 ><A
-NAME="SYNTH"
->Overview</A
-></H1
+NAME="SYNTH">Overview</H1
 ><DIV
 CLASS="REFNAMEDIV"
 ><A
@@ -86,7 +84,7 @@ NAME="AEN6"
 ></A
 ><H2
 >Name</H2
->Overview&nbsp;--&nbsp;The eCos synthetic target</DIV
+>The eCos synthetic target&nbsp;--&nbsp;Overview</DIV
 ><DIV
 CLASS="REFSECT1"
 ><A
@@ -106,13 +104,13 @@ hardware. Such boards have a number of t
 TYPE="1"
 ><LI
 ><P
->Obviously there has to be at least one processor to do the work.
-Usually this will be a 32-bit processor, but it can be smaller or
-larger. Processor speed will vary widely, depending on the expected
-needs of the application. However usually the exact processor being
-used does not matter very much for most of the development process:
-the use of languages such as C or C++ means that the compiler will
-handle those details.
+>Obviously there has to be at least one processor to do the work. Often
+this will be a 32-bit processor, but it can be smaller or larger.
+Processor speed will vary widely, depending on the expected needs of
+the application. However the exact processor being used tends not to
+matter very much for most of the development process: the use of
+languages such as C or C++ means that the compiler will handle those
+details.
       </P
 ></LI
 ><LI
@@ -161,18 +159,52 @@ Instead of running the embedded applicat
 target board of some sort, it can be run as a Linux process. The
 processor will be the PC's own processor, for example an x86, and the
 memory will be the process' address space. Some I/O facilities can be
-emulated through system calls. For example clock hardware can be
-emulated by setting up a <TT
+emulated directly through system calls. For example clock hardware can
+be emulated by setting up a <TT
 CLASS="LITERAL"
 >SIGALRM</TT
-> signal, which will
-cause the process to be interrupted at regular intervals. This
-emulation of real hardware will not be particularly accurate, for
-example the number of cpu cycles available to the eCos application
-between clock ticks will vary widely depending on what else is running
-on the PC, but for much development work it will be good enough.
+> signal, which
+will cause the process to be interrupted at regular intervals. This
+emulation of real hardware will not be particularly accurate, the
+number of cpu cycles available to the eCos application between clock
+ticks will vary widely depending on what else is running on the PC,
+but for much development work it will be good enough.
     </P
 ><P
+>Other I/O facilities are provided through an I/O auxiliary process,
+ecosynth, that gets spawned by the eCos application during startup.
+When an eCos device driver wants to perform some I/O operation, for
+example send out an ethernet packet, it sends a request to the I/O
+auxiliary. That is an ordinary Linux application so it has ready
+access to all normal Linux I/O facilities. To emulate a device
+interrupt the I/O auxiliary can raise a <TT
+CLASS="LITERAL"
+>SIGIO</TT
+>
+signal within the eCos application. The HAL's interrupt subsystem
+installs a signal handler for this, which will then invoke the
+standard eCos ISR/DSR mechanisms. The I/O auxiliary is based around
+Tcl scripting, making it easy to extend and customize. It should be
+possible to configure the synthetic target so that its I/O
+functionality is similar to what will be available on the final target
+hardware for the application being developed.
+    </P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN25"><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="overview.gif"
+ALIGN="CENTER"></P
+></DIV
+><P
+></P
+></DIV
+><P
 >A key requirement for synthetic target code is that the embedded
 application must not be linked with any of the standard Linux
 libraries such as the GNU C library: that would lead to a confusing
@@ -209,12 +241,20 @@ arguments on to the stack and executes t
 kernel cannot tell the difference, so it will perform the I/O
 operation requested by the synthetic target. With appropriate
 knowledge of what system calls are available, this makes it possible
-to emulate the required I/O facilities. For example diagnostic output
-can be achieved by a <TT
+to emulate the required I/O facilities. For example, spawning the
+ecosynth I/O auxiliary involves system calls
+<TT
+CLASS="FUNCTION"
+>cyg_hal_sys_fork</TT
+> and
+<TT
+CLASS="FUNCTION"
+>cyg_hal_sys_execve</TT
+>, and sending a request to the
+auxiliary uses <TT
 CLASS="FUNCTION"
 >cyg_hal_sys_write</TT
-> system
-call using file descriptor 1, which corresponds to stdout.
+>.
     </P
 ><P
 >In many ways developing for the synthetic target is no different from
@@ -268,125 +308,13 @@ simulator or special tools. This will be
 simpler than using an architectural simulator, but no attempt is made
 to accurately match the behaviour of a real embedded target.
     </P
-><DIV
-CLASS="NOTE"
-><BLOCKQUOTE
-CLASS="NOTE"
-><P
-><B
->Note: </B
->Support for emulating standard hardware such as ethernet is not yet
-available in the current release of the eCos synthetic target code,
-but is planned for future versions. Emulating application-specific
-custom hardware is rather more difficult since there is no way of
-knowing just what strange hardware a particular application might
-need, but the I/O mechanisms planned should allow for
-application-specific extensions.
-    </P
-></BLOCKQUOTE
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="SYNTH-TOOLS"
-></A
-><H2
->Toolchain</H2
-><P
->When developing eCos applications for a normal embedded target it is
-necessary to use a suitable cross-compiler and related tools such as
-the linker. Developing for the synthetic target is easier because you
-can just use the standard GNU tools (gcc, g++, ld, &#8230;) which
-were provided with your Linux distribution, or which you used to build
-your own Linux setup. Any reasonably recent version of the tools, for
-example gcc 2.96(Red Hat) as shipped with Red Hat Linux 7, should be
-sufficient.
-    </P
-><P
->There is one important limitation when using these tools: current gdb
-will not support debugging of eCos threads on the synthetic target. As
-far as gdb is concerned a synthetic target application is also
-indistinguishable from a normal Linux application, so it assumes that
-any threads will be created by calls to the Linux
-<TT
-CLASS="FUNCTION"
->pthread_create</TT
-> function provided by the C
-library. Obviously this is not the case since the application is never
-linked with that library. Therefore gdb never notices the eCos thread
-mechanisms and assumes the application is single-threaded. Fixing this
-is possible but would involve non-trivial changes to gdb.
-    </P
-><P
->Theoretically it is possible to develop synthetic target applications
-on, for example, a PC running Windows and then run the resulting
-executables on another machine that runs Linux. This is rarely useful:
-if a Linux machine is available then usually that machine will also be
-used for building ecos and the application. However, if for some
-reason it is necessary or desirable to build on another machine then
-this requires a suitable cross-compiler and related tools. If the
-application will be running on a typical PC with an x86 processor then
-a suitable configure triplet would be
-<TT
-CLASS="USERINPUT"
-><B
->i686-pc-linux-gnu</B
-></TT
->. The installation
-instructions for the various GNU tools should be consulted for further
-information. 
-    </P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="SYNTH-HARDWARE"
-></A
-><H2
->Hardware Preparation</H2
-><P
->Preparing a real embedded target for eCos development can be tricky.
-Often the first step is to install suitable firmware, usually RedBoot.
-This means creating and building a special configuration for eCos with
-the RedBoot template, then somehow updating the target's flash chips
-with the resulting RedBoot image. Typically it will also be necessary
-to get a working serial connection, and possibly set up ethernet as
-well. Although usually none of the individual steps are particularly
-complicated, there are plenty of ways in which things can go wrong and
-it can be hard to figure out what is actually happening. Of course
-some board manufacturers make life easier for their developers by
-shipping hardware with RedBoot preinstalled, but even then it is still
-necessary to set up communication between host and target.
-    </P
-><P
->None of this is applicable to the synthetic target. Instead you can
-just build a normal eCos configuration, link your application with the
-resulting libraries, and you end up with an executable that you can
-run directly on your Linux machine or via gdb. A useful side effect of
-this is that application development can start before any real
-embedded hardware is actually available.
-    </P
-><P
->Typically the memory map for a synthetic target application will be
-set up such that there is a read-only ROM region containing all the
-code and constant data, and a read-write RAM region for the data. The
-default locations and sizes of these regions depend on the specific
-platform being used for development. Note that the application always
-executes out of ROM: on a real embedded target much of the development
-would involve running RedBoot firmware there, with application code
-and data loaded into RAM; usually this would change for the final
-system; the firmware would be removed; and the application itself
-would execute from ROM and perform the appropriate hardware
-initialization. Therefore the synthetic target actually emulates the
-behaviour of the final system, not the development environment.
-    </P
 ></DIV
 ><DIV
 CLASS="NAVFOOTER"
 ><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -398,6 +326,7 @@ ALIGN="left"
 VALIGN="top"
 ><A
 HREF="hal-synth-arch.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -406,6 +335,7 @@ ALIGN="center"
 VALIGN="top"
 ><A
 HREF="hal-synth-arch.html"
+ACCESSKEY="H"
 >Home</A
 ></TD
 ><TD
@@ -413,7 +343,8 @@ WIDTH="33%"
 ALIGN="right"
 VALIGN="top"
 ><A
-HREF="synth-syscalls.html"
+HREF="synth-install.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -432,7 +363,7 @@ VALIGN="top"
 WIDTH="33%"
 ALIGN="right"
 VALIGN="top"
->System Calls</TD
+>Installation</TD
 ></TR
 ></TABLE
 ></DIV
--- a/packages/hal/synth/arch/current/doc/synth.sgml
+++ b/packages/hal/synth/arch/current/doc/synth.sgml
@@ -9,38 +9,22 @@
 <!--     Synthetic target architectural documentation.               -->
 <!--                                                                 -->
 <!-- =============================================================== -->
-#####ECOSGPLCOPYRIGHTBEGIN####
-## -------------------------------------------
-## This file is part of eCos, the Embedded Configurable Operating System.
-## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-##
-## eCos is free software; you can redistribute it and/or modify it under
-## the terms of the GNU General Public License as published by the Free
-## Software Foundation; either version 2 or (at your option) any later version.
-##
-## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
-## WARRANTY; without even the implied warranty of MERCHANTABILITY or
-## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-## for more details.
-##
-## You should have received a copy of the GNU General Public License along
-## with eCos; if not, write to the Free Software Foundation, Inc.,
-## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-##
-## As a special exception, if other files instantiate templates or use macros
-## or inline functions from this file, or you compile this file and link it
-## with other works to produce a work based on this file, this file does not
-## by itself cause the resulting work to be covered by the GNU General Public
-## License. However the source code for this file must still be made available
-## in accordance with section (3) of the GNU General Public License.
-##
-## This exception does not invalidate any other reasons why a work based on
-## this file might be covered by the GNU General Public License.
-##
-## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
-## at http://sources.redhat.com/ecos/ecos-license/
-## -------------------------------------------
-#####ECOSGPLCOPYRIGHTEND####
+<!-- ####COPYRIGHTBEGIN####                                          -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+<!-- Copyright (C) 2002 Bart Veer.                                   -->
+<!-- Copyright (C) 2002 Red Hat, Inc.                                -->
+<!-- This material may be distributed only subject to the terms      -->
+<!-- and conditions set forth in the Open Publication License, v1.0  -->
+<!-- or later (the latest version is presently available at          -->
+<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- Distribution of the work or derivative of the work in any       -->
+<!-- standard (paper) book form is prohibited unless prior           -->
+<!-- permission obtained from the copyright holder                   -->
+<!-- =============================================================== -->
+<!--                                                                 -->      
+<!-- ####COPYRIGHTEND####                                            -->
+<!-- =============================================================== -->
 <!-- =============================================================== -->
 <!-- #####DESCRIPTIONBEGIN####                                       -->
 <!--                                                                 -->
@@ -63,8 +47,8 @@
     <refentrytitle>Overview</refentrytitle>
   </refmeta>
   <refnamediv>
-    <refname>Overview</refname>
-    <refpurpose>The eCos synthetic target</refpurpose>
+    <refname>The eCos synthetic target</refname>
+    <refpurpose>Overview</refpurpose>
   </refnamediv>
 
   <refsect1 id="synth-description"><title>Description</title>
@@ -76,13 +60,13 @@ hardware. Such boards have a number of t
     </para>
     <orderedlist>
       <listitem><para>
-Obviously there has to be at least one processor to do the work.
-Usually this will be a 32-bit processor, but it can be smaller or
-larger. Processor speed will vary widely, depending on the expected
-needs of the application. However usually the exact processor being
-used does not matter very much for most of the development process:
-the use of languages such as C or C++ means that the compiler will
-handle those details.
+Obviously there has to be at least one processor to do the work. Often
+this will be a 32-bit processor, but it can be smaller or larger.
+Processor speed will vary widely, depending on the expected needs of
+the application. However the exact processor being used tends not to
+matter very much for most of the development process: the use of
+languages such as C or C++ means that the compiler will handle those
+details.
       </para></listitem>
       <listitem><para>
 There needs to be memory for code and for data. A typical system will
@@ -124,15 +108,38 @@ Instead of running the embedded applicat
 target board of some sort, it can be run as a Linux process. The
 processor will be the PC's own processor, for example an x86, and the
 memory will be the process' address space. Some I/O facilities can be
-emulated through system calls. For example clock hardware can be
-emulated by setting up a <literal>SIGALRM</literal> signal, which will
-cause the process to be interrupted at regular intervals. This
-emulation of real hardware will not be particularly accurate, for
-example the number of cpu cycles available to the eCos application
-between clock ticks will vary widely depending on what else is running
-on the PC, but for much development work it will be good enough.
+emulated directly through system calls. For example clock hardware can
+be emulated by setting up a <literal>SIGALRM</literal> signal, which
+will cause the process to be interrupted at regular intervals. This
+emulation of real hardware will not be particularly accurate, the
+number of cpu cycles available to the eCos application between clock
+ticks will vary widely depending on what else is running on the PC,
+but for much development work it will be good enough.
     </para>
     <para>
+Other I/O facilities are provided through an I/O auxiliary process,
+ecosynth, that gets spawned by the eCos application during startup.
+When an eCos device driver wants to perform some I/O operation, for
+example send out an ethernet packet, it sends a request to the I/O
+auxiliary. That is an ordinary Linux application so it has ready
+access to all normal Linux I/O facilities. To emulate a device
+interrupt the I/O auxiliary can raise a <literal>SIGIO</literal>
+signal within the eCos application. The HAL's interrupt subsystem
+installs a signal handler for this, which will then invoke the
+standard eCos ISR/DSR mechanisms. The I/O auxiliary is based around
+Tcl scripting, making it easy to extend and customize. It should be
+possible to configure the synthetic target so that its I/O
+functionality is similar to what will be available on the final target
+hardware for the application being developed.
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="overview.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
 A key requirement for synthetic target code is that the embedded
 application must not be linked with any of the standard Linux
 libraries such as the GNU C library: that would lead to a confusing
@@ -154,9 +161,11 @@ arguments on to the stack and executes t
 kernel cannot tell the difference, so it will perform the I/O
 operation requested by the synthetic target. With appropriate
 knowledge of what system calls are available, this makes it possible
-to emulate the required I/O facilities. For example diagnostic output
-can be achieved by a <function>cyg_hal_sys_write</function> system
-call using file descriptor 1, which corresponds to stdout.
+to emulate the required I/O facilities. For example, spawning the
+ecosynth I/O auxiliary involves system calls
+<function>cyg_hal_sys_fork</function> and
+<function>cyg_hal_sys_execve</function>, and sending a request to the
+auxiliary uses <function>cyg_hal_sys_write</function>.
     </para>
     <para>
 In many ways developing for the synthetic target is no different from
@@ -205,15 +214,97 @@ simulator or special tools. This will be
 simpler than using an architectural simulator, but no attempt is made
 to accurately match the behaviour of a real embedded target.
     </para>
-    <note><para>
-Support for emulating standard hardware such as ethernet is not yet
-available in the current release of the eCos synthetic target code,
-but is planned for future versions. Emulating application-specific
-custom hardware is rather more difficult since there is no way of
-knowing just what strange hardware a particular application might
-need, but the I/O mechanisms planned should allow for
-application-specific extensions.
-    </para></note>
+  </refsect1>
+</refentry>
+
+<!-- }}} -->
+<!-- {{{ Installation                   -->
+
+<refentry id="synth-install">
+  <refmeta>
+    <refentrytitle>Installation</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>Installation</refname>
+    <refpurpose>Preparing to use the synthetic target</refpurpose>
+  </refnamediv>
+
+  <refsect1 id="synth-install-host"><title>Host-side Software</title>
+    <para>
+To get the full functionality of the synthetic target, users must
+build and install the I/O auxiliary ecosynth and various support
+files. It is possible to develop applications for the synthetic target
+without the auxiliary, but only limited I/O facilities will be
+available. The relevant code resides in the <filename
+class="directory">host</filename> subdirectory of the synthetic target
+architectural HAL package, and building it involves the standard
+<command>configure</command>, <command>make</command>, and
+<command>make install</command> steps.
+    </para>
+    <para>
+There are two main ways of building the host-side software. It is
+possible to build both the generic host-side software and all
+package-specific host-side software, including the I/O auxiliary. in a
+single build tree. This involves using the
+<command>configure</command> script at the toplevel of the eCos
+repository, which will automatically search the <filename
+class="directory">packages</filename> hierarchy for host-side
+software. For more information on this, see the
+<filename>README.host</filename> file at the top of the repository.
+Note that if you have an existing build tree which does not include
+the synthetic target architectural HAL package then it will be
+necessary to rerun the toplevel configure script: the search for
+appropriate packages happens at configure time.
+    </para>
+    <para>
+The alternative is to build just the host-side for this package.
+This involves creating a suitable build directory and running the
+<command>configure</command> script. Note that building directly in
+the source tree is not allowed.
+    </para>
+    <screen>
+$ cd &lt;somewhere suitable&gt;
+$ mkdir synth_build
+$ cd synth_build
+$ &lt;repo&lt;&gt;/packages/hal/synth/arch/&lt;version&gt;/host/configure &lt;options&gt;
+$ make
+$ make install
+</screen>
+    <para>
+The code makes extensive use of Tcl/TK and requires version 8.3 or
+later. This is checked by the <command>configure</command> script. By
+default it will use the system's Tcl installation in <filename
+class="directory">/usr</filename>. If a different, more recent Tcl
+installation should be used then its location can be specified using
+the options <option>--with-tcl=&lt;path&gt;</option>,
+<option>--with-tcl-header=&lt;path&gt;</option> and
+<option>--with-tcl-lib=&lt;path&gt;</option>. For more information on these options
+see the <filename>README.host</filename> file at the toplevel of the
+eCos repository.
+    </para>
+    <para>
+Some users may also want to specify the install location using a
+<option>--prefix=&lt;path&gt;</option> option. The default install
+location is <filename class="directory">/usr/local</filename>. It is
+essential that the <filename class="directory">bin</filename>
+subdirectory of the install location is on the user's search
+<envar>PATH</envar>, otherwise the eCos application will be unable to
+locate and execute the I/O auxiliary ecosynth.
+    </para>
+    <para>
+Because ecosynth is run automatically by an eCos application rather
+than explicitly by the user, it is not installed in the <filename
+class="directory">bin</filename> subdirectory itself. Instead it is
+installed below <filename class="directory">libexec</filename>,
+together with various support files such as images. At configure time
+it is usually possible to specify an alternative location for
+<filename class="directory">libexec</filename> using
+<option>--exec-prefix=&lt;path&gt;</option> or
+<option>--libexecdir=&lt;path&gt;</option>. These options should not
+be used for this package because the eCos application is built
+completely separately and does not know how the host-side was
+configured. 
+    </para>
   </refsect1>
 
   <refsect1 id="synth-tools"><title>Toolchain</title>
@@ -230,7 +321,7 @@ sufficient.
     <para>
 There is one important limitation when using these tools: current gdb
 will not support debugging of eCos threads on the synthetic target. As
-far as gdb is concerned a synthetic target application is also
+far as gdb is concerned a synthetic target application is
 indistinguishable from a normal Linux application, so it assumes that
 any threads will be created by calls to the Linux
 <function>pthread_create</function> function provided by the C
@@ -287,10 +378,890 @@ platform being used for development. Not
 executes out of ROM: on a real embedded target much of the development
 would involve running RedBoot firmware there, with application code
 and data loaded into RAM; usually this would change for the final
-system; the firmware would be removed; and the application itself
-would execute from ROM and perform the appropriate hardware
-initialization. Therefore the synthetic target actually emulates the
-behaviour of the final system, not the development environment.
+system; the firmware would be replaced by the eCos application itself,
+configured for ROM bootstrap, and it would perform the appropriate
+hardware initialization. Therefore the synthetic target actually
+emulates the behaviour of a final system, not of a development
+environment. In practice this is rarely significant, although having
+the code in read-only memory can help catch some problems in
+application code.
+    </para>
+  </refsect1>
+
+</refentry>
+
+<!-- }}} -->
+<!-- {{{ Running the application        -->
+
+<refentry id="synth-running">
+  <refmeta>
+    <refentrytitle>Running a Synthetic Target Application</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>Execution</refname>
+    <refpurpose>Arguments and configuration files</refpurpose>
+  </refnamediv>
+
+  <refsect1 id="synth-running-description"><title>Description</title>
+    <para>
+The procedure for configuring and building eCos and an application for
+the synthetic target is the same as for any other eCos target. Once an
+executable has been built it can be run like any Linux program, for
+example from a shell prompt,
+    </para>
+    <screen>
+$ ecos_hello &lt;options&gt;
+</screen>
+    <para>
+or using gdb:
+    </para>
+    <screen>
+$ gdb --nw --quiet --args ecos_hello &lt;options&gt;
+(gdb) run
+Starting program: ecos_hello &lt;options&gt;
+</screen>
+    <para>
+By default use of the I/O auxiliary is disabled. If its I/O facilities
+are required then the option <option>--io</option> must be used.
+    </para>
+    <note><para>
+In future the default behaviour may change, with the I/O auxiliary
+being started by default. The option <option>--nio</option> can be
+used to prevent the auxiliary from being run.
+    </para></note>
+  </refsect1>
+
+  <refsect1 id="synth-running-arguments"><title>Command-line Arguments</title>
+    <para>
+The syntax for running a synthetic target application is:
+    </para>
+    <screen>
+$ &lt;ecos_app&gt; [options] [-- [app_options]]
+</screen>
+    <para>
+Command line options up to the <option>--</option> are passed on to
+the I/O auxiliary. Subsequent arguments are not passed on to the
+auxiliary, and hence can be used by the eCos application itself. The
+full set of arguments can be accessed through the variables
+<varname>cyg_hal_sys_argc</varname> and
+<varname>cyg_hal_sys_argv</varname>. 
+    </para>
+    <para>
+The following options are accepted as standard:
+    </para>
+    <variablelist>
+      <varlistentry>
+        <term><option>--io</option></term>
+         <listitem><para>
+This option causes the eCos application to spawn the I/O auxiliary
+during HAL initialization. Without this option only limited I/O will
+be available.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>--nio</option></term>
+         <listitem><para>
+This option prevents the eCos application from spawning the I/O
+auxiliary. In the current version of the software this is the default.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-nw</option>, <option>--no-windows</option></term>
+         <listitem><para>
+The I/O auxiliary can either provide a graphical user interface, or it
+can run in a text-only mode. The default is to provide the graphical
+interface, but this can be disabled with <option>-nw</option>.
+Emulation of some devices, for example buttons connected to digital
+inputs, requires the graphical interface.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-w</option>, <option>--windows</option></term>
+         <listitem><para>
+The <option>-w</option> causes the I/O auxiliary to provide a
+graphical user interface. This is the default.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>, <option>--version</option></term>
+         <listitem><para>
+The <option>-v</option> option can be used to determine the version of
+the I/O auxiliary being used and where it has been installed. Both the
+auxiliary and the eCos application will exit immediately.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-h</option>, <option>--help</option></term>
+         <listitem><para>
+<option>-h</option> causes the I/O auxiliary to list all accepted
+command-line arguments. This happens after all devices have been
+initialized, since the host-side support for some of the devices may
+extend the list of recognised options. After this both the auxiliary
+and the eCos application will exit immediately. This option implies
+<option>-nw</option>. 
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-k</option>, <option>--keep-going</option></term>
+         <listitem><para>
+If an error occurs in the I/O auxiliary while reading in any of the
+configuration files or initializing devices, by default both the 
+auxiliary and the eCos application will exit. The <option>-k</option>
+option can be used to make the auxiliary continue in spite of errors,
+although obviously it may not be fully functional.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-nr</option>, <option>--no-rc</option></term>
+         <listitem><para>
+Normally the auxiliary processes two <link
+linkend="synth-running-user-config">user configuration files</link>
+during startup: <filename>initrc.tcl</filename> and
+<filename>mainrc.tcl</filename>. This can be suppressed using the
+<option>-nr</option> option.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-x</option>, <option>--exit</option></term>
+         <listitem><para>
+When providing a graphical user interface the I/O auxiliary will
+normally continue running even after the eCos application has exited.
+This allows the user to take actions such as saving the current
+contents of the main text window. If run with <option>-x</option> then
+the auxiliary will exit as soon the application exits.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-nx</option>, <option>--no-exit</option></term>
+         <listitem><para>
+When the graphical user interface is disabled with
+<option>-nw</option> the I/O auxiliary will normally exit immediately
+when the eCos application exits. Without the graphical frontend there
+is usually no way for the user to interact directly with the
+auxiliary, so there is no point in continuing to run once the eCos
+application will no longer request any I/O operations. Specifying the
+<option>-nx</option> option causes the auxiliary to continue running
+even after the application has exited.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-V</option>, <option>--verbose</option></term>
+         <listitem><para>
+This option causes the I/O auxiliary to output some additional
+information, especially during initialization.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-l &lt;file&gt;</option>, <option>--logfile &lt;file&gt;</option></term>
+         <listitem><para>
+Much of the output of the eCos application and the I/O auxiliary is
+simple text, for example resulting from eCos
+<function>printf</function> or <function>diag_printf</function> calls.
+When running in graphical mode this output goes to a central text
+window, and can be saved to a file or edited via menus. The
+<option>-l</option> can be used to automatically generate an
+additional logfile containing all the text. If graphical
+mode is disabled then by default all the text just goes to the current
+standard output. Specifying <option>-l</option> causes most of the
+text to go into a logfile instead, although some messages such as
+errors generated by the auxiliary itself will still go to stdout as
+well. 
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-t &lt;file&gt;</option>, <option>--target &lt;file&gt;</option></term>
+         <listitem><para>
+During initialization the I/O auxiliary reads in a target definition
+file. This file holds information such as which Linux devices should
+be used to emulate the various eCos devices. The <option>-t</option>
+option can be used to specify which target definition should be used
+for the current run, defaulting to <filename>default.tdf</filename>.
+It is not necessary to include the <filename>.tdf</filename> suffix,
+this will be appended automatically if necessary.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-geometry &lt;geometry&gt;</option></term>
+         <listitem><para>
+This option can be used to control the size and position of the main
+window, as per X conventions.
+         </para></listitem>
+      </varlistentry>
+    </variablelist>
+    <para>
+The I/O auxiliary loads support for the various devices dynamically
+and some devices may accept additional command line arguments. Details
+of these can be obtained using the <option>-h</option> option or by
+consulting the device-specific documentation. If an unrecognised
+command line argument is used then a warning will be issued.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-running-tdf"><title>The Target Definition File</title>
+    <para>
+The eCos application will want to access devices such as
+<varname>eth0</varname> or <varname>/dev/ser0</varname>. These need to
+be mapped on to Linux devices. For example some users may all traffic
+on the eCos <varname>/dev/ser0</varname> serial device to go via the
+Linux serial device <varname>/dev/ttyS1</varname>, while ethernet I/O
+for the eCos <varname>eth0</varname> device should be mapped to the
+Linux ethertap device <varname>tap3</varname>. Some devices may need
+additional configuration information, for example to limit the
+number of packets that should be buffered within the I/O auxiliary.
+The target definition file provides all this information.
+    </para>
+    <para>
+By default the I/O auxiliary will look for a file
+<filename>default.tdf</filename>. An alternative target definition can
+be specified on the command line using <option>-t</option>, for
+example:
+    </para>
+    <screen>
+$ bridge_app --io -t twineth
+</screen>
+    <para>
+A <filename>.tdf</filename> suffix will be appended automatically if
+necessary. If a relative pathname is used then the I/O auxiliary will
+search for the target definition file in the current directory, then
+in <filename class="directory">~/.ecos/synth/</filename>, and finally
+in its install location.
+    </para>
+    <para>
+A typical target definition file might look like this:
+    </para>
+    <programlisting>
+synth_device console {
+    # appearance -foreground white -background black
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+}
+
+synth_device ethernet {
+    eth0 real eth1
+    eth1 ethertap tap4 00:01:02:03:FE:06
+
+    ## Maximum number of packets that should be buffered per interface.
+    ## Default 16
+    #max_buffer 32
+
+    ## Filters for the various recognised protocols.
+    ## By default all filters are visible and use standard colours.
+    filter ether  -hide 0
+    #filter arp    -hide 1
+    #filter ipv4   -hide 1
+    #filter ipv6   -hide 1
+}
+</programlisting>
+    <para>
+A target definition file is actually a Tcl script that gets run in the
+main interpreter of the I/O auxiliary during initialization. This
+provides a lot of flexibility if necessary. For example the script
+could open a socket to a resource management server of some sort to
+determine which hardware facilities are already in use and adapt
+accordingly. Another possibility is to adapt based on <link
+linkend="synth-new-host-args">command line arguments</link>. Users who
+are not familiar with Tcl programming should still be able to edit a
+simple target definition file without too much difficulty, using a
+mixture of cut'n'paste, commenting or uncommenting various lines, and
+making small edits such as changing <literal>tap4</literal> to
+<literal>eth2</literal>. 
+    </para>
+    <para>
+Each type of device will have its own entry in the target definition
+file, taking the form:
+    </para>
+    <programlisting>
+synth_device &lt;device type&gt; {
+    &lt;options&gt;
+}
+</programlisting>
+    <para>
+The documentaton for each synthetic target device should provide
+details of the options available for that device, and often a suitable
+fragment that can be pasted into a target definition file and edited.
+There is no specific set of options that a given device will always
+provide. However in practice many devices will use common code
+exported by the main I/O auxiliary, or their implementation will
+involve some re-use of code for an existing device. Hence certain
+types of option are common to many devices.
+    </para>
+    <para>
+A good example of this is filters, which control the appearance of
+text output. The above target definition file defines a filter
+<varname>trace</varname> for output from the eCos application. The
+regular expression will match output from the infrastructure package's
+tracing facilities when <varname>CYGDBG_USE_TRACING</varname> and
+<varname>CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE</varname> are enabled.
+With the current settings this output will not be visible by default,
+but can be made visible using the menu item <guimenuitem>System
+Filters</guimenuitem>. If made visible the trace output will appear in
+an unusual colour, so users can easily distinguish the trace output
+from other text. All filters accept the following options:
+    </para>
+    <variablelist>
+      <varlistentry>
+         <term><option>-hide [0|1]</option></term>
+         <listitem><para>
+This controls whether or not text matching this filter should be
+invisible by default or not. At run-time the visibility of each filter
+can be controlled using the <guimenuitem>System Filters</guimenuitem>
+menu item.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+         <term><option>-foreground &lt;colour&gt;</option></term>
+         <listitem><para>
+This specifies the foreground colour for all text matching this
+filter. The colour can be specified using an RGB value such as
+<literal>#F08010</literal>, or a symbolic name such as
+<literal>"light steel blue"</literal>. The X11 utility
+<application>showrgb</application> can be used to find out
+about the available colours.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+         <term><option>-background &lt;colour&gt;</option></term>
+         <listitem><para>
+This specifies the background colour for all text matching the filter.
+As with <option>-foreground</option> the colour can be specified using
+a symbolic name or an RGB value.
+         </para></listitem>
+      </varlistentry>
+    </variablelist>
+    <para>
+Some devices may create their own subwindows, for example to monitor
+ethernet traffic or to provide additional I/O facilities such as
+emulated LED's or buttons. Usually the target definition file can be
+used to control the <link linkend="synth-gui-layout">layout</link> of
+these windows.
+    </para>
+    <para>
+The I/O auxiliary will not normally warn about
+<command>synth_device</command> entries in the target definition file
+for devices that are not actually needed by the current eCos
+application. This makes it easier to use a single file for several
+different applications. However it can lead to confusion if an entry
+is spelled incorrectly and hence does not actually get used. The
+<option>-V</option> command line option can be used to get warnings
+about unused device entries in the target definition file.
+    </para>
+    <para>
+If the body of a <command>synth_device</command> command contains an
+unrecognised option and the relevant device is in use, the I/O
+auxiliary will always issue a warning about such options.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-running-user-config"><title>User Configuration Files</title>
+    <para>
+During initialization the I/O auxiliary will execute two user
+configuration files, <filename>initrc.tcl</filename> and
+<filename>mainrc.tcl</filename>. It will look for these files in the
+directory <filename class="directory">~/.ecos/synth/</filename>. If
+that directory does not yet exist it will be created and populated
+with initial dummy files.
+    </para>
+    <para>
+Both of these configuration files are Tcl scripts and will be run in
+the main interpreter used by the I/O auxiliary itself. This means that
+they have full access to the internals of the auxiliary including the
+various Tk widgets, and they can perform file or socket I/O if
+desired. The section <xref linkend="synth-new-host"> contains
+information about the facilities available on the host-side for
+writing new device drivers, and these can also be used in the
+initialization scripts.
+    </para>
+    <para>
+The <filename>initrc.tcl</filename> script is run before the auxiliary
+has processed any requests from the eCos application, and hence before
+any devices have been instantiated. At this point the generic
+command-line arguments has been processed, the target definition file
+has been read in, and the hooks functionality has been initialized. If
+running in graphical mode the main window will have been created, but
+has been withdrawn from the screen to allow new widgets to be added
+without annoying screen flicker. A typical
+<filename>initrc.tcl</filename> script could add some menu or toolbar
+options, or install a hook function that will be run when the
+eCos application exits.
+    </para>
+    <para>
+The <filename>mainrc.tcl</filename> script is run after eCos has
+performed all its device initialization and after C++ static
+constructors have run, and just before the call to
+<function>cyg_start</function> which will end up transferring control
+to the application itself. A typical <filename>mainrc.tcl</filename>
+script could look at what interrupt vectors have been allocated to
+which devices and create a little monitor window that shows interrupt
+activity. 
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-running-session"><title>Session Information</title>
+    <para>
+When running in graphical mode, the I/O auxiliary will read in a file
+<filename>~/.ecos/synth/guisession</filename> containing session
+information. This file should not normally be edited manually, instead
+it gets updated automatically when the auxiliary exits. The purpose of
+this file is to hold configuration options that are manipulated via
+the graphical interface, for example which browser should be used to
+display online help.
+    </para>
+    <warning><para>
+GUI session functionality is not yet available in the current release.
+When that functionality is fully implemented it is possible that some
+target definition file options may be removed, to be replaced by
+graphical editing via a suitable preferences dialog, with the
+current settings saved in the session file.
+    </para></warning>
+  </refsect1>
+
+</refentry>
+
+<!-- }}} -->
+<!-- {{{ ecosynth user interface        -->
+
+<refentry id="synth-gui">
+  <refmeta>
+    <refentrytitle>The I/O Auxiliary's User Interface</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>User Interface</refname>
+    <refpurpose>Controlling the I/O Auxiliary</refpurpose>
+  </refnamediv>
+
+  <refsect1 id="synth-gui-description"><title>Description</title>
+    <para>
+The synthetic target auxiliary is designed to support both extensions
+and user customization. Support for the desired devices is dynamically
+loaded, and each device can extend the user interface. For example it
+is possible for a device to add menu options, place new buttons on the
+toolbar, create its own sub-window within the overall layout, or even
+create entire new toplevel windows. These subwindows or toplevels
+could show graphs of activity such as interrupts or packets being
+transferred. They could also allow users to interact with the eCos
+application, for example by showing a number of buttons which will be
+mapped on to digital inputs in the eCos application. Different
+applications will have their own I/O requirements, changing the
+host-side support files that get loaded and that may modify the user
+interface. The I/O auxiliary also reads in user configuration scripts
+which can enhance the interface in the same way. Therefore the exact
+user interface will depend on the user and on the eCos application
+being run. However the overall layout is likely to remain the same.
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="screen_main.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+The title bar identifies the window as belonging to an eCos synthetic
+target application and lists both the application name and its process
+id. The latter is especially useful if the application was started
+directly from a shell prompt and the user now wants to attach a gdb
+session. The window has a conventional menu bar with the usual
+entries, plus a toolbar with buttons for common operations such as cut
+and paste. Balloon help is supported.
+    </para>
+    <para>
+There is a central <link linkend="synth-gui-text">text window</link>,
+possibly surrounded by various sub-windows for various devices. For
+example there could be a row of emulated LED's above the text window,
+and monitors of ethernet traffic and interrupt activity on the right.
+At the bottom of the window is a status line, including a small
+animation that shows whether or not the eCos application is still
+running.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-gui-menus"><title>Menus and the Toolbar</title>
+    <para>
+Usually there will be four menus on the menu bar:
+<guimenu>File</guimenu>, <guimenu>Edit</guimenu>,
+<guimenu>View</guimenu> and <guimenu>Help</guimenu>.
+    </para>
+      <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="menu_file.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+On the <guimenu>File</guimenu> menu there are three entries related to
+saving the current contents of the central text window.
+<guimenuitem>Save</guimenuitem> is used to save the currently visible
+contents of the text window. Any text that is hidden because of
+filters will not be written to the savefile. If there has been a
+previous <guimenuitem>Save</guimenuitem> or <guimenuitem>Save
+As</guimenuitem> operation then the existing savefile will be re-used,
+otherwise the user will be asked to select a suitable file.
+<guimenuitem>Save As</guimenuitem> also saves just the currently
+visible contents but will always prompt the user for a filename.
+<guimenuitem>Save All</guimenuitem> can be used to save the full
+contents of the text window, including any text that is currently
+hidden. It will always prompt for a new filename, to avoid confusion
+with partial savefiles.
+    </para>
+    <para>
+Usually the eCos application will be run from inside gdb or from a
+shell prompt. Killing off the application while it is being debugged
+in a gdb session is not a good idea, it would be better to use gdb's
+own <command>kill</command> command. Alternatively the eCos
+application itself can use the <function>CYG_TEST_EXIT</function> or
+<filename>cyg_hal_sys_exit</filename> functionality. However it is
+possible to terminate the application from the I/O auxiliary using
+<guimenuitem>Kill eCos</guimenuitem>. A clean shutdown will be
+attempted, but that can fail if the application is currently halted
+inside gdb or if it has crashed completely. As a last resort
+<constant>SIGKILL</constant> will be used.
+    </para>
+    <para>
+When operating in graphical mode the I/O auxiliary will normally
+continue to run even after the eCos application has exited. This
+allows the user to examine the last few lines of output, and perhaps
+perform actions such as saving the output to a file. The
+<guimenuitem>Exit</guimenuitem> menu item can be used to shut down the
+auxiliary. Note that this behaviour can be changed with command line
+arguments <link
+linkend="synth-running-arguments"><option>--exit</option></link> and
+<link
+linkend="synth-running-arguments"><option>--no-exit</option></link>.
+    </para>
+    <para>
+If <guimenuitem>Exit</guimenuitem> is used while the eCos application
+is still running then the I/O auxiliary will first attempt to
+terminate the application cleanly, and then exit.
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="menu_edit.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+The <guimenu>Edit</guimenu> menu contains the usual entries for
+text manipulation: <guimenuitem>Cut</guimenuitem>,
+<guimenuitem>Copy</guimenuitem>, <guimenuitem>Paste</guimenuitem>,
+<guimenuitem>Clear</guimenuitem> and <guimenuitem>Select
+All</guimenuitem>. These all operate on the central text window. By
+default this window cannot be edited so the cut, paste and clear
+operations are disabled. If the user wants to edit the contents of the
+text window then the <guimenuitem>Read Only</guimenuitem> checkbutton
+should be toggled.
+    </para>
+    <para>
+The <guimenuitem>Preferences</guimenuitem> menu item brings up a
+miscellaneous preferences dialog. One of the preferences relates to
+online help: the I/O auxiliary does not currently have a built-in html
+viewer; instead it will execute an external browser of some sort. With
+the example settings shown, the I/O auxiliary will first attempt to
+interact with an existing mozilla session. If that fails it will try
+to run a new mozilla instance, or as a last result use the Gnome help
+viewer. 
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="preferences.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+The <guimenu>View</guimenu> menu contains the <guimenuitem>System
+Filters</guimenuitem> entry, used to edit the settings for the current
+<link linkend="synth-gui-text">filters</link>.
+    </para>
+     <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="menu_view.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+The <guimenu>Help</guimenu> menu can be used to activate online help
+for eCos generally, for the synthetic target as a whole, and for
+specific devices supported by the generic target. The Preferences
+dialog can be used to select the browser that will be used.
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="menu_help.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <note><para>
+At the time of writing there is no well-defined toplevel index file
+for all eCos documentation. Hence the relevant menu item is disabled.
+Documentation for the synthetic target and the supported devices
+is stored as part of the package itself so can usually be found fairly
+easily. It may be necessary to set the <envar>ECOS_REPOSITORY</envar>
+environment variable.
+    </para></note>
+
+  </refsect1>
+
+  <refsect1 id="synth-gui-text"><title>The Main Text Window</title>
+    <para>
+The central text window holds the console output from the eCos
+application: the screen shot above shows DHCP initialization data from
+the TCP/IP stack, and some output from the <function>main</function>
+thread at the bottom. Some devices can insert text of their own, for
+example the ethernet device support can be configured to show details
+of incoming and outgoing packets. Mixing the output from the eCos
+application and the various devices can make it easier to understand
+the order in which events occur.
+    </para>
+    <para>
+The appearance of text from different sources can be controlled by
+means of filters, and it is also possible to hide some of the text.
+For example, if tracing is enabled in the eCos configuration then the
+trace output can be given its own colour scheme, making it stand out
+from the rest of the output. In addition the trace output is generally
+voluminous so it can be hidden by default, made visible only to find
+out more about what was happening when a particular problem occurred.
+Similarly the ethernet device support can output details of the
+various packets being transferred, and using a different background
+colour for this output again makes it easier to distinguish from
+console output.
+    </para>
+    <para>
+The default appearance for most filters is controlled via the
+<link linkend="synth-running-tdf">target definition file</link>. An
+example entry might be:
+    </para>
+    <programlisting>
+  filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+</programlisting>
+    <para>
+The various colours and the hide flag for each filter can be changed
+at run-time, using the <guimenuitem>System Filters</guimenuitem> item
+on the <guimenu>View</guimenu> menu. This will bring up a dialog like
+the following:
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="filters.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+It should be noted that the text window is line-oriented, not
+character-oriented. If an eCos application sends a partial line of
+text then that will remain buffered until a newline character is
+received, rather than being displayed immediately. This avoids
+confusion when there is concurrent output from several sources.
+    </para>
+    <para>
+By default the text window is read-only. This means it will not allow
+cut, paste and clear operations, and keyboard input will be ignored.
+The <guimenu>Edit</guimenu> menu has a checkbutton <guimenuitem>Read
+Only</guimenuitem> which can be toggled to allow write operations. For
+example, a user could type in a reminder of what was happening at this
+time, or paste in part of a gdb session. Such keyboard input does not
+get forwarded to the eCos application: if the latter requires keyboard
+input then that should happen via a separate keyboard device.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-gui-layout"><title>Positioning Optional Windows</title>
+    <para>
+Some devices may create their own subwindows, for example to monitor
+ethernet traffic or to provide additional I/O facilities such as
+emulated LED's or buttons. Usually the target definition file can be
+used to control the <link linkend="synth-gui-layout">layout</link> of
+these windows. This requires an understanding of the overall layout of
+the display.
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="layout.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+Subwindows are generally packed in one of eight frames surrounding the
+central text window: <varname>.main.nw</varname>,
+<varname>.main.n</varname>, <varname>.main.ne</varname>,
+<varname>.main.w</varname>, <varname>.main.e</varname>,
+<varname>.main.sw</varname>, <varname>.main.s</varname>, and
+<varname>.main.se</varname>. To position a row of LED's above the text
+window and towards the left, a target definition file could contain an
+entry such as:
+    </para>
+    <programlisting>
+synth_device led {
+    pack -in .main.n -side left
+    &hellip;
+}
+</programlisting>
+    <para>
+Similarly, to put a traffic monitor window on the right of the text
+window would involve something like:
+    </para>
+    <programlisting>
+    &hellip;
+    monitor_pack -in .main.e -side bottom
+    &hellip;
+</programlisting>
+    <para>
+Often it will be sufficient to specify a container frame and one of
+<constant>left</constant>, <constant>right</constant>,
+<constant>top</constant> or <constant>bottom</constant>. Full control
+over the positioning requires an understanding of Tcl/Tk and in
+particular the packing algorithm, and an appropriate reference work
+should be consulted.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-gui-global-config"><title>Global Settings</title>
+    <note><para>
+This section still to be written - it should document the interaction
+between X resources and ecosynth, and how users can control settings
+such as the main foreground and background colours.
+    </para></note>
+  </refsect1>
+
+</refentry>
+
+<!-- }}} -->
+<!-- {{{ The console device             -->
+
+<refentry id="synth-console">
+  <refmeta>
+    <refentrytitle>The Console Device</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>The console device </refname>
+    <refpurpose>Show output from the eCos application</refpurpose>
+  </refnamediv>
+
+  <refsect1 id="synth-console-description"><title>Description</title>
+    <para>
+The eCos application can generate text output in a variety of ways,
+including calling <function>printf</function> or
+<function>diag_printf</function>. When the I/O auxiliary is enabled
+the eCos startup code will instantiate a console device to process all
+such output. If operating in text mode the output will simply go to
+standard output, or to a logfile if the <option>-l</option> command
+line option is specified. If operating in graphical mode the output
+will go to the central text window, and optionally to a logfile as
+well. In addition it is possible to control the appearance of the main
+text via the target definition file, and to install extra filters for
+certain types of text.
+    </para>
+    <para>
+It should be noted that the console device is line-oriented, not
+character-oriented. This means that outputting partial lines is not
+supported, and some functions such as <function>fflush</function> and
+<function>setvbuf</function> will not operate as expected. This
+limitation prevents much possible confusion when using filters to
+control the appearance of the text window, and has some performance
+benefits - especially when the eCos application generates a great deal
+of output such as when tracing is enabled. For most applications this
+is not a problem, but it is something that developers should be aware
+of. 
+    </para>
+    <para>
+The console device is output-only, it does not provide any support for
+keyboard input. If the application requires keyboard input then that
+should be handled by a separate eCos device package and matching
+host-side code.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-console-install"><title>Installation</title>
+    <para>
+The eCos side of the console device is implemented by the
+architectural HAL itself, in the source file
+<filename>synth_diag.c</filename>, rather than in a separate device
+package. Similarly the host-side implementation,
+<function>console.tcl</function>, is part of the architectural HAL's
+host-side support. It gets installed automatically alongside the I/O
+auxiliary itself, so no separate installation procedure is required.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-console-tdf"><title>Target Definition File</title>
+    <para>
+The <link linkend="synth-running-tdf">target definition file</link>
+can contain a number of entries related to the console device. These
+are all optional, they only control the appearance of text output. If
+such control is desired then the relevant options should appear in the
+body of a <command>synth_device</command> entry:
+    </para>
+    <programlisting>
+synth_device console {
+    &hellip;
+}
+</programlisting>
+    <para>
+The first option is <command>appearance</command>, used to control the
+appearance of any text generated by the eCos application that does not
+match one of the installed filters. This option takes the same
+argument as any other filter, for example:
+    </para>
+    <programlisting>
+synth_device console {
+    appearance -foreground white -background black
+    &hellip;
+}
+</programlisting>
+    <para>
+Any number of additional filters can be created with a
+<command>filter</command> option, for example:
+    </para>
+    <programlisting>
+synth_device console {
+    &hellip;
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+    &hellip;
+}
+</programlisting>
+    <para>
+The first argument gives the new filter a name which will be used in
+the <link linkend="synth-gui-text">filters dialog</link>. Filter names
+should be unique. The second argument is a Tcl regular expression. The
+console support will match each line of eCos output against this
+regular expression, and if a match is found then the filter will be
+used for this line of text. The above example matches any line of
+output that begins with <literal>TRACE:</literal>, which corresponds
+to the eCos infrastructure's tracing facilities. The remaining options
+control the desired appearance for matched text. If some eCos output
+matches the regular expressions for several different filters then
+only the first match will be used.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-console-target-config"><title>Target-side
+  Configuration Options</title>
+    <para>
+There are no target-side configuration options related to the console
+device. 
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-console-arguments"><title>Command Line Arguments</title>
+    <para>
+The console device does not use any command-line arguments.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-console-hooks"><title>Hooks</title>
+    <para>
+The console device does not provide any hooks.
+    </para>
+  </refsect1>
+
+  <refsect1><title>Additional Tcl Procedures</title>
+    <para>
+The console device does not provide any additional Tcl procedures that
+can be used by other scripts.
     </para>
   </refsect1>
 
@@ -315,7 +1286,7 @@ behaviour of the final system, not the d
 #include &lt;cyg/hal/hal_io.h
       </funcsynopsisinfo>
       <funcprototype>
-        <funcdef>int <function>cyg_hal_sys_xyz</function></funcdef>
+        <funcdef>int <function>cyg_hal_sys_xyzzy</function></funcdef>
         <varargs>
       </funcprototype>
     </funcsynopsis>
@@ -410,6 +1381,1179 @@ GNU C library sources.
 </refentry>
 
 <!-- }}} -->
+<!-- {{{ New devices - target-side      -->
+
+<refentry id="synth-new-target">
+  <refmeta>
+    <refentrytitle>Writing New Devices - target</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>Writing New Devices</refname>
+    <refpurpose>extending the synthetic target, target-side</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <funcsynopsis>
+      <funcsynopsisinfo>
+#include &lt;cyg/hal/hal_io.h
+      </funcsynopsisinfo>
+
+      <funcprototype>
+        <funcdef>int <function>synth_auxiliary_instantiate</function></funcdef>
+        <paramdef>const char* <parameter>package</parameter></paramdef>
+        <paramdef>const char* <parameter>version</parameter></paramdef>
+        <paramdef>const char* <parameter>device</parameter></paramdef>
+        <paramdef>const char* <parameter>instance</parameter></paramdef>
+        <paramdef>const char* <parameter>data</parameter></paramdef>
+      </funcprototype>
+      <funcprototype>
+        <funcdef>void <function>synth_auxiliary_xchgmsg</function></funcdef>
+        <paramdef>int <parameter>device_id</parameter></paramdef>
+        <paramdef>int <parameter>request</parameter></paramdef>
+        <paramdef>int <parameter>arg1</parameter></paramdef>
+        <paramdef>int <parameter>arg2</parameter></paramdef>
+        <paramdef>const unsigned char* <parameter>txdata</parameter></paramdef>
+        <paramdef>int <parameter>txlen</parameter></paramdef>
+        <paramdef>int* <parameter>reply</parameter></paramdef>
+        <paramdef>unsigned char* <parameter>rxdata</parameter></paramdef>
+        <paramdef>int* <parameter>rxlen</parameter></paramdef>
+        <paramdef>int <parameter>max_rxlen</parameter></paramdef>
+      </funcprototype>
+    </funcsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1 id="synth-new-target-description"><title>Description</title>
+    <para>
+In some ways writing a device driver for the synthetic target is very
+similar to writing one for a real target. Obviously it has to provide
+the standard interface for that class of device, so for example an
+ethernet device has to provide <function>can_send</function>,
+<function>send</function>, <function>recv</function> and similar
+functions. Many devices will involve interrupts, so the driver
+contains ISR and DSR functions and will call
+<function>cyg_drv_interrupt_create</function>,
+<function>cyg_drv_interrupt_acknowledge</function>, and related
+functions.
+    </para>
+    <para>
+In other ways writing a device driver for the synthetic target is very
+different. Usually the driver will not have any direct access to the
+underlying hardware. In fact for some devices the I/O may not involve
+real hardware, instead everything is emulated by widgets on the
+graphical display. Therefore the driver cannot just peek and poke
+device registers, instead it must interact with host-side code by
+exchanging message. The synthetic target HAL provides a function
+<function>synth_auxiliary_xchgmsg</function> for this purpose.
+    </para>
+    <para>
+Initialization of a synthetic target device driver is also very
+different. On real targets the device hardware already exists when the
+driver's initialization routine runs. On the synthetic target it is
+first necessary to instantiate the device inside the I/O auxiliary, by
+a call to <function>synth_auxiliary_instantiate</function>. That
+function performs a special message exchange with the I/O auxiliary,
+causing it to load a Tcl script for the desired type of device and run
+an instantiation procedure within that script.
+    </para>
+    <para>
+Use of the I/O auxiliary is optional: if the user does not specify
+<option>--io</option> on the command line then the auxiliary will not
+be started and hence most I/O operations will not be possible. Device
+drivers should allow for this possibility, for example by just
+discarding any data that gets written. The HAL exports a flag
+<varname>synth_auxiliary_running</varname> which should be checked.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-target-instantiate"><title>Instantiating a Device</title>
+    <para>
+Device instantiation should happen during the C++ prioritized static
+constructor phase of system initialization, before control switches to
+<function>cyg_user_start</function> and general application code. This
+ensures that there is a clearly defined point at which the I/O
+auxiliary knows that all required devices have been loaded. It can
+then perform various consistency checks and clean-ups, run the user's
+<filename>mainrc.tcl</filename> script, and make the main window
+visible.
+    </para>
+    <para>
+For standard devices generic eCos I/O code will call the device
+initialization routines at the right time, iterating through the
+<varname>DEVTAB</varname> table in a static constructor. The same
+holds for network devices and file systems. For more custom devices
+code like the following can be used:
+    </para>
+    <programlisting>
+#include &lt;cyg/infra/cyg_type.h&gt;
+class mydev_init {
+  public:
+    mydev_init() {
+        &hellip;
+    }
+};
+static mydev_init mydev_init_object CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO);
+</programlisting>
+    <para>
+Some care has to be taken because the object
+<varname>mydev_init_object</varname> will typically not be referenced
+by other code, and hence may get eliminated at link-time. If the code
+is part of an eCos package then problems can be avoided by putting the
+relevant file in <filename>libextras.a</filename>:
+    </para>
+    <programlisting>
+cdl_package CYGPKG_DEVS_MINE {
+    &hellip;
+    compile -library=libextras.a init.cxx
+}
+</programlisting>
+    <para>
+For devices inside application code the same can be achieved by
+linking the relevant module as a <filename>.o</filename> file rather
+than putting it in a <filename>.a</filename> library.
+    </para>
+    <para>
+In the device initialization routine the main operation is a call to
+<function>synth_auxiliary_instantiate</function>. This takes five
+arguments, all of which should be strings:
+    </para>
+    <variablelist>
+      <varlistentry>
+        <term><varname>package</varname></term>
+        <listitem><para>
+For device drivers which are eCos packages this should be a directory
+path relative to the eCos repository, for example
+<literal>devs/eth/synth/ecosynth</literal>. This will allow the I/O
+auxiliary to find the various host-side support files for this package
+within the install tree. If the device is application-specific and not
+part of an eCos package then a NULL pointer can be used, causing the
+I/O auxiliary to search for the support files in the current directory
+and then in <filename class="directory">~/.ecos/synth</filename>
+instead. 
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>version</varname></term>
+        <listitem><para>
+For eCos packages this argument should be the version of the package
+that is being used, for example <literal>current</literal>. A simple
+way to get this version is to use the
+<function>SYNTH_MAKESTRING</function> macro on the package name.
+If the device is application-specific then a NULL pointer should be
+used. 
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>device</varname></term>
+        <listitem><para>
+This argument specifies the type of device being instantiated, for
+example <literal>ethernet</literal>. More specifically the I/O
+auxiliary will append a <filename>.tcl</filename> suffix, giving
+the name of a Tcl script that will handle all I/O requests for the
+device. If the application requires several instances of a type
+of device then the script will only be loaded once, but the script
+will contain an instantiation procedure that will be called for each
+device instance. 
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>instance</varname></term>
+        <listitem><para>
+If it is possible to have multiple instances of a device then this
+argument identifies the particular instance, for example
+<literal>eth0</literal> or <literal>eth1</literal>. Otherwise a NULL
+pointer can be used.
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>data</varname></term>
+        <listitem><para>
+This argument can be used to pass additional initialization data from
+eCos to the host-side support. This is useful for devices where eCos
+configury must control certain aspects of the device, rather than
+host-side configury such as the target definition file, because eCos
+has compile-time dependencies on some or all of the relevant options.
+An example might be an emulated frame buffer where eCos has been
+statically configured for a particular screen size, orientation and
+depth. There is no fixed format for this string, it will be
+interpreted only by the device-specific host-side Tcl script. However
+the string length should be limited to a couple of hundred bytes to
+avoid possible buffer overflow problems.
+        </para></listitem>
+      </varlistentry>
+    </variablelist>
+    <para>
+Typical usage would look like:
+    </para>
+    <programlisting>
+    if (!synth_auxiliary_running) {
+      return;
+    }
+    id = synth_auxiliary_instantiate("devs/eth/synth/ecosynth",
+             SYNTH_MAKESTRING(CYGPKG_DEVS_ETH_ECOSYNTH),
+             "ethernet",
+             "eth0",
+             (const char*) 0);
+</programlisting>
+    <para>
+The return value will be a device identifier which can be used for
+subsequent calls to <function>synth_auxiliary_xchgmsg</function>. If
+the device could not be instantiated then <literal>-1</literal> will
+be returned. It is the responsibility of the host-side software to
+issue suitable diagnostics explaining what went wrong, so normally the
+target-side code should fail silently.
+    </para>
+    <para>
+Once the desired device has been instantiated, often it will be
+necessary to do some additional initialization by a message exchange.
+For example an ethernet device might need information from the
+host-side about the MAC address, the <link
+linkend="synth-new-target-interrupts">interrupt vector</link>, and
+whether or not multicasting is supported.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-target-xchgmsg"><title>Communicating with a Device</title>
+    <para>
+Once a device has been instantiated it is possible to perform I/O by
+sending messages to the appropriate Tcl script running inside the
+auxiliary, and optionally getting back replies. I/O operations are
+always initiated by the eCos target-side, it is not possible for the
+host-side software to initiate data transfers. However the host-side
+can raise interrupts, and the interrupt handler inside the target can
+then exchange one or more messages with the host.
+    </para>
+    <para>
+There is a single function to perform I/O operations,
+<function>synth_auxiliary_xchgmsg</function>. This takes the following
+arguments: 
+    </para>
+    <variablelist>
+      <varlistentry>
+        <term><varname>device_id</varname></term>
+         <listitem><para>
+This should be one of the identifiers returned by a previous
+call to <function>synth_auxiliary_instantiate</function>, specifying the
+particular device which should perform some I/O.
+         </para></listitem>
+       </varlistentry>
+      <varlistentry>
+        <term><varname>request</varname></term>
+         <listitem><para>
+Request are just signed 32-bit integers that identify the particular
+I/O operation being requested. There is no fixed set of codes, instead
+each type of device can define its own.
+         </para></listitem>
+       </varlistentry>
+      <varlistentry>
+        <term><varname>arg1</varname></term>
+        <term><varname>arg2</varname></term>
+         <listitem><para>
+For some requests it is convenient to pass one or two additional
+parameters alongside the request code. For example an ethernet device
+could define a multicast-all request, with <varname>arg1</varname>
+controlling whether this mode should be enabled or disabled. Both
+<varname>arg1</varname> and <varname>arg2</varname> should be signed
+32-bit integers, and their values are interpreted only by the
+device-specific Tcl script.
+         </para></listitem>
+       </varlistentry>
+      <varlistentry>
+        <term><varname>txdata</varname></term>
+        <term><varname>txlen</varname></term>
+         <listitem><para>
+Some I/O operations may involve sending additional data, for example
+an ethernet packet. Alternatively a control operation may require many
+more parameters than can easily be encoded in <varname>arg1</varname>
+and <varname>arg2</varname>, so those parameters have to be placed in
+a suitable buffer and extracted at the other end.
+<varname>txdata</varname> is an arbitrary buffer of
+<varname>txlen</varname> bytes that should be sent to the host-side.
+There is no specific upper bound on the number of bytes that can be
+sent, but usually it is a good idea to allocate the transmit buffer
+statically and keep transfers down to at most several kilobytes.
+         </para></listitem>
+       </varlistentry>
+      <varlistentry>
+        <term><varname>reply</varname></term>
+         <listitem><para>
+If the host-side is expected to send a reply message then
+<varname>reply</varname> should be a pointer to an integer variable
+and will be updated with a reply code, a simple 32-bit integer. The
+synthetic target HAL code assumes that the host-side and target-side
+agree on the protocol being used: if the host-side will not send a
+reply to this message then the <varname>reply</varname> argument
+should be a NULL pointer; otherwise the host-side must always send
+a reply code and the <varname>reply</varname> argument must be valid.
+         </para></listitem>
+       </varlistentry>
+      <varlistentry>
+        <term><varname>rxdata</varname></term>
+        <term><varname>rxlen</varname></term>
+         <listitem><para>
+Some operations may involve additional data coming from the host-side,
+for example an incoming ethernet packet. <varname>rxdata</varname>
+should be a suitably-sized buffer, and <varname>rxlen</varname> a
+pointer to an integer variable that will end up containing the number
+of bytes that were actually received. These arguments will only be
+used if the host-side is expected to send a reply and hence the
+<varname>reply</varname> argument was not NULL.
+         </para></listitem>
+       </varlistentry>
+      <varlistentry>
+        <term><varname>max_rxlen</varname></term>
+         <listitem><para>
+If a reply to this message is expected and that reply may involve
+additional data, <varname>max_rxlen</varname> limits the size of that
+reply. In other words, it corresponds to the size of the
+<varname>rxdata</varname> buffer.
+         </para></listitem>
+       </varlistentry>
+    </variablelist>
+    <para>
+Most I/O operations involve only some of the arguments. For example
+transmitting an ethernet packet would use the
+<varname>request</varname>, <varname>txdata</varname> and
+<varname>txlen</varname> fields (in addition to
+<varname>device_id</varname> which is always required), but would not
+involve <varname>arg1</varname> or <varname>arg2</varname> and no
+reply would be expected. Receiving an ethernet packet would involve
+<varname>request</varname>, <varname>rxdata</varname>,
+<varname>rxlen</varname> and <varname>max_rxlen</varname>; in addition
+<varname>reply</varname> is needed to get any reply from the host-side
+at all, and could be used to indicate whether or not any more packets
+are buffered up. A control operation such as enabling multicast mode
+would involve <varname>request</varname> and <varname>arg1</varname>,
+but none of the remaining arguments.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-target-interrupts"><title>Interrupt Handling</title>
+    <para>
+Interrupt handling in the synthetic target is much the same as on a
+real target. An interrupt object is created using
+<function>cyg_drv_interrupt_create</function>, attached, and unmasked.
+The emulated device - in other words the Tcl script running inside the
+I/O auxiliary - can raise an interrupt. Subject to interrupts being
+disabled and the appropriate vector being masked, the system will
+invoke the specified ISR function. The synthetic target HAL
+implementation does have some limitations: there is no support for
+nested interrupts, interrupt priorities, or a separate interrupt
+stack. Supporting those might be appropriate when targetting a
+simulator that attempts to model real hardware accurately, but not for
+the simple emulation provided by the synthetic target.
+    </para>
+    <para>
+Of course the actual implementation of the ISR and DSR functions will
+be rather different for a synthetic target device driver. For real
+hardware the device driver will interact with the device by reading
+and writing device registers, managing DMA engines, and the like. A
+synthetic target driver will instead call
+<function>synth_auxiliary_xchgmsg</function> to perform the I/O
+operations.
+    </para>
+    <para>
+There is one other significant difference between interrupt handling
+on the synthetic target and on real hardware. Usually the eCos code
+will know which interrupt vectors are used for which devices. That
+information is fixed when the target hardware is designed. With the
+synthetic target interrupt vectors are assigned to devices on the host
+side, either via the target definition file or dynamically when the
+device is instantiated. Therefore the initialization code for a
+target-side device driver will need to request interrupt vector
+information from the host-side, via a message exchange. Such interrupt
+vectors will be in the range 1 to 31 inclusive, with interrupt 0 being
+reserved for the real-time clock.
+    </para>
+  </refsect1>
+
+</refentry>
+
+<!-- }}} -->
+<!-- {{{ New devices - host-side        -->
+
+<refentry id="synth-new-host">
+  <refmeta>
+    <refentrytitle>Writing New Devices - host</refentrytitle>
+  </refmeta>
+  <refnamediv>
+    <refname>Writing New Devices</refname>
+    <refpurpose>extending the synthetic target, host-side</refpurpose>
+  </refnamediv>
+
+  <refsect1 id="synth-new-host-description"><title>Description</title>
+    <para>
+On the host-side adding a new device means writing a Tcl/Tk script
+that will handle instantiation and subsequent requests from the
+target-side. These scripts all run in the same full interpreter,
+extended with various commands provided by the main I/O auxiliary
+code, and running in an overall GUI framework. Some knowledge of
+programming with Tcl/Tk is required to implement host-side device
+support.
+    </para>
+    <para>
+Some devices can be implemented entirely using a Tcl/Tk script. For
+example, if the final system will have some buttons then those can be
+emulated in the synthetic target using a few Tk widgets. A simple
+emulation could just have the right number of buttons in a row. A more
+advanced emulation could organize the buttons with the right layout,
+perhaps even matching the colour scheme, the shapes, and the relative
+sizes. With other devices it may be necessary for the Tcl script to
+interact with an external program, because the required functionality
+cannot easily be accessed from a Tcl script. For example interacting
+with a raw ethernet device involves some <function>ioctl</function>
+calls, which is easier to do in a C program. Therefore the
+<filename>ethernet.tcl</filename> script which implements the
+host-side ethernet support spawns a separate program
+<filename>rawether</filename>, written in C, that performs the
+low-level I/O. Raw ethernet access usually also requires root
+privileges, and running a small program <filename>rawether</filename>
+with such privileges is somewhat less of a security risk than the
+whole eCos application, the I/O auxiliary, and various dynamically
+loaded Tcl scripts.
+    </para>
+    <para>
+Because all scripts run in a single interpreter, some care has
+to be taken to avoid accidental sharing of global variables. The best
+way to avoid problems is to have each script create its own Tcl
+namespace, so for example the <filename>ethernet.tcl</filename> script
+creates a namespace <varname>ethernet::</varname> and all variables
+and procedures reside in this namespace. Similarly the I/O auxiliary
+itself makes use of a <varname>synth::</varname> namespace.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-build"><title>Building and Installation</title>
+    <para>
+When an eCos device driver or application code instantiates a device,
+the I/O auxiliary will attempt to load a matching Tcl script. The
+third argument to <function>synth_auxiliary_instantiate</function>
+specifies the type of device, for example <literal>ethernet</literal>,
+and the I/O auxiliary will append a <filename>.tcl</filename> suffix
+and look for a script <filename>ethernet.tcl</filename>.
+    </para>
+    <para>
+If the device being instantiated is application-specific rather than
+part of an eCos package, the I/O auxiliary will look first in the
+current directory, then in <filename
+class="directory">~/.ecos/synth</filename>. If it is part of an eCos
+package then the auxiliary will expect to find the Tcl script and any
+support files below <filename
+class="directory">libexec/ecos</filename> in the install tree - note
+that the same install tree must be used for the I/O auxiliary itself
+and for any device driver support. The directory hierarchy below
+<filename class="directory">libexec/ecos</filename> matches the
+structure of the eCos repository, allowing multiple versions of a
+package to be installed to allow for incompatible protocol changes.
+    </para>
+    <para>
+The preferred way to build host-side software is to use
+<command>autoconf</command> and <command>automake</command>. Usually
+this involves little more than copying the
+<filename>acinclude.m4</filename>, <filename>configure.in</filename>
+and <filename>Makefile.am</filename> files from an existing package,
+for example the synthetic target ethernet driver, and then making
+minor edits. In <filename>acinclude.m4</filename> it may be necessary
+to adjust the path to the root of the repository.
+<filename>configure.in</filename> may require a similar change, and
+the <function>AC_INIT</function> macro invocation will have to be
+changed to match one of the files in the new package. A critical macro
+in this file is <filename>ECOS_PACKAGE_DIRS</filename> which will set
+up the correct install directory. <filename>Makefile.am</filename> may
+require some more changes, for example to specify the data files that
+should be installed (including the Tcl script). These files should
+then be processed using <command>aclocal</command>,
+<command>autoconf</command> and <command>automake</command> in that
+order. Actually building the software then just involves
+<command>configure</command>, <command>make</command> and
+<command>make install</command>, as per the instructions in the
+toplevel <filename>README.host</filename> file.
+    </para>
+    <para>
+To assist developers, if the environment variable
+<envar>ECOSYNTH_DEVEL</envar> is set then a slightly different
+algorithm is used for locating device Tcl scripts. Instead of looking
+only in the install tree the I/O auxiliary will also look in the
+source tree, and if the script there is more recent than the installed
+version it will be used in preference. This allows developers to
+modify the master copy without having to run <command>make
+install</command> all the time.
+    </para>
+    <para>
+If a script needs to know where it has been installed it can examine
+the Tcl variable <varname>synth::device_install_dir</varname> . This
+variable gets updated whenever a  script is loaded, so if the
+value may be needed later it should be saved away in a device-specific
+variable. 
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-instantiation"><title>Instantiation</title>
+    <para>
+The I/O auxiliary will <command>source</command> the device-specific
+Tcl script when the eCos application first attempts to instantiate a
+device of that type. The script should return a procedure that will be
+invoked to instantiate a device.
+    </para>
+    <programlisting>
+namespace eval ethernet {
+    &hellip;
+    proc instantiate { id instance data } {
+        &hellip;
+        return ethernet::handle_request
+    }
+}
+return ethernet::instantiate
+</programlisting>
+    <para>
+The <varname>id</varname> argument is a unique identifier for this
+device instance. It will also be supplied on subsequent calls to the
+request handler, and will match the return value of
+<function>synth_auxiliary_instantiate</function> on the target side. A
+common use for this value is as an array index to support multiple
+instances of this types of device. The <varname>instance</varname> and
+<varname>data</varname> arguments match the corresponding arguments to
+<function>synth_auxiliary_instantiate</function> on the target side, so
+a typical value for <varname>instance</varname> would be
+<literal>eth0</literal>, and <varname>data</varname> is used to pass
+arbitrary initialization parameters from target to host.
+    </para>
+    <para>
+The actual work done by the instantiation procedure is obviously
+device-specific. It may involve allocating an <link
+linkend="synth-new-host-interrupts">interrupt vector</link>, adding a
+device-specific subwindow to the display, opening a real Linux device,
+establishing a socket connection to some server, spawning a separate
+process to handle the actual I/O, or a combination of some or all of
+the above.
+    </para>
+    <para>
+If the device is successfully instantiated then the return value
+should be a handler for subsequent I/O requests. Otherwise the return
+value should be an empty string, and on the target-side the
+<function>synth_auxiliary_instantiate</function> call will return
+<literal>-1</literal>. The script is responsible for providing
+<link linkend="synth-new-host-output">diagnostics</link> explaining
+why the device could not be instantiated.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-requests"><title>Handling Requests</title>
+    <para>
+When the target-side calls
+<function>synth_auxiliary_xchgmsg</function>, the I/O auxiliary will
+end up calling the request handler for the appropriate device instance
+returned during instantiation:
+    </para>
+    <programlisting>
+namespace eval ethernet {
+    &hellip;
+    proc handle_request { id request arg1 arg2 txdata txlen max_rxlen } {
+        &hellip;
+        if { &lt;some condition&gt; } {
+            synth::send_reply &lt;error code&gt; 0 ""
+            return
+        }
+        &hellip;
+        synth::send_reply &lt;reply code&gt; $packet_len $packet
+    }
+    &hellip;
+}
+</programlisting>
+    <para>
+The <varname>id</varname> argument is the same device id that was
+passed to the instantiate function, and is typically used as an array
+index to access per-device data. The <varname>request</varname>,
+<varname>arg1</varname>, <varname>arg2</varname>, and
+<varname>max_rxlen</varname> are the same values that were passed to
+<function>synth_auxiliary_xchgmsg</function> on the target-side,
+although since this is a Tcl script obviously the numbers have been
+converted to strings. The <varname>txdata</varname> buffer is raw data
+as transmitted by the target, or an empty string if the I/O operation
+does not involve any additional data. The Tcl procedures
+<command>binary scan</command>, <command>string index</command> and
+<command>string range</command> may be found especially useful when
+manipulating this buffer. <varname>txlen</varname> is provided for
+convenience, although <command>string length $txdata</command> would
+give the same information.
+    </para>
+    <para>
+The code for actually processing the request is of course device
+specific. If the target does not expect a reply then the request
+handler should just return when finished. If a reply is expected then
+there should be a call to <command>synth::send_reply</command>. The
+first argument is the reply code, and will be turned into a 32-bit
+integer on the target side. The second argument specifies the length
+of the reply data, and the third argument is the reply data itself.
+For some devices the Tcl procedure <command>binary format</command>
+may prove useful. If the reply involves just a code and no additional
+data, the second and third arguments should be <literal>0</literal>
+and an empty string respectively.
+    </para>
+    <para>
+Attempts to send a reply when none is expected, fail to send a reply
+when one is expected, or send a reply that is larger than the
+target-side expects, will all be detected by the I/O auxiliary and
+result in run-time error messages.
+    </para>
+    <para>
+It is not possible for the host-side code to send unsolicited messages
+to the target. If host-side code needs attention from the target, for
+example because some I/O operation has completed, then an interrupt
+should be raised.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-interrupts"><title>Interrupts</title>
+    <para>
+The I/O auxiliary provides a number of procedures for interrupt
+handling. 
+    </para>
+    <programlisting>
+synth::interrupt_allocate &lt;name&gt;
+synth::interrupt_get_max
+synth::interrupt_get_devicename &lt;vector&gt;
+synth::interrupt_raise &lt;vector&gt;
+</programlisting>
+    <para>
+<command>synth::interrupt_allocate</command> is normally called during
+device instantiation, and returns the next free interrupt vector. This
+can be passed on to the target-side device driver in response to a
+suitable request, and it can then install an interrupt handler on that
+vector. Interrupt vector <literal>0</literal> is used within the
+target-side code for the real-time clock, so the allocated vectors
+will start at <literal>1</literal>. The argument identifies the
+device, for example <literal>eth0</literal>. This is not actually used
+internally, but can be accessed by user-initialization scripts that
+provide some sort of interrupt monitoring facility (typically via the
+<literal>interrupt</literal> <link
+linkend="synth-new-host-hooks">hook</link>). It is possible for a
+single device to allocate multiple interrupt vectors, but the
+synthetic target supports a maximum of 32 such vectors.
+    </para>
+    <para>
+<command>synth::interrupt_get_max</command> returns the highest
+interrupt vector that has been allocated, or <literal>0</literal> if
+there have been no calls to
+<command>synth::interrupt_allocate</command>.
+<command>synth::interrupt_get_devicename</command> returns the string
+that was passed to <command>synth::interrupt_allocate</command> when
+the vector was allocated.
+    </para>
+    <para>
+<command>synth::interrupt_raise</command> can be called any time after
+initialization. The argument should be the vector returned by
+<command>synth::interrupt_allocate</command> for this device. It will
+activate the normal eCos interrupt handling mechanism so, subject to
+interrupts being enabled and this particular interrupt not being
+masked out, the appropriate ISR will run.
+    </para>
+    <note><para>
+At this time it is not possible for a device to allocate a specific
+interrupt vector. The order in which interrupt vectors are assigned to
+devices effectively depends on the order in which the eCos devices get
+initialized, and that may change if the eCos application is rebuilt. A
+future extension may allow devices to allocate specific vectors, thus
+making things more deterministic. However that will introduce new
+problems, in particular the code will have to start worrying about
+requests for vectors that have already been allocated.
+    </para></note>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-args"><title>Flags and Command Line Arguments</title>
+    <para>
+The generic I/O auxiliary code will process the standard command line
+arguments, and will set various flag variables accordingly. Some of
+these should be checked by device-specific scripts.
+    </para>
+    <variablelist>
+      <varlistentry>
+        <term><varname>synth::flag_gui</varname></term>
+        <listitem><para>
+This is set when the I/O auxiliary is operating in graphical mode
+rather than text mode. Some functionality such as filters and the GUI
+layout are only available in graphical mode.
+        </para>
+        <programlisting>
+    if { $synth::flag_gui } {
+        &hellip;
+    }
+</programlisting></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>synth::flag_verbose</varname></term>
+         <listitem><para>
+The user has requested additional information during startup. Each
+device driver can decide how much additional information, if any,
+should be produced.
+         </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>synth::flag_keep_going</varname></term>
+        <listitem><para>
+The user has specified <option>-k</option> or
+<option>--keep-going</option>, so even if an error occurs the I/O
+auxiliary and the various device driver scripts should continue running
+if at all possible. Diagnostics should still be generated.
+        </para></listitem>
+      </varlistentry>
+    </variablelist>
+    <para>
+Some scripts may want to support additional command line arguments.
+This facility should be used with care since there is no way to
+prevent two different scripts from trying to use the same argument.
+The following Tcl procedures are available:
+    </para>
+    <programlisting>
+synth::argv_defined &lt;name&gt;
+synth::argv_get_value &lt;name&gt;
+</programlisting>
+    <para>
+<command>synth::argv_defined</command> returns a boolean to indicate
+whether or not a particular argument is present. If the argument is
+the name part of a name/value pair, an <literal>=</literal> character
+should be appended. Typical uses might be:
+    </para>
+    <programlisting>
+    if { [synth::argv_defined "-o13"] } {
+        &hellip;
+    }
+
+    if { [synth::argv_defined "-mark="] } {
+        &hellip;
+    }
+</programlisting>
+    <para>
+The first call checks for a flag <literal>-o13</literal> or
+<literal>--o13</literal> - the code treats options with single and
+double hyphens interchangeably. The second call checks for an argument
+of the form <literal>-mark=&lt;value&gt;</literal> or a pair of
+arguments <literal>-mark &lt;value&gt;</literal>. The value part of a
+name/value pair can be obtained using
+<command>synth::argv_get_value</command>;
+    </para>
+    <programlisting>
+    variable speed 1
+    if { [synth::argv_defined "-mark="] } {
+        set mark [synth::argv_get_value "-mark="]
+        if { ![string is integer $mark] || ($mark < 1) || ($mark > 9) } {
+            &lt;issue diagnostic&gt;
+        } else {
+            set speed $mark
+        }
+    }
+</programlisting>
+    <para>
+<command>synth::argv_get_value</command> should only be used after a
+successful call to <command>synth::argv_defined</command>.
+At present there is no support for some advanced forms of command line
+argument processing. For example it is not possible to repeat a
+certain option such as <option>-v</option> or
+<option>--verbose</option>, with each occurrence increasing the level
+of verbosity. 
+    </para>
+    <para>
+If a script is going to have its own set of command-line arguments
+then it should give appropriate details if the user specifies
+<option>--help</option>. This involves a hook function:
+    </para>
+    <programlisting>
+namespace eval my_device {
+    proc help_hook { } {
+        puts " -o13          : activate the omega 13 device"
+        puts " -mark &lt;speed&gt; : set speed. Valid values are 1 to 9."
+    }
+
+    synth::hook_add "help" my_device::help_hook
+}
+</programlisting>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-tdf"><title>The Target Definition File</title>
+    <para>
+Most device scripts will want to check entries in the target
+definition file for run-time configuration information. The Tcl
+procedures for this are as follows:
+    </para>
+    <programlisting>
+synth::tdf_has_device &lt;name&gt;
+synth::tdf_get_devices
+synth::tdf_has_option &lt;devname&gt; &lt;option&gt;
+synth::tdf_get_option &lt;devname&gt; &lt;option&gt;
+synth::tdf_get_options &lt;devname&gt; &lt;option&gt;
+synth::tdf_get_all_options &lt;devname&gt;
+</programlisting>
+    <para>
+<command>synth::tdf_has_device</command> can be used to check whether
+or not the target definition file had an entry
+<literal>synth_device&nbsp;&lt;name&gt;</literal>. Usually the name
+will match the type of device, so the
+<filename>console.tcl</filename> script will look for a target
+definition file entry <literal>console</literal>.
+<command>synth::tdf_get_devices</command> returns a list of all
+device entries in the target definition file.
+    </para>
+    <para>
+Once it is known that the target definition file has an entry for a
+certain device, it is possible to check for options within the entry.
+<command>synth::tdf_has_option</command> just checks for the presence,
+returning a boolean:
+    </para>
+    <programlisting>
+    if { [synth::tdf_has_option "console" "appearance"] } {
+        &hellip;
+    }
+</programlisting>
+    <para>
+<command>synth::tdf_get_option</command> returns a list of all the
+arguments for a given option. For example, if the target definition
+file contains an entry:
+    </para>
+    <programlisting>
+synth_device console {
+    appearance -foreground white -background black
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+    filter xyzzy {.*xyzzy.*} -foreground PapayaWhip
+}
+</programlisting>
+    <para>
+A call
+<command>synth::tdf_get_option&nbsp;console&nbsp;appearance</command>
+will return the list <literal>{-foreground white -background
+black}</literal>. This list can be manipulated using standard Tcl routines
+such as <command>llength</command> and <command>lindex</command>. Some
+options can occur multiple times in one entry, for example
+<option>filter</option> in the <literal>console</literal> entry.
+<command>synth::tdf_get_options</command> returns a list of lists,
+with one entry for each option occurrence.
+<command>synth::tdf_get_all_options</command> returns a list of lists
+of all options. This time each entry will include the option name as
+well.
+    </para>
+    <para>
+The I/O auxiliary will not issue warnings about entries in the target
+definition file for devices which were not loaded, unless the
+<option>-v</option> or <option>--verbose</option> command line
+argument was used. This makes it easier to use a single target
+definition file for different applications. However the auxiliary will
+issue warnings about options within an entry that were ignored,
+because often these indicate a typing mistake of some sort. Hence a
+script should always call <command>synth::tdf_has_option</command>,
+<command>synth:;tdf_get_option</command> or
+<command>synth::tdf_get_options</command> for all valid options, even
+if some of the options preclude the use of others.
+    </para>
+  </refsect1>
+
+  <refsect1 id="synth-new-host-hooks"><title>Hooks</title>
+    <para>
+Some scripts may want to take action when particular events occur, for
+example when the eCos application has exited and there is no need for
+further I/O. This is supported using hooks:
+    </para>
+    <programlisting>
+namespace eval my_device {
+    &hellip;
+    proc handle_ecos_exit { arg_list } {
+        &hellip;
+    }
+    synth::hook_add "ecos_exit" my_device::handle_ecos_exit
+}
+</programlisting>
+    <para>
+It is possible for device scripts to add their own hooks and call all
+functions registered for those hooks. A typical use for this is by
+user initialization scripts that want to monitor some types of I/O.
+The available Tcl procedures for manipulating hooks are:
+    </para>
+    <programlisting>
+synth::hook_define &lt;name&gt;
+synth::hook_defined &lt;name&gt;
+synth::hook_add &lt;name&gt; &lt;function&gt;
+synth::hook_call &lt;name&gt; &lt;args&gt;
+</programlisting>
+    <para>
+<command>synth::hook_define</command> creates a new hook with the
+specified name. This hook must not already exist.
+<command>synth::hook_defined</command> can be used to check for the
+existence of a hook. <command>synth::hook_add</command> allows other
+scripts to register a callback function for this hook, and
+<command>synth::hook_call</command> allows the owner script to invoke
+all such callback functions. A hook must already be defined before a
+callback can be attached. Therefore typically device scripts will only
+use standard hooks and their own hooks, not hooks created by some
+other device, because the order of device initialization is not
+sufficiently defined. User scripts run from
+<filename>mainrc.tcl</filename> can use any hooks that have been
+defined.
+    </para>
+    <para>
+<command>synth::hook_call</command> takes an arbitrary list of
+arguments, for example:
+    </para>
+    <programlisting>
+    synth::hook_call "ethernet_rx" "eth0" $packet
+</programlisting>
+    <para>
+The callback function will always be invoked with a single argument,
+a list of the arguments that were passed to
+<command>synth::hook_call</command>: 
+    </para>
+    <programlisting>
+    proc rx_callback { arg_list } {
+        set device [lindex $arg_list 0]
+        set packet [lindex $arg_list 1]
+    }
+</programlisting>
+    <para>
+Although it might seem more appropriate to use Tcl's
+<command>eval</command> procedure and have the callback functions
+invoked with the right number of arguments rather than a single list,
+that would cause serious problems if any of the data contained special
+characters such as <literal>[</literal> or <literal>$</literal>. The
+current implementation of hooks avoids such problems, at the cost of
+minor inconvenience when writing callbacks.
+    </para>
+    <para>
+A number of hooks are defined as standard. Some devices will add
+additional hooks, and the device-specific documentation should be
+consulted for those. User scripts can add their own hooks if desired.
+    </para>
+    <variablelist>
+      <varlistentry>
+        <term><literal>exit</literal></term>
+        <listitem><para>
+This hook is called just before the I/O auxiliary exits. Hence it
+provides much the same functionality as <function>atexit</function> in
+C programs. The argument list passed to the callback function will be
+empty. 
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><literal>ecos_exit</literal></term>
+        <listitem><para>
+This hook is called when the eCos application has exited. It is used
+mainly to shut down I/O operations: if the application is no longer
+running then there is no point in raising interrupts or storing
+incoming packets. The callback argument list will be empty.
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><literal>ecos_initialized</literal></term>
+        <listitem><para>
+The synthetic target HAL will send a request to the I/O auxiliary once
+the static constructors have been run. All devices should now have been
+instantiated. A script could now check how many instances there are of
+a given type of device, for example ethernet devices, and create a
+little monitor window showing traffic on all the devices. The
+<literal>ecos_initialized</literal> callbacks will be run just before
+the user's <filename>mainrc.tcl</filename> script. The callback
+argument list will be empty.
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><literal>help</literal></term>
+        <listitem><para>
+This hook is also invoked once static constructors have been run, but
+only if the user specified <option>-h</option> or
+<option>--help</option>. Any scripts that add their own command line
+arguments should add a callback to this hook which outputs details of
+the additional arguments. The callback argument list will be empty.
+        </para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><literal>interrupt</literal></term>
+        <listitem><para>
+Whenever a device calls <command>synth::interrupt_raise</command> the
+<literal>interrupt</literal> hook will be called with a single
+argument, the interrupt vector. The main use for this is to allow
+user scripts to monitor interrupt traffic.
+        </para></listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  
+  <refsect1 id="synth-new-host-output"><title>Output and Filters</title>
+    <para>
+Scripts can use conventional facilities for sending text output to the
+user, for example calling <command>puts</command> or directly
+manipulating the central text widget
+<varname>.main.centre.text</varname>. However in nearly all cases it
+is better to use output facilities provided by the I/O auxiliary
+itself: 
+    </para>
+    <programlisting>
+synth::report &lt;msg&gt;
+synth::report_warning &lt;msg&gt;
+synth::report_error &lt;msg&gt;
+synth::internal_error &lt;msg&gt;
+synth::output &lt;msg&gt; &lt;filter&gt;
+</programlisting>
+    <para>
+<command>synth::report</command> is intended for messages related to
+the operation of the I/O auxiliary itself, especially additional
+output resulting from <option>-v</option> or
+<option>--verbose</option>. If running in text mode the output will go
+to standard output. If running in graphical mode the output will go to
+the central text window. In both modes, use of <option>-l</option> or
+<option>--logfile</option> will modify the behaviour.
+    </para>
+    <para>
+<command>synth::report_warning</command>,
+<command>synth::report_error</command> and
+<command>synth::internal_error</command> have the obvious meaning,
+including prepending strings such as <literal>Warning:</literal> and
+<literal>Error:</literal>. When the eCos application informs the I/O
+auxiliary that all static constructors have run, if at that point
+there have been any calls to <command>synth::error</command> then the
+I/O auxiliary will exit. This can be suppressed with command line
+arguments <option>-k</option> or <option>--keep-going</option>.
+<command>synth::internal_error</command> will output some information
+about the current state of the I/O auxiliary and then exit
+immediately. Of course it should never be necessary to call this
+function. 
+    </para>
+    <para>
+<command>synth::output</command> is the main routine for outputting
+text. The second argument identifies a filter. If running in text mode
+the filter is ignored, but if running in graphical mode the filter can
+be used to control the appearance of this output. A typical use would
+be:
+    </para>
+    <programlisting>
+    synth::output $line "console"
+</programlisting>
+    <para>
+This outputs a single line of text using the
+<literal>console</literal> filter. If running in graphical mode the
+default appearance of this text can be modified with the
+<option>appearance</option> option in the
+<command>synth_device&nbsp;console</command> entry of the target
+definition file. The <guimenuitem>System filters</guimenuitem> menu
+option can be used to change the appearance at run-time.
+    </para>
+    <para>
+Filters should be created before they are used. The procedures
+available for this are:
+    </para>
+    <programlisting>
+synth::filter_exists &lt;name&gt;
+synth::filter_get_list
+synth::filter_add &lt;name&gt; [options]
+synth::filter_parse_options &lt;options&gt; &lt;parsed_options&gt; &lt;message&gt;
+synth::filter_add_parsed &lt;name&gt; &lt;parsed_options&gt;
+</programlisting>
+    <para>
+<command>synth::filter_exists</command> can be used to check whether
+or not a particular filter already exists: creating two filters with
+the same name is not allowed.
+<command>synth::filter_get_list</command> returns a list of the
+current known filters. <command>synth::filter_add</command> can be
+used to create a new filter. The first argument names the new filter,
+and the remaining arguments control the initial appearance. A typical
+use might be:
+    </para>
+    <programlisting>
+    synth::filter_add "my_device_tx" -foreground yellow -hide 1
+</programlisting>
+    <para>
+It is assumed that the supplied arguments are valid, which typically
+means that they are hard-wired in the script. If instead the data
+comes out of a configuration file and hence may be invalid, the
+I/O auxiliary provides a parsing utility. Typical usage would be:
+    </para>
+    <programlisting>
+    array set parsed_options [list]
+    set message ""
+    if { ![synth::filter_parse_options $console_appearance parsed_options message] } {
+        synth::report_error \
+	        "Invalid entry in target definition file $synth::target_definition\
+	         \n  synth_device \"console\", entry \"appearance\"\n$message"
+    } else {
+        synth::filter_add_parsed "console" parsed_options
+    }
+</programlisting>
+    <para>
+On success <varname>parsed_options</varname> will be updated with an
+internal representation of the desired appearance, which can then be
+used in a call to <command>synth::filter_add_parsed</command>. On
+failure <varname>message</varname> will be updated with details of the
+parsing error that occurred.
+    </para>
+  </refsect1>
+  
+  <refsect1 id="synth-new-host-gui"><title>The Graphical Interface</title>
+    <para>
+When the I/O auxiliary is running in graphical mode, many scripts will
+want to update the user interface in some way. This may be as simple
+as adding another entry to the help menu for the device, or adding a
+new button to the toolbar. It may also involve adding new subwindows,
+or even creating entire new toplevel windows. These may be simple
+monitor windows, displaying additional information about what is going
+on in the system in a graphical format. Alternatively they may emulate
+actual I/O operations, for example button widgets could be used to
+emulate real physical buttons.
+    </para>
+    <para>
+The I/O auxiliary does not provide many procedures related to the
+graphical interface. Instead it is expected that scripts will just
+update the widget hierarchy directly.
+    </para>
+    <informalfigure PgWide=1>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="layout.gif" format="gif" Scalefit=1 Align="Center">
+        </imageobject>
+      </mediaobject>
+    </informalfigure>
+    <para>
+So adding a new item to the <guimenu>Help</guimenu> menu involves a
+<command>.menubar.help&nbsp;add</command> operation with suitable
+arguments. Adding a new button to the toolbar involves creating a
+child window in <varname>.toolbar</varname> and packing it
+appropriately. Scripts can create their own subwindows and then pack
+it into one of <varname>.main.nw</varname>,
+<varname>.main.n</varname>, <varname>.main.ne</varname>,
+<varname>.main.w</varname>, <varname>.main.e</varname>,
+<varname>.main.sw</varname>, <varname>.main.s</varname> or
+<varname>.main.se</varname>. Normally the user should be allowed to
+<link linkend="synth-gui-layout">control</link> this via the target
+definition file. The central window <varname>.main.centre</varname>
+should normally be left alone by other scripts since it gets used for
+text output.
+    </para>
+    <para>
+The following graphics-related utilities may be found useful:
+    </para>
+    <programlisting>
+synth::load_image &lt;image name&gt; &lt;filename&gt;
+synth::register_ballon_help &lt;widget&gt; &lt;message&gt;
+synth::handle_help &lt;URL&gt;
+</programlisting>
+    <para>
+<command>synth::load_image</command> can be used to add a new image to
+the current interpreter. If the specified file has a
+<filename>.xbm</filename> extension then the image will be a
+monochrome bitmap, otherwise it will be a colour image of some sort.
+A boolean will be returned to indicate success or failure, and
+suitable diagnostics will be generated if necessary.
+    </para>
+    <para>
+<command>synth::register_balloon_help</command> provides balloon help
+for a specific widget, usually a button on the toolbar.
+    </para>
+    <para>
+<command>synth::handle_help</command> is a utility routine that can be
+installed as the command for displaying online help, for example:
+    </para>
+    <programlisting>
+    .menubar.help add command -label "my device" -command \
+        [list synth::handle_help "file://$path"]
+</programlisting>
+  </refsect1>
+  
+</refentry>
+
+<!-- }}} -->
 <!-- {{{ Porting                        -->
 
 <refentry id="synth-porting">
@@ -418,7 +2562,7 @@ GNU C library sources.
   </refmeta>
   <refnamediv>
     <refname>Porting</refname>
-    <refpurpose>The eCos synthetic target</refpurpose>
+    <refpurpose>Adding support for other hosts</refpurpose>
   </refnamediv>
 
   <refsect1 id="synth-porting-description"><title>Description</title>
@@ -430,7 +2574,7 @@ straightforward, for example a port to L
 an x86. Porting to Unix or Unix-like operating systems other than
 Linux may be possible, but would involve more effort. Porting to a
 completely different operating system such as Windows would be very
-difficult. The text below completes the eCos Porting Guide.
+difficult. The text below complements the eCos Porting Guide.
     </para>
   </refsect1>
 
@@ -445,28 +2589,28 @@ Most of the changes should be pretty obv
 processor some new data types will be needed in the
 <filename>basetype.h</filename> header file. It will also be necessary
 to update the toplevel <filename>ecos.db</filename> database with an
-entry for the new HAL package, and a new target entry will be needed
-as well.
+entry for the new HAL package, and a new target entry will be needed.
     </para>
     <para>
-Obviously a different processor will have different register sets
-and calling conventions, so the code for saving and restoring thread
+Obviously a different processor will have different register sets and
+calling conventions, so the code for saving and restoring thread
 contexts and for implementing <function>setjmp</function> and
 <function>longjmp</function> will need to be updated. The exact way of
-performing Linux system calls will also vary: on i386linux this
-usually involves pushing some registers on the stack and then
-executing an <literal>int&nbsp;0x080</literal> trap instruction, but
-on a different processor the arguments might be passed in registers
-instead and certainly a different trap instruction will be used. The
-startup code is also written in assembler, but needs to do little more
-than jump to the main <function>linux_entry</function> function
-provided by the architectural synthetic target HAL package.
+performing Linux system calls will vary: on x86 linux this usually
+involves pushing some registers on the stack and then executing an
+<literal>int&nbsp;0x080</literal> trap instruction, but on a different
+processor the arguments might be passed in registers instead and
+certainly a different trap instruction will be used. The startup code
+is written in assembler, but needs to do little more than extract the
+process' argument and environment variables and then jump to the main
+<function>linux_entry</function> function provided by the
+architectural synthetic target HAL package.
     </para>
     <para>
 The header file <filename>hal_io.h</filename> provided by the
 architectural HAL package provides various structure definitions,
 function prototypes, and macros related to system calls. These are
-correct for i386linux, but there may be problems on other processors.
+correct for x86 linux, but there may be problems on other processors.
 For example a structure field that is currently defined as a 32-bit
 number may in fact may be a 64-bit number instead.
     </para>
@@ -484,7 +2628,10 @@ but usually eCos applications can and sh
     <para>
 Other HAL functionality such as interrupt handling, diagnostics, and
 the system clock are provided by the architectural HAL package and
-should work on different processors with few if any changes.
+should work on different processors with few if any changes. There may
+be some problems in the code that interacts with the I/O auxiliary
+because of lurking assumptions about endianness or the sizes of
+various data types.
     </para>
     <para>
 When porting to other processors, a number of sources of information
@@ -499,11 +2646,11 @@ provides the startup code and the system
   <refsect1 id="synth-porting-unix"><title>Other Unix Platforms</title>
     <para>
 Porting to a Unix or Unix-like operating system other than Linux would
-be somewhat more involved. The first requirement involves toolchains:
-the GNU compilers, gcc and g++, must definitely be used; use of other
-GNU tools such as the linker may be needed as well, because eCos
-depends on functionality such as prioritizing C++ static constructors,
-and other linkers may not implement this or may implement it in a
+be somewhat more involved. The first requirement is toolchains: the
+GNU compilers, gcc and g++, must definitely be used; use of other GNU
+tools such as the linker may be needed as well, because eCos depends
+on functionality such as prioritizing C++ static constructors, and
+other linkers may not implement this or may implement it in a
 different and incompatible way. A closely related requirement is the
 use of ELF format for binary executables: if the operating system
 still uses an older format such as COFF then there are likely to be
@@ -529,6 +2676,13 @@ simple system calls, and instead wrapper
 implemented at the variant HAL level.
     </para>
     <para>
+The generic I/O auxiliary code should be fairly portable to other Unix
+platforms. However some of the device drivers may contain code that is
+specific to Linux, for example the <literal>PF_PACKET</literal> socket
+address family and the ethertap virtual tunnelling interface. These
+may prove quite difficult to port.
+    </para>
+    <para>
 The remaining porting task is to implement one or more platform HAL
 packages, one per processor type that is supported. This should
 involve much the same work as a port to <link
@@ -541,14 +2695,6 @@ However there is still a good chance tha
 been ported already, so its source code may contain much useful
 information. 
     </para>
-    <caution><para>
-Users should be aware that future enhancements to the synthetic target
-code, especially in areas related to I/O, may be much more closely
-tied to Linux. For example access to ethernet facilities might be
-implemented using the <literal>PF_PACKET</literal> socket address
-family, or the virtual tunnelling interface. Porting such code to
-other Unix operating systems may prove rather more difficult.
-    </para></caution>
   </refsect1>
 
   <refsect1 id="synth-porting-other"><title>Windows Platforms</title>
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/Makefile.am
@@ -0,0 +1,92 @@
+## Process this file with automake to produce Makefile.in
+## =====================================================================
+##
+##     Makefile.am
+##
+##     Build support for the host-side synthetic target support,
+##     the arch package.
+##     
+##
+## =====================================================================
+######COPYRIGHTBEGIN####
+#                                                                          
+# ----------------------------------------------------------------------------
+# Copyright (C) 2002 Bart Veer
+#
+# This file is part of the eCos synthetic target support.
+#
+# This program is free software; you can redistribute it and/or modify it 
+# under the terms of the GNU General Public License as published by the Free 
+# Software Foundation; either version 2 of the License, or (at your option) 
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful, but WITHOUT 
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+# more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ----------------------------------------------------------------------------
+#                                                                          
+######COPYRIGHTEND####
+## =====================================================================
+#######DESCRIPTIONBEGIN####
+##
+## Author(s):	bartv
+## Contact(s):	bartv
+## Date:	2002/08/06
+## Version:	0.01
+##
+######DESCRIPTIONEND####
+## =====================================================================
+
+AUTOMAKE_OPTIONS = 1.3 foreign
+
+## Only some platforms are supported. Having the configure script throw
+## an error when attempting to configure on an unsupported platform
+## would be a mistake, since that would prevent any configury from
+## the toplevel on unsupported platforms. Instead an automake conditional
+## is used, leading to null makefiles on unsupported platforms.
+
+if SUPPORTED
+
+AM_CFLAGS       = @ecos_CFLAGS@ -DECOSYNTH_VERSION=\"@VERSION@\" \
+ -DECOS_REPOSITORY=\"@ECOS_REPOSITORY@\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DPACKAGE_DIR=\"@PACKAGE_DIR@\" \
+ -DPACKAGE_VERSION=\"@PACKAGE_VERSION@\" \
+ -DPACKAGE_INSTALL=\"@PACKAGE_INSTALL@\"
+AM_CXXFLAGS     = @ecos_CXXFLAGS@
+INCLUDES        = @ecos_INCLUDES@
+LIBS            = @ecos_LIBS@ @ecos_LDADD@
+
+## The synthetic target support consists of a single program ecosynth,
+## a number of Tcl scripts, and some additional data files. These are
+## all installed in a single directory $(libexec)/ecos/<package>_<version>/
+## Neither the ecosynth executable nor any of the scripts are directly
+## executable, instead ecosynth gets fork()'d/execve()'d by the eCos
+## application so $(libexec) is appropriate. Strictly speaking the
+## Tcl scripts and data files are architecture-independent so should
+## probably be installed in an analogous directory below $(datadir),
+## but that would add more directories for little real gain. The scripts
+## are treated as data files since they should not be executed directly,
+## i.e. they should not be installed with the execute bit set.
+
+synthdir 		= $(libexecdir)/ecos/@PACKAGE_INSTALL@
+synth_PROGRAMS		= ecosynth
+synth_DATA		= ecosynth.tcl default.tdf user_initrc.tcl user_mainrc.tcl \
+                          console.tcl \
+                          ecosicon.xbm ecosiconmask.xbm tick_yes.xbm tick_no.xbm \
+                          save.xbm cut.xbm copy.xbm paste.xbm help.xbm running1.ppm \
+                          saveall.xbm
+
+ecosynth_SOURCES	= ecosynth.c
+ecosynth_LDADD		= @ecos_tk_libs@
+
+## Manual dependencies
+ecosynth.$(OBJEXT)	: Makefile ../src/synth_protocol.h
+
+endif
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/Makefile.in
@@ -0,0 +1,449 @@
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+######COPYRIGHTBEGIN####
+#                                                                          
+# ----------------------------------------------------------------------------
+# Copyright (C) 2002 Bart Veer
+#
+# This file is part of the eCos synthetic target support.
+#
+# This program is free software; you can redistribute it and/or modify it 
+# under the terms of the GNU General Public License as published by the Free 
+# Software Foundation; either version 2 of the License, or (at your option) 
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful, but WITHOUT 
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+# more details.
+# 
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ----------------------------------------------------------------------------
+#                                                                          
+######COPYRIGHTEND####
+#######DESCRIPTIONBEGIN####
+######DESCRIPTIONEND####
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+CC = @CC@
+CXX = @CXX@
+ECOS_REPOSITORY = @ECOS_REPOSITORY@
+EXEEXT = @EXEEXT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MSVC_SRCDIR = @MSVC_SRCDIR@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_DIR = @PACKAGE_DIR@
+PACKAGE_INSTALL = @PACKAGE_INSTALL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+VERSION = @VERSION@
+ecos_CFLAGS = @ecos_CFLAGS@
+ecos_CXXFLAGS = @ecos_CXXFLAGS@
+ecos_INCLUDES = @ecos_INCLUDES@
+ecos_LDADD = @ecos_LDADD@
+ecos_LIBS = @ecos_LIBS@
+ecos_infra_incdir = @ecos_infra_incdir@
+ecos_infra_libdir = @ecos_infra_libdir@
+ecos_libcdl_incdir = @ecos_libcdl_incdir@
+ecos_libcdl_libdir = @ecos_libcdl_libdir@
+ecos_tk_libs = @ecos_tk_libs@
+
+AUTOMAKE_OPTIONS = 1.3 foreign
+
+@SUPPORTED_TRUE@AM_CFLAGS = @SUPPORTED_TRUE@@ecos_CFLAGS@ -DECOSYNTH_VERSION=\"@VERSION@\" \
+@SUPPORTED_TRUE@ -DECOS_REPOSITORY=\"@ECOS_REPOSITORY@\" \
+@SUPPORTED_TRUE@ -DLIBEXECDIR=\"$(libexecdir)\" \
+@SUPPORTED_TRUE@ -DPACKAGE_DIR=\"@PACKAGE_DIR@\" \
+@SUPPORTED_TRUE@ -DPACKAGE_VERSION=\"@PACKAGE_VERSION@\" \
+@SUPPORTED_TRUE@ -DPACKAGE_INSTALL=\"@PACKAGE_INSTALL@\"
+@SUPPORTED_TRUE@AM_CXXFLAGS = @SUPPORTED_TRUE@@ecos_CXXFLAGS@
+@SUPPORTED_TRUE@INCLUDES = @SUPPORTED_TRUE@@ecos_INCLUDES@
+@SUPPORTED_TRUE@LIBS = @SUPPORTED_TRUE@@ecos_LIBS@ @ecos_LDADD@
+
+@SUPPORTED_TRUE@synthdir = @SUPPORTED_TRUE@$(libexecdir)/ecos/@PACKAGE_INSTALL@
+@SUPPORTED_TRUE@synth_PROGRAMS = @SUPPORTED_TRUE@ecosynth
+@SUPPORTED_TRUE@synth_DATA = @SUPPORTED_TRUE@ecosynth.tcl default.tdf user_initrc.tcl user_mainrc.tcl \
+@SUPPORTED_TRUE@                          console.tcl \
+@SUPPORTED_TRUE@                          ecosicon.xbm ecosiconmask.xbm tick_yes.xbm tick_no.xbm \
+@SUPPORTED_TRUE@                          save.xbm cut.xbm copy.xbm paste.xbm help.xbm running1.ppm \
+@SUPPORTED_TRUE@                          saveall.xbm
+
+@SUPPORTED_TRUE@ecosynth_SOURCES = @SUPPORTED_TRUE@ecosynth.c
+@SUPPORTED_TRUE@ecosynth_LDADD = @SUPPORTED_TRUE@@ecos_tk_libs@
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../../../acsupport/mkinstalldirs
+CONFIG_CLEAN_FILES = 
+@SUPPORTED_TRUE@synth_PROGRAMS =  ecosynth$(EXEEXT)
+PROGRAMS =  $(synth_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) 
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+@SUPPORTED_TRUE@ecosynth_OBJECTS =  ecosynth.$(OBJEXT)
+@SUPPORTED_TRUE@ecosynth_DEPENDENCIES = 
+ecosynth_LDFLAGS = 
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DATA =  $(synth_DATA)
+
+DIST_COMMON =  Makefile.am Makefile.in acinclude.m4 aclocal.m4 configure \
+configure.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+DEP_FILES =  .deps/ecosynth.P
+SOURCES = $(ecosynth_SOURCES)
+OBJECTS = $(ecosynth_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .obj .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4
+	cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+mostlyclean-synthPROGRAMS:
+
+clean-synthPROGRAMS:
+	-test -z "$(synth_PROGRAMS)" || rm -f $(synth_PROGRAMS)
+
+distclean-synthPROGRAMS:
+
+maintainer-clean-synthPROGRAMS:
+
+install-synthPROGRAMS: $(synth_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(synthdir)
+	@list='$(synth_PROGRAMS)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(synthdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+	     $(INSTALL_PROGRAM) $$p $(DESTDIR)$(synthdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	  else :; fi; \
+	done
+
+uninstall-synthPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	list='$(synth_PROGRAMS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(synthdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	done
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+	$(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+	-rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+ecosynth$(EXEEXT): $(ecosynth_OBJECTS) $(ecosynth_DEPENDENCIES)
+	@rm -f ecosynth$(EXEEXT)
+	$(LINK) $(ecosynth_LDFLAGS) $(ecosynth_OBJECTS) $(ecosynth_LDADD) $(LIBS)
+
+install-synthDATA: $(synth_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(synthdir)
+	@list='$(synth_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(synthdir)/$$p"; \
+	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(synthdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(synthdir)/$$p"; \
+	    $(INSTALL_DATA) $$p $(DESTDIR)$(synthdir)/$$p; \
+	  fi; fi; \
+	done
+
+uninstall-synthDATA:
+	@$(NORMAL_UNINSTALL)
+	list='$(synth_DATA)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(synthdir)/$$p; \
+	done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	-rm -rf $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+	mkdir $(distdir)/=build
+	mkdir $(distdir)/=inst
+	dc_install_base=`cd $(distdir)/=inst && pwd`; \
+	cd $(distdir)/=build \
+	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist
+	-rm -rf $(distdir)
+	@banner="$(distdir).tar.gz is ready for distribution"; \
+	dashes=`echo "$$banner" | sed s/./=/g`; \
+	echo "$$dashes"; \
+	echo "$$banner"; \
+	echo "$$dashes"
+dist: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+dist-all: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+distdir: $(DISTFILES)
+	-rm -rf $(distdir)
+	mkdir $(distdir)
+	-chmod 777 $(distdir)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-synthPROGRAMS install-synthDATA
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-synthPROGRAMS uninstall-synthDATA
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(synthdir) $(DESTDIR)$(synthdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-synthPROGRAMS mostlyclean-compile \
+		mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am:  clean-synthPROGRAMS clean-compile clean-tags clean-depend \
+		clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am:  distclean-synthPROGRAMS distclean-compile distclean-tags \
+		distclean-depend distclean-generic clean-am
+
+distclean: distclean-am
+	-rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-synthPROGRAMS \
+		maintainer-clean-compile maintainer-clean-tags \
+		maintainer-clean-depend maintainer-clean-generic \
+		distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+	-rm -f config.status
+
+.PHONY: mostlyclean-synthPROGRAMS distclean-synthPROGRAMS \
+clean-synthPROGRAMS maintainer-clean-synthPROGRAMS \
+uninstall-synthPROGRAMS install-synthPROGRAMS mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+uninstall-synthDATA install-synthDATA tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+@SUPPORTED_TRUE@ecosynth.$(OBJEXT)	: Makefile ../src/synth_protocol.h
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/acinclude.m4
@@ -0,0 +1,46 @@
+dnl Process this file with aclocal to get an aclocal.m4 file. Then
+dnl process that with autoconf.
+dnl ====================================================================
+dnl
+dnl     acinclude.m4
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos host tools.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/08/06
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+dnl Access shared macros.
+dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
+dnl incorporate the macro into aclocal.m4
+sinclude(../../../../../../acsupport/acinclude.m4)
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/aclocal.m4
@@ -0,0 +1,184 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+dnl Process this file with aclocal to get an aclocal.m4 file. Then
+dnl process that with autoconf.
+dnl ====================================================================
+dnl
+dnl     acinclude.m4
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos host tools.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/08/06
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+dnl Access shared macros.
+dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
+dnl incorporate the macro into aclocal.m4
+sinclude(../../../../../../acsupport/acinclude.m4)
+
+# Define a conditional.
+
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "[$]*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "[$]*" != "X $srcdir/configure conftestfile" \
+      && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "[$]2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+   $1=$2
+   AC_MSG_RESULT(found)
+else
+   $1="$3/missing $2"
+   AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
+
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/configure
@@ -0,0 +1,2013 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer"
+ac_help="$ac_help
+ --enable-debug           do a debug rather than a release build"
+ac_help="$ac_help
+ --enable-ansi            do an ANSI rather than a unicode build"
+ac_help="$ac_help
+ --with-tcl-version=<vsn> version of Tcl to be used"
+ac_help="$ac_help
+ --with-tcl-header=<path> location of Tcl header"
+ac_help="$ac_help
+ --with-tcl-lib=<path>    location of Tcl libraries"
+ac_help="$ac_help
+ --with-tcl=<path>        location of Tcl header and libraries"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=ecosynth.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ac_aux_dir=
+for ac_dir in ../../../../../../acsupport $srcdir/../../../../../../acsupport; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in ../../../../../../acsupport $srcdir/../../../../../../acsupport" 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+
+    echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6
+echo "configure:563: checking that a separate build tree is being used" >&5
+    ecos_cwd=`/bin/pwd`
+    if test "${srcdir}" = "." ; then
+        srcdir=${ecos_cwd}
+    fi
+    if test "${ecos_cwd}" = "${srcdir}" ; then
+        echo "$ac_t""no" 1>&6
+        { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; }
+    else
+        echo "$ac_t""yes" 1>&6
+    fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:582: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:614: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:667: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:724: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=eCos_synthetic_target_arch
+
+VERSION=0.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:763: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal
+   echo "$ac_t""found" 1>&6
+else
+   ACLOCAL="$missing_dir/missing aclocal"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:776: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:789: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:802: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:815: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:829: checking whether to enable maintainer-specific portions of Makefiles" >&5
+    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval="$enable_maintainer_mode"
+  USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+  
+
+if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+  MAINT=$MAINTAINER_MODE_TRUE
+  
+
+
+case "${host}" in
+    i[34567]86-*-linux-gnu* ) SUPPORTED="yes";;
+    * ) SUPPORTED="no"
+esac
+
+
+if test "${SUPPORTED}" = "yes"; then
+  SUPPORTED_TRUE=
+  SUPPORTED_FALSE='#'
+else
+  SUPPORTED_TRUE='#'
+  SUPPORTED_FALSE=
+fi
+
+if test "${SUPPORTED}" = "yes" ; then
+    # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:870: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:900: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:951: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:983: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 994 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1025: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1030: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1058: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+
+    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1094: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1126: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1137 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cxx_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cxx_cross=no
+  else
+    ac_cv_prog_cxx_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1168: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:1173: checking whether we are using GNU C++" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.C <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gxx=yes
+else
+  ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+if test $ac_cv_prog_gxx = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+
+ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=
+echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:1201: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+  ac_cv_prog_cxx_g=yes
+else
+  ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS="$ac_save_CXXFLAGS"
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+
+for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat > conftest.$ac_ext <<EOF
+#line 1242 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int main() {
+exit (42);
+; return 0; }
+EOF
+if { (eval echo configure:1250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  continue
+fi
+rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#line 1260 "configure"
+#include "confdefs.h"
+$ac_declaration
+int main() {
+exit (42);
+; return 0; }
+EOF
+if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+
+    echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1284: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  for ac_file in conftest.*; do
+    case $ac_file in
+    *.c) ;;
+    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+    esac
+  done
+else
+  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+    echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1308: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1313 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_cygwin=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1341: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1346 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_mingw32=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1372: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
+else
+  rm -f conftest*
+  echo 'int main () { return 0; }' > conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:1382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for file in conftest.*; do
+      case $file in
+      *.c | *.o | *.obj) ;;
+      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+    
+    ecos_CFLAGS=""
+    ecos_CXXFLAGS=""
+    ecos_LDADD=""
+    ecos_INCLUDES=""
+    ecos_LIBS=""
+    
+    
+    
+    
+    
+
+
+    
+    
+    
+
+    echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6
+echo "configure:1420: checking "for Visual C++"" >&5
+    MSVC="no";
+    if test "${CC}" = "cl" ; then
+       MSVC="yes"
+       CXX="cl"
+       
+    
+    
+    if test "${MSVC}" = "yes" ; then
+      MSVC_SRCDIR=`cygpath -w ${MSVC_SRCDIR} | tr \\\\\\\\ /`
+    fi
+
+       
+       ecos_INCLUDES="${ecos_INCLUDES} \"-I${msvc_srcdir}\""
+       ecos_LDADD="-link"
+       ecos_LIBS="advapi32.lib"
+    fi
+    
+
+if test "${MSVC}" = "yes"; then
+  MSVC_TRUE=
+  MSVC_FALSE='#'
+else
+  MSVC_TRUE='#'
+  MSVC_FALSE=
+fi
+    if test "${MSVC}" = "yes" ; then
+        echo "$ac_t""unfortunately yes" 1>&6
+    else
+        echo "$ac_t""no" 1>&6
+    fi
+
+    
+    
+    
+    
+    
+
+    echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6
+echo "configure:1459: checking "the default compiler flags"" >&5
+
+            ecosflags_enable_debug="no"
+    # Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+  case "${enableval}" in
+       yes) ecosflags_enable_debug="yes" ;;
+       *)   ecosflags_enable_debug="no" ;;
+    esac
+fi
+
+
+                    ecosflags_enable_ansi="no"
+    if test "${MSVC}" = "yes" ; then
+      # Check whether --enable-ansi or --disable-ansi was given.
+if test "${enable_ansi+set}" = set; then
+  enableval="$enable_ansi"
+  case "${enableval}" in
+         yes) ecosflags_enable_ansi="yes" ;;
+         *)   ecosflags_enable_ansi="no" ;;
+      esac
+fi
+
+    fi
+
+        if test "${GCC}" = "yes" ; then
+        ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
+        ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual"
+    elif test "${MSVC}" = "yes" ; then
+        ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3"
+        ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX"
+    else
+        { echo "configure: error: "default flags for ${CC} are not known"" 1>&2; exit 1; }
+    fi
+
+        if test "${ecosflags_enable_debug}" = "yes" ; then
+        if test "${GCC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -g -O0"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0"
+        elif test "${MSVC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi"
+        fi
+    else
+                                        if test "${GCC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -O0"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0"
+        elif test "${MSVC}" = "yes" ; then
+            ecos_CFLAGS="${ecos_CFLAGS} -MD -O2"
+            ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2"
+        fi
+    fi
+
+    CFLAGS="${ac_save_CFLAGS}"
+    CXXFLAGS="${ac_save_CXXFLAGS}"
+
+    echo "$ac_t""done" 1>&6
+
+
+    
+
+    
+    
+
+    ecos_tcl_version=""
+    ecos_tcl_incdir=""
+    ecos_tcl_libdir=""
+    ecos_tk_libs=""
+
+                
+    echo $ac_n "checking for Tcl version""... $ac_c" 1>&6
+echo "configure:1531: checking for Tcl version" >&5
+    # Check whether --with-tcl-version or --without-tcl-version was given.
+if test "${with_tcl_version+set}" = set; then
+  withval="$with_tcl_version"
+  
+        ecos_tcl_version=${with_tcl_version}
+    
+else
+  
+        if test "${MSVC}" = "yes" ; then
+           ecos_tcl_version=80
+        elif test "${ac_cv_cygwin}" = "yes" ; then
+           ecos_tcl_version=80
+        else
+           ecos_tcl_version=""
+        fi
+    
+fi
+
+    echo "$ac_t""${ecos_tcl_version}" 1>&6
+
+        echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6
+echo "configure:1553: checking for Tcl installation" >&5
+
+    # Check whether --with-tcl-header or --without-tcl-header was given.
+if test "${with_tcl_header+set}" = set; then
+  withval="$with_tcl_header"
+  :
+fi
+
+    # Check whether --with-tcl-lib or --without-tcl-lib was given.
+if test "${with_tcl_lib+set}" = set; then
+  withval="$with_tcl_lib"
+  :
+fi
+
+    # Check whether --with-tcl or --without-tcl was given.
+if test "${with_tcl+set}" = set; then
+  withval="$with_tcl"
+  :
+fi
+
+
+                                
+    if test "${MSVC}" = "yes" ; then
+
+        if test "${with_tcl_header+set}" = set ; then
+            ecos_tcl_incdir=${with_tcl_header}
+        elif test "${with_tcl+set}" = set ; then
+            ecos_tcl_incdir="${with_tcl}/include"
+        else
+            { echo "configure: error: You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-header=<path>" 1>&2; exit 1; }
+        fi
+  
+                        if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
+            { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; }
+        fi
+        ecos_msvc_tcl_incdir="${ecos_tcl_incdir}"
+        
+    
+    
+    if test "${MSVC}" = "yes" ; then
+      ecos_msvc_tcl_incdir=`cygpath -w ${ecos_msvc_tcl_incdir} | tr \\\\\\\\ /`
+    fi
+
+        ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_tcl_incdir}\""
+
+        if test "${with_tcl_lib+set}" = set; then
+            ecos_tcl_libdir=${with_tcl_lib}
+        elif test "${with_tcl+set}" = set; then
+            ecos_tcl_libdir="${with_tcl}/lib"
+        else
+            { echo "configure: error: You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-lib=<path>" 1>&2; exit 1; }
+        fi
+        
+    
+    
+    if test "${MSVC}" = "yes" ; then
+      ecos_tcl_libdir=`cygpath -w ${ecos_tcl_libdir} | tr \\\\\\\\ /`
+    fi
+
+        ecos_LIBS="${ecos_LIBS} tcl${ecos_tcl_version}.lib"
+        ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\""
+
+                        ecos_tk_libs=""
+
+    else
+                        possibles="${with_tcl_header} ${with_tcl}/include ${prefix}/include /usr/include/tcl${ecos_tcl_version} /usr/include"
+        
+    ecos_tcl_incdir=""
+    for i in ${possibles}; do
+        if test -r "$i/"tcl.h""; then
+            ecos_tcl_incdir=$i
+            break
+        fi
+    done
+
+        if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
+            { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; }
+        else
+                                                                                                            if test "${ecos_tcl_incdir}" != "/usr/include" ; then
+                ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_tcl_incdir}"
+            fi
+        fi
+        possibles="${with_tcl_lib} ${with_tcl}/lib ${libdir} ${prefix}/lib /usr/lib/tcl$${ecos_tcl_version} /usr/lib"
+        
+    ecos_tcl_libdir=""
+    for i in ${possibles}; do
+        if test -r "$i/"tclConfig.sh""; then
+            ecos_tcl_libdir=$i
+            break
+        fi
+    done
+
+        if test \! -r "${ecos_tcl_libdir}/tclConfig.sh" ; then
+            { echo "configure: error: unable to locate Tcl config file tclConfig.sh" 1>&2; exit 1; }
+        else
+            . ${ecos_tcl_libdir}/tclConfig.sh
+            ecos_LIBS="${ecos_LIBS} -ltcl${ecos_tcl_version} ${TCL_LIBS}"
+        fi
+
+        possible_tk_libdir=`echo ${ecos_tcl_libdir} | sed -e 's,tcl,tk,'`
+        possibles="${ecos_tcl_libdir} ${possible_tk_libdir}"
+        
+    ecos_tk_libdir=""
+    for i in ${possibles}; do
+        if test -r "$i/"tkConfig.sh""; then
+            ecos_tk_libdir=$i
+            break
+        fi
+    done
+
+        if test \! -r "${ecos_tk_libdir}/tkConfig.sh" ; then
+            { echo "configure: error: unable to locate Tk config file tkConfig.sh" 1>&2; exit 1; }
+        else
+            . ${ecos_tk_libdir}/tkConfig.sh
+            ecos_tk_libs="-ltk${ecos_tcl_version} ${TK_LIBS}"
+                                    for lib in ${TCL_LIBS} ; do
+                ecos_tk_libs=`echo ${ecos_tk_libs} | sed -e "s!${lib}!!"`
+            done
+        fi
+    fi
+
+    echo "$ac_t""-I${ecos_tcl_incdir} -L${ecos_tcl_libdir}" 1>&6
+
+    
+
+                    if test "${TK_MAJOR_VERSION}" = "8" ; then
+        if test ${TK_MINOR_VERSION} -lt 3 ; then
+            { echo "configure: error: The synthetic target support requires at least version 8.3 of Tcl/Tk" 1>&2; exit 1; }
+        fi
+    fi
+    
+
+        package_dir=`cd ${srcdir} && /bin/pwd`
+    PACKAGE_VERSION=`dirname ${package_dir}`
+    PACKAGE_VERSION=`basename ${PACKAGE_VERSION}`
+
+                    package_dir=`dirname ${package_dir}`
+    package_dir=`dirname ${package_dir}`
+
+    possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.."
+    possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." 
+    
+    repository_root=""
+    for i in ${possibles}; do
+        if test -d "$i/"acsupport""; then
+            repository_root=$i
+            break
+        fi
+    done
+
+    if test "${repository_root}" = "" ; then
+        { echo "configure: error: Failed to identify this package's position within the eCos repository" 1>&2; exit 1; }
+    fi
+        ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd`
+
+        PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"`
+
+                        PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}"
+    
+    
+    
+    
+    
+
+fi
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile:Makefile.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
+s%@SUPPORTED_TRUE@%$SUPPORTED_TRUE%g
+s%@SUPPORTED_FALSE@%$SUPPORTED_FALSE%g
+s%@CC@%$CC%g
+s%@CXX@%$CXX%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@ecos_CFLAGS@%$ecos_CFLAGS%g
+s%@ecos_CXXFLAGS@%$ecos_CXXFLAGS%g
+s%@ecos_LDADD@%$ecos_LDADD%g
+s%@ecos_INCLUDES@%$ecos_INCLUDES%g
+s%@ecos_LIBS@%$ecos_LIBS%g
+s%@MSVC_SRCDIR@%$MSVC_SRCDIR%g
+s%@MSVC_TRUE@%$MSVC_TRUE%g
+s%@MSVC_FALSE@%$MSVC_FALSE%g
+s%@ecos_tk_libs@%$ecos_tk_libs%g
+s%@ECOS_REPOSITORY@%$ECOS_REPOSITORY%g
+s%@PACKAGE_DIR@%$PACKAGE_DIR%g
+s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g
+s%@PACKAGE_INSTALL@%$PACKAGE_INSTALL%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile:Makefile.in"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/configure.in
@@ -0,0 +1,93 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl ====================================================================
+dnl
+dnl     configure.in
+dnl
+dnl     configure script for eCos synthetic target architectural
+dnl	host-side support
+dnl
+dnl ====================================================================
+dnl####COPYRIGHTBEGIN####
+dnl                                                                         
+dnl ----------------------------------------------------------------------------
+dnl Copyright (C) 2002 Bart Veer
+dnl
+dnl This file is part of the eCos synthetic target support.
+dnl
+dnl This program is free software; you can redistribute it and/or modify it 
+dnl under the terms of the GNU General Public License as published by the Free 
+dnl Software Foundation; either version 2 of the License, or (at your option) 
+dnl any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful, but WITHOUT 
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+dnl more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License along with
+dnl this program; if not, write to the Free Software Foundation, Inc., 
+dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl
+dnl ----------------------------------------------------------------------------
+dnl                                                                          
+dnl####COPYRIGHTEND####
+dnl ====================================================================
+dnl#####DESCRIPTIONBEGIN####
+dnl
+dnl Author(s):	bartv
+dnl Contact(s):	bartv
+dnl Date:	2002/08/06
+dnl Version:	0.01
+dnl
+dnl####DESCRIPTIONEND####
+dnl ====================================================================
+
+
+AC_INIT(ecosynth.c)
+
+dnl Pick up the support files from the top-level acsupport directory.
+AC_CONFIG_AUX_DIR(../../../../../../acsupport)
+
+ECOS_CHECK_BUILD_ne_SRC
+AC_CANONICAL_HOST
+AM_INIT_AUTOMAKE(eCos_synthetic_target_arch,0.1,0)
+AM_MAINTAINER_MODE
+
+dnl The current version of the synthetic target is implemented only for
+dnl x86 Linux platforms, so a test is appropriate here. However
+dnl it is not a good idea for the configure script to report an error:
+dnl that would prevent any top-level configury working for other
+dnl platforms. Instead an automake conditional is used to suppress adding
+dnl targets to the build.
+case "${host}" in
+    i[[34567]]86-*-linux-gnu* ) SUPPORTED="yes";;
+    * ) SUPPORTED="no"
+esac
+AM_CONDITIONAL(SUPPORTED, test "${SUPPORTED}" = "yes")
+
+if test "${SUPPORTED}" = "yes" ; then
+    AC_PROG_CC
+    AC_PROG_CXX
+    AC_OBJEXT
+    AC_EXEEXT
+    ECOS_PROG_MSVC
+    ECOS_PROG_STANDARD_COMPILER_FLAGS
+
+    ECOS_PATH_TCL
+    dnl Check that the version of tk is sufficiently recent.
+    dnl For example the text widget's tag -elide facility was
+    dnl added between 8.2 and 8.3. Initial development of
+    dnl the synthetic target used 8.3.1
+    if test "${TK_MAJOR_VERSION}" = "8" ; then
+        if test ${TK_MINOR_VERSION} -lt 3 ; then
+            AC_MSG_ERROR([The synthetic target support requires at least version 8.3 of Tcl/Tk])
+        fi
+    fi
+    ECOS_PACKAGE_DIRS
+fi
+
+dnl There is no real need for a config.h file at this time, since the code
+dnl is specific to x86 Linux. This may change in future.
+dnl AM_CONFIG_HEADER(config.h:config.h.in)
+
+AC_OUTPUT(Makefile:Makefile.in)
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/console.tcl
@@ -0,0 +1,198 @@
+# {{{  Banner                                                   
+
+# ============================================================================
+# 
+#      console.tcl
+# 
+#      Console output support for the eCos synthetic target I/O auxiliary
+# 
+# ============================================================================
+# ####COPYRIGHTBEGIN####
+#                                                                           
+#  ----------------------------------------------------------------------------
+#  Copyright (C) 2002 Bart Veer
+# 
+#  This file is part of the eCos host tools.
+# 
+#  This program is free software; you can redistribute it and/or modify it 
+#  under the terms of the GNU General Public License as published by the Free 
+#  Software Foundation; either version 2 of the License, or (at your option) 
+#  any later version.
+#  
+#  This program is distributed in the hope that it will be useful, but WITHOUT 
+#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+#  more details.
+#  
+#  You should have received a copy of the GNU General Public License along with
+#  this program; if not, write to the Free Software Foundation, Inc., 
+#  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# 
+#  ----------------------------------------------------------------------------
+#                                                                           
+# ####COPYRIGHTEND####
+# ============================================================================
+# #####DESCRIPTIONBEGIN####
+# 
+#  Author(s):   bartv
+#  Contact(s):  bartv
+#  Date:        2002/08/07
+#  Version:     0.01
+#  Description:
+#      Implementation of the console device. This script should only ever
+#      be run from inside the ecosynth auxiliary.
+# 
+# ####DESCRIPTIONEND####
+# ============================================================================
+
+# }}}
+
+# The console device is pretty simple. There can only ever be one
+# instance of the console, and it does not take any initialization
+# data from the target or from command-line arguments. It does
+# look for entries in the target definition file, to set up
+# colours for console output, and to install additional regexp-based
+# filters. The only type of request that can go to the console device
+# is to write some text.
+
+namespace eval ::console {
+
+    variable _pending_output ""
+    variable filter_count 0
+    array set filters [list]
+    
+    proc instantiate { id name data } {
+	# There is only console so no name is expected, and the target
+	# cannot provide any initialization data.
+	if { ("" != $name) || ("" != $data) } {
+	    synth::report_error "The target has passed invalid data when instantiating the console device.\n"
+	    return ""
+	}
+	
+	# There are no command line arguments to be processed and consumed.
+
+	# Look for and consume target definition entries related to the console.
+	# These are only actually applicable when running in GUI mode, but
+	# should always be consumed.
+	set console_appearance ""
+
+	if { [synth::tdf_has_device "console"] } {
+	    if { [synth::tdf_has_option "console" "appearance"] } {
+		set console_appearance [synth::tdf_get_option "console" "appearance"]
+	    }
+
+	    if { [synth::tdf_has_option "console" "filter"] } {
+		set tdf_filters [synth::tdf_get_options "console" "filter"]
+		foreach filter $tdf_filters {
+		    if { 2 > [llength $filter] } {
+			set msg "Invalid entry in target definition file $synth::target_definition\n"
+			append msg "  Device console, option filter takes at least two arguments, a name and a regular expression.\n"
+			synth::report_error $msg
+		    } else {
+			# Attempt some minimal validation of the regexp
+			set name [lindex $filter 0]
+			set regexp [lindex $filter 1]
+			set error ""
+			if { [catch { regexp -- $regexp "Hello world\n" } error] } {
+			    set msg "Invalid entry in target definition file $synth::target_definition\n"
+			    append msg "  Device console, filter $name, invalid regular expression\n    $error\n"
+			    synth::report_error $msg
+			} else {
+			    set ::console::filters($::console::filter_count,name)       $name
+			    set ::console::filters($::console::filter_count,regexp)     $regexp
+			    set ::console::filters($::console::filter_count,appearance) [lrange $filter 2 end]
+			    incr ::console::filter_count
+			}
+		    }
+		}
+	    }
+	}
+
+	# If the GUI is enabled then set up a filter for the console, and
+	# any additional filters specified in the target definition file
+	# for e.g. trace output.
+	if { $synth::flag_gui } {
+	    if { [synth::filter_exists "console" ] } {
+		synth::report_warning "The console device script [info script] cannot create a filter for \"console\".\nThis filter already exists.\n"
+	    } elseif { "" == $console_appearance } {
+		synth::filter_add "console"
+	    } else {
+		array set parsed_options [list]
+		set message ""
+		if { ![synth::filter_parse_options $console_appearance parsed_options message] } {
+		    synth::report_error \
+		        "Invalid entry in target definition file $synth::target_definition\
+		         \n  synth_device \"console\", entry \"appearance\"\n$message"
+		} else {
+		    synth::filter_add_parsed "console" parsed_options
+		}
+	    }
+
+	    for { set i 0 } { $i < $::console::filter_count } { incr i } {
+		set name $::console::filters($i,name)
+		set appearance $::console::filters($i,appearance)
+		array unset parsed_options
+		array set parsed_options [list]
+
+		if { [synth::filter_exists $name] } {
+		    synth::report_warning "The console device script [info script] cannot create a filter for \"$name\".\nThis filter already exists.\n"
+		} else {
+		    set message ""
+		    if { ![synth::filter_parse_options $appearance parsed_options message] } {
+			synth::report_error \
+				"Invalid entry in target definition file $synth::target_definition\
+				\n  synth_device \"console\", entry filter $name\n$message"
+		    } else {
+			synth::filter_add_parsed $name parsed_options
+		    }
+		}
+	    }
+	}
+
+	# An instantiation function should return a handler for further requests
+	# to this device instance.
+	return console::handle_request
+    }
+    
+    proc handle_request { id reqcode arg1 arg2 reqdata reqlen reply_len } {
+	# Unfortunately the main eCos diagnostic code assumes it is
+	# talking to a tty in raw mode, since typically the output
+	# will go via the gdb output window. Hence it will have inserted
+	# carriage returns which are best filtered out here.
+	set reqdata [string map {"\r" " "} $reqdata]
+
+	# The output should be processed one line at a time, to make it
+	# easier to write the regexp filters.
+	append console::_pending_output $reqdata
+	while { -1 != [string first "\n" $console::_pending_output] } {
+	    set regexp_matched 0
+	    set index [string first "\n" $console::_pending_output]
+	    set line [string range $console::_pending_output 0 $index]
+	    set ::console::_pending_output [string range $console::_pending_output [expr $index + 1] end]
+
+	    for { set i 0 } { !$regexp_matched && ($i < $console::filter_count) } { incr i } {
+		if { [regexp -- $console::filters($i,regexp) $line] } {
+		    synth::output $line $console::filters($i,name)
+		    set regexp_matched 1
+		}
+	    }
+	    if { ! $regexp_matched } {
+		synth::output $line "console"
+	    }
+	}
+    }
+
+    # Deal with the case where eCos has exited after sending only part
+    # of a line, which is still pending. In practice this has no
+    # effect at present because the data is still buffered inside
+    # eCos.
+    proc _flush { arg_list } {
+	if { "" != $console::_pending_output } {
+	    synth::output "$console::_pending_output\n" "console"
+	}
+    }
+    synth::hook_add "ecos_exit" console::_flush
+
+}
+
+return console::instantiate
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/copy.xbm
@@ -0,0 +1,6 @@
+#define copy_width 16
+#define copy_height 15
+static unsigned char copy_bits[] = {
+   0x00, 0x00, 0x7e, 0x00, 0xc2, 0x00, 0x42, 0x01, 0xda, 0x0f, 0x82, 0x30,
+   0xfa, 0xd0, 0x82, 0xf6, 0xfa, 0x80, 0x82, 0xbe, 0xfe, 0x80, 0x80, 0xbe,
+   0x80, 0x80, 0x80, 0xff, 0x00, 0x00};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/cut.xbm
@@ -0,0 +1,6 @@
+#define cut_width 16
+#define cut_height 15
+static unsigned char cut_bits[] = {
+   0x00, 0x00, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x60, 0x03, 0x40, 0x01,
+   0xc0, 0x01, 0x80, 0x00, 0xc0, 0x00, 0x40, 0x07, 0x70, 0x09, 0x48, 0x09,
+   0x48, 0x09, 0x48, 0x06, 0x30, 0x00};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/default.tdf
@@ -0,0 +1,43 @@
+# Default synthetic target hardware definition file. This file gets
+# installed alongside ecosynth.tcl and other support files in the
+# directory $(libexecdir)/ecos/hal_synth_arch_<version>.
+#
+# The synthetic target support will look for the target definition
+# file in various places: first the current directory, then
+# ~/.ecos/synth, finally the install location as above. It assumes the
+# file is called "default.tdf", unless this is overwritten on the
+# command line using the -t or --target option. Typically users will
+# make a copy of the default target definition in an appropriate
+# location and then modify this copy as required.
+#
+# This file only contains support for those devices supported by the
+# core package: the console, ... Additional devices such as the
+# ethernet support which live in separate eCos packages may have their
+# own example fragments which can be inserted in the user's own target
+# definition file, directly or via e.g. a Tcl "source" command.
+#
+# This file is executed in a Tcl interpreter with an additional
+# command "synth_device", so Tcl syntax applies and the full
+# functionality provided by Tcl interpreters is available if desired.
+
+# ----------------------------------------------------------------------------
+# The console device. This serves as the destination for low-level
+# eCos text output, for example from the diag_printf() function,
+# and is intended primarily for diagnostics and debugging.
+#
+# The appearance of normal console output can be controlled by
+# the "appearance" option. This takes the standard arguments for
+# text filters, for example -foreground and -background.
+#
+# It is also possible to install new filters for specific types
+# of output, for example eCos tracing output. Each such filter
+# is defined by a name, a regular expression, and details of
+# the desired appearance. Every line of console output generated
+# by eCos is matched against the various regular expressions,
+# and the first match found controls the appearance of the
+# output.
+
+synth_device console {
+    # appearance -foreground white -background black
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/ecosicon.xbm
@@ -0,0 +1,10 @@
+#define ecosicon_width 40
+#define ecosicon_height 16
+static unsigned char ecosicon_bits[] = {
+   0xfc, 0xff, 0xab, 0xaa, 0x2a, 0xfe, 0xff, 0x53, 0x55, 0x55, 0xff, 0xff,
+   0xab, 0xaa, 0xaa, 0x87, 0x1f, 0x52, 0x50, 0x40, 0x03, 0x0f, 0x28, 0x20,
+   0x80, 0x71, 0xc6, 0x11, 0x41, 0x14, 0x79, 0xe6, 0x8b, 0x22, 0xaa, 0x01,
+   0xe6, 0x17, 0x45, 0x40, 0x01, 0xe6, 0x8f, 0xa2, 0x80, 0xf9, 0xe7, 0x13,
+   0x45, 0x15, 0x79, 0xc6, 0x09, 0x22, 0x8a, 0x03, 0x0e, 0x10, 0x50, 0x00,
+   0x07, 0x1f, 0x2a, 0xa8, 0x80, 0xff, 0xff, 0x53, 0x55, 0x55, 0xfe, 0xff,
+   0xab, 0xaa, 0x2a, 0xfc, 0xff, 0x53, 0x55, 0x15};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/ecosiconmask.xbm
@@ -0,0 +1,10 @@
+#define ecosiconmask_width 40
+#define ecosiconmask_height 16
+static unsigned char ecosiconmask_bits[] = {
+   0xfc, 0xff, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff,
+   0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0x3f};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/ecosynth.c
@@ -0,0 +1,364 @@
+//============================================================================
+//
+//     ecosynth.c
+//
+//     The eCos synthetic target I/O auxiliary
+//
+//============================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// ----------------------------------------------------------------------------
+// Copyright (C) 2002 Bart Veer
+//
+// This file is part of the eCos host tools.
+//
+// This program is free software; you can redistribute it and/or modify it 
+// under the terms of the GNU General Public License as published by the Free 
+// Software Foundation; either version 2 of the License, or (at your option) 
+// any later version.
+// 
+// This program is distributed in the hope that it will be useful, but WITHOUT 
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+// more details.
+// 
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 
+// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// ----------------------------------------------------------------------------
+//                                                                          
+//####COPYRIGHTEND####
+//============================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):   bartv
+// Contact(s):  bartv
+// Date:        2002-08-05
+// Version:     0.01
+// Description:
+//
+// The main module for the eCos synthetic target auxiliary. This
+// program is fork'ed and execve'd during the initialization phase of
+// any synthetic target application, and is primarily responsible for
+// I/O operations. This program should never be run directly by a
+// user.
+//
+//####DESCRIPTIONEND####
+//============================================================================
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <limits.h>
+#include <unistd.h>
+#include <assert.h>
+#include <fcntl.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <tcl.h>
+#include <tk.h>
+
+// The protocol between host and target is defined by a private
+// target-side header.
+#include "../src/synth_protocol.h"
+
+// ----------------------------------------------------------------------------
+// Statics etc.
+#define PROGNAME    "Synthetic target auxiliary"
+
+static int  no_windows = 0; // -nw arg
+
+static pid_t    parent_pid;
+
+// ----------------------------------------------------------------------------
+// Overview.
+//
+// When a synthetic target application is executed, whether directly
+// or from inside gdb, it can fork() and execve() the synthetic
+// target auxiliary: this program, ecosynth. For now this is disabled
+// by default but can be enabled using a --io option on the command line.
+// In future it may be enabled by default, but can be suppressed using
+// --nio.
+//
+// stdin, stdout, and stderr will be inherited from the eCos application, so
+// that attempts to use printf() or fprintf(stderr, ) from inside the
+// auxiliary or its helper applications work as expected. In addition file
+// descriptor 3 will be a pipe from the eCos application, and file descriptor
+// 4 will be a pipe to the application. The protocol defined in
+// ../src/synth_protocol.h runs over these pip
+//
+// argv[] and environ are also as per the application, with the exception
+// of argv[0] which is the full path to this application.
+//
+// The bulk of the hard work is done inside Tcl. The C++ code is
+// responsible only for initialization and for implementing some
+// additional commands, for example to send a SIGIO signal to the
+// parent when there is a new pending interrupt. The primary script is
+// ecosynth.tcl which should be installed alongside the executable.
+//
+// This code makes use of the standard Tcl initialization facilities:
+//
+// 1) main() calls Tcl_Main() with the command-line arguments and an
+//    application-specific initialization routine ecosynth_appinit().
+//
+// 2) Tcl_Main() goes through the initialization sequence in generic/tclMain.c.
+//    There is one slight complication: Tcl_main() interprets arguments in
+//    a way that makes sense for tclsh, but not for ecosynth. Specially if
+//    argv[1] exists and does not begin with a - then it will be interpreted
+//    as a script to be executed. Hence argv[] is re-allocated and the name
+//    of a suitable script is inserted.
+//
+// 3) ecosynth_appinit() initializes the Tcl interpreter, and optionally
+//    the Tk interpreter as well. This is controlled by the presence of
+//    a -nw argument on the command line. This initialization routine
+//    also takes care of adding some commands to the Tcl interpreter.
+//
+// 4) Tcl_Main() will now proceed to execute the startup script, which
+//    is eccentric.tcl installed in the libexec directory.
+
+static int  ecosynth_appinit(Tcl_Interp*);
+
+int
+main(int argc, char** argv)
+{
+    char    ecosynth_tcl_path[_POSIX_PATH_MAX];
+    char**  new_argv;
+    int     i;
+
+    parent_pid = getppid();
+
+    // The various core Tcl scripts are installed in the same
+    // directory as ecosynth. The Tcl script itself will check whether
+    // there is a newer version of itself in the source tree and
+    // switch to that instead.
+    assert((strlen(LIBEXECDIR) + strlen(PACKAGE_INSTALL) + 20) < _POSIX_PATH_MAX);
+    strcpy(ecosynth_tcl_path, LIBEXECDIR);
+    strcat(ecosynth_tcl_path, "/ecos/");
+    strcat(ecosynth_tcl_path, PACKAGE_INSTALL);
+    strcat(ecosynth_tcl_path, "/ecosynth.tcl");
+
+    // Installation sanity checks.
+    if (0 != access(ecosynth_tcl_path, F_OK)) {
+        fprintf(stderr, PROGNAME ": error, a required Tcl script has not been installed.\n");
+        fprintf(stderr, "    The script is \"%s\"\n", ecosynth_tcl_path);
+        exit(EXIT_FAILURE);
+    }
+    if (0 != access(ecosynth_tcl_path, R_OK)) {
+        fprintf(stderr, PROGNAME ": error, no read access to a required Tcl script.\n");
+        fprintf(stderr, "    The script is \"%s\"\n", ecosynth_tcl_path);
+        exit(EXIT_FAILURE);
+    }
+
+    // Look for options -nw and -w. This information is needed by the appinit() routine.
+    no_windows = 0;
+    for (i = 1; i < argc; i++) {
+        if ((0 == strcmp("-nw", argv[i])) || (0 == strcmp("--nw", argv[i])) ||
+            (0 == strcmp("-no-windows", argv[i])) || (0 == strcmp("--no-windows", argv[i]))) {
+            no_windows = 1;
+        } else if ((0 == strcmp("-w", argv[i])) || (0 == strcmp("--w", argv[i])) ||
+                   (0 == strcmp("-windows", argv[i])) || (0 == strcmp("--windows", argv[i]))) {
+            no_windows = 0;
+        }
+    }
+    
+    new_argv = malloc((argc+2) * sizeof(char*));
+    if (NULL == new_argv) {
+        fprintf(stderr, PROGNAME ": internal error, out of memory.\n");
+        exit(EXIT_FAILURE);
+    }
+    new_argv[0] = argv[0];
+    new_argv[1] = ecosynth_tcl_path;
+    for (i = 1; i < argc; i++) {
+        new_argv[i+1] = argv[i];
+    }
+    new_argv[i+1] = NULL;
+
+    // Ignore SIGINT requests. Those can happen if e.g. the application is
+    // ctrl-C'd or if a gdb session is interrupted because this process is
+    // a child of the eCos application. Instead the normal code for handling
+    // application termination needs to run.
+    signal(SIGINT, SIG_IGN);
+
+    // Similarly ignore SIGTSTP if running in graphical mode, it would
+    // be inappropriate for the GUI to freeze if the eCos application is
+    // suspended. If running in text mode then it is better for both
+    // the application and the I/O auxiliary to freeze, halting any further
+    // output.
+    if (!no_windows) {
+        signal(SIGTSTP, SIG_IGN);
+    }
+
+    Tcl_Main(argc+1, new_argv, &ecosynth_appinit);
+    return EXIT_SUCCESS;
+}
+
+
+// ----------------------------------------------------------------------------
+// Commands for the Tcl interpreter. These are few and far between because
+// as much work as possible is done in Tcl.
+
+// Send a SIGIO signal to the parent process. This is done whenever a new
+// interrupt is pending. There is a possibility of strange behaviour if
+// the synthetic target application is exiting at just the wrong moment
+// and this process has become a zombie. An alternative approach would
+// involve loading the Extended Tcl extension.
+static int
+ecosynth_send_SIGIO(ClientData  clientData __attribute__ ((unused)),
+                    Tcl_Interp* interp,
+                    int         argc,
+                    char**      argv __attribute__ ((unused)))
+{
+    if (1 != argc) {
+        Tcl_SetResult(interp, "wrong # args: should be \"usbtest::_send_SIGIO\"" , TCL_STATIC);
+        return TCL_ERROR;
+    }
+    
+    (void) kill(parent_pid, SIGIO);
+    return TCL_OK;
+}
+
+// Similarly send a SIGKILL (-9) to the parent process. This allows the GUI
+// code to kill of the eCos application
+static int
+ecosynth_send_SIGKILL(ClientData clientData __attribute__ ((unused)),
+                      Tcl_Interp* interp,
+                      int         argc,
+                      char**      argv __attribute__ ((unused)))
+{
+    if (1 != argc) {
+        Tcl_SetResult(interp, "wrong # args: should be \"usbtest::_send_SIGIO\"" , TCL_STATIC);
+        return TCL_ERROR;
+    }
+    
+    (void) kill(parent_pid, SIGKILL);
+    return TCL_OK;
+}
+
+
+// ----------------------------------------------------------------------------
+// Application-specific initialization.
+
+static int
+ecosynth_appinit(Tcl_Interp* interp)
+{
+    Tcl_Channel from_app;
+    Tcl_Channel to_app;
+
+    // Tcl library initialization. This has the effect of executing init.tcl,
+    // thus setting up package load paths etc. Not all of that initialization
+    // is necessarily appropriate for ecosynth, but some devices may well want
+    // to load in additional packages or whatever.
+    if (Tcl_Init(interp) == TCL_ERROR) {
+        return TCL_ERROR;
+    }
+    // Optionally initialize Tk as well. This can be suppressed by an
+    // argument -nw. Possibly this could be done by the Tcl script
+    // instead using dynamic loading.
+    //
+    // There is a problem with the way that Tk does its argument processing.
+    // By default it will accept abbreviations for the standard wish arguments,
+    // so if the user specifies e.g. -v then the Tk code will interpret this
+    // as an abbreviation for -visual, and will probably complain because
+    // -visual takes an argument whereas ecosynth's -v is just a flag.
+    //
+    // The Tk argument processing can be suppressed simply by temporarily
+    // getting rid of the argv variable. The disadvantage is that some
+    // standard arguments now have to be processed explicitly:
+    //
+    //     -colormap map      ignored, of little interest these days
+    //     -display  display  currently ignored. This would have to be
+    //                        implemented at the C level, not the Tcl level,
+    //                        since Tk_Init() will start interacting with the
+    //                        X server. Its implementation would involve a
+    //                        setenv() call.
+    //     -geometry geom     implemented in the Tcl code using "wm geometry"
+    //     -name     name     ignored for now.
+    //     -sync              ignored, of little interest to typical users
+    //     -use      id       ignored, probably of little interest for now
+    //     -visual   visual   ignored, of little interest these days
+    //
+    // so actually the only extra work that is required is for the Tcl code
+    // to process -geometry.
+    if (!no_windows) {
+        Tcl_Obj* argv = Tcl_GetVar2Ex(interp, "argv", NULL, TCL_GLOBAL_ONLY);
+        Tcl_IncrRefCount(argv);
+        Tcl_UnsetVar(interp, "argv", TCL_GLOBAL_ONLY);
+        if (Tk_Init(interp) == TCL_ERROR) {
+            return TCL_ERROR;
+        }
+        Tcl_SetVar2Ex(interp, "argv", NULL, argv, TCL_GLOBAL_ONLY);
+        Tcl_DecrRefCount(argv);
+    }
+    
+    // Create the synth:: namespace. Currently this does not seem to be possible from
+    // inside C.
+    if (TCL_OK != Tcl_Eval(interp, 
+                           "namespace eval synth {\n"
+                           "    variable channel_from_app 0\n"
+                           "    variable channel_to_app 0\n"
+                           "}\n")) {
+        fprintf(stderr, PROGNAME ": internal error, failed to create Tcl synth:: namespace\n");
+        fprintf(stderr, "    Please check Tcl version (8.3 or later required).\n");
+        exit(EXIT_FAILURE);
+    }
+
+    // The pipe to/from the application is exposed to Tcl, allowing
+    // the main communication to be handled at the Tcl level and
+    // specifically via the event loop. This requires two additional
+    // Tcl channels to be created for file descriptors 3 and 4.
+    from_app = Tcl_MakeFileChannel((ClientData) 3, TCL_READABLE);
+    if (NULL == from_app) {
+        fprintf(stderr, PROGNAME ": internal error, failed to create Tcl channel for pipe from application.\n");
+        exit(EXIT_FAILURE);
+    }
+    Tcl_RegisterChannel(interp, from_app);
+
+    // The channel name will be something like file0. Add a variable to the
+    // interpreter to store this name.
+    if (NULL == Tcl_SetVar(interp, "synth::_channel_from_app",  Tcl_GetChannelName(from_app), TCL_GLOBAL_ONLY)) {
+        fprintf(stderr, PROGNAME ": internal error, failed to create Tcl variable from application channel 0\n");
+        exit(EXIT_FAILURE);
+    }
+
+    // Repeat for the channel to the application.
+    to_app = Tcl_MakeFileChannel((ClientData) 4, TCL_WRITABLE);
+    if (NULL == to_app) {
+        fprintf(stderr, PROGNAME ": internal error, failed to create Tcl channel for pipe to application.\n");
+        exit(EXIT_FAILURE);
+    }
+    Tcl_RegisterChannel(interp, to_app);
+    if (NULL == Tcl_SetVar(interp, "synth::_channel_to_app",  Tcl_GetChannelName(to_app), TCL_GLOBAL_ONLY)) {
+        fprintf(stderr, PROGNAME ": internal error, failed to create Tcl variable from application channel 1\n");
+        exit(EXIT_FAILURE);
+    }
+
+    // The auxiliary may spawn additional programs, via
+    // device-specific scripts. Those programs should not have
+    // direct access to the pipe - that would just lead to
+    // confusion.
+    fcntl(3, F_SETFD, FD_CLOEXEC);
+    fcntl(4, F_SETFD, FD_CLOEXEC);
+    
+    // Add synthetic target-specific commands to the Tcl interpreter.
+    Tcl_CreateCommand(interp, "synth::_send_SIGIO", &ecosynth_send_SIGIO, (ClientData)NULL, (Tcl_CmdDeleteProc*) NULL);
+    Tcl_CreateCommand(interp, "synth::_send_SIGKILL", &ecosynth_send_SIGKILL, (ClientData)NULL, (Tcl_CmdDeleteProc*) NULL);
+
+    // Define additional variables.
+
+    // The version, from the AM_INIT_AUTOMAKE() macro in configure.in
+    Tcl_SetVar(interp, "synth::_ecosynth_version", ECOSYNTH_VERSION, TCL_GLOBAL_ONLY);
+
+    // The parent process id, i.e. that for the eCos application itself.
+    Tcl_SetVar2Ex(interp, "synth::_ppid", NULL, Tcl_NewIntObj(getppid()), TCL_GLOBAL_ONLY);
+               
+    // The various directories
+    Tcl_SetVar(interp, "synth::_ecosynth_repository", ECOS_REPOSITORY, TCL_GLOBAL_ONLY);
+    Tcl_SetVar(interp, "synth::_ecosynth_libexecdir", LIBEXECDIR, TCL_GLOBAL_ONLY);
+    Tcl_SetVar(interp, "synth::_ecosynth_package_dir", PACKAGE_DIR, TCL_GLOBAL_ONLY);
+    Tcl_SetVar(interp, "synth::_ecosynth_package_version", PACKAGE_VERSION, TCL_GLOBAL_ONLY);
+    Tcl_SetVar(interp, "synth::_ecosynth_package_install", PACKAGE_INSTALL, TCL_GLOBAL_ONLY);
+    
+    return TCL_OK;
+}
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/ecosynth.tcl
@@ -0,0 +1,3292 @@
+# {{{  Banner                                                   
+
+# ============================================================================
+# 
+#      ecosynth.tcl
+# 
+#      The eCos synthetic target I/O auxiliary
+# 
+# ============================================================================
+# ####COPYRIGHTBEGIN####
+#                                                                           
+#  ----------------------------------------------------------------------------
+#  Copyright (C) 2002 Bart Veer
+# 
+#  This file is part of the eCos host tools.
+# 
+#  This program is free software; you can redistribute it and/or modify it 
+#  under the terms of the GNU General Public License as published by the Free 
+#  Software Foundation; either version 2 of the License, or (at your option) 
+#  any later version.
+#  
+#  This program is distributed in the hope that it will be useful, but WITHOUT 
+#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+#  more details.
+#  
+#  You should have received a copy of the GNU General Public License along with
+#  this program; if not, write to the Free Software Foundation, Inc., 
+#  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# 
+#  ----------------------------------------------------------------------------
+#                                                                           
+# ####COPYRIGHTEND####
+# ============================================================================
+# #####DESCRIPTIONBEGIN####
+# 
+#  Author(s):   bartv
+#  Contact(s):  bartv
+#  Date:        2002/08/05
+#  Version:     0.01
+#  Description:
+#      The main script for the eCos synthetic target auxiliary. This should
+#      only ever be invoked from inside ecosynth.
+# 
+# ####DESCRIPTIONEND####
+# ============================================================================
+
+# }}}
+
+# {{{  Overview                                                 
+
+# When an eCos synthetic target application runs it will usually
+# fork/execve an auxiliary program, ecosynth, to provide certain
+# I/O functionality. This happens as part of hardware initialization.
+#
+# The ecosynth executable in turn runs this ecosynth.tcl script which
+# either does most of the real work or delegates it to other scripts.
+# Those other scripts may in turn exec other programs to perform any
+# I/O operations that cannot easily be done at the Tcl level. For
+# example performing low-level ethernet operations generally requires
+# working at the C level or equivalent, so a separate executable would
+# be appropriate. The ecosynth executable will transfer control to
+# this script after the appinit() call, which should have performed
+# certain initialization steps.
+#
+#  1) the Tcl interpreter will be fully initialized.
+#
+#  2) usually Tk will have been loaded and initialized as well. This
+#     can be suppressed using a command-line option -nw.
+#
+#  3) there will be a namespace synth:: for use by ecosynth.tcl
+#     Auxiliary scripts are expected to use their own namespace
+#     where possible.
+#
+#  4) there will be two channels synth::_channel_from_app and
+#     synth::_channel_to_app. These correspond to a pipe between
+#     the eCos application and the auxiliary. The application will
+#     send requests using this pipe and expect replies. I/O
+#     operations are always initiated by a request from the
+#     application, but the auxiliary can raise an interrupt via
+#     the SIGIO signal.
+#
+#     Other standard channels stdin, stdout and stderr will have
+#     been inherited from the eCos application.
+#
+#  5) some Tcl commands implemented in C will have been added to the
+#     interpreter. The most notable is synth::_send_SIGIO, used to
+#     raise an interrupt within the application. 
+#
+#  6) similarly some variables will have been added to the interpreter.
+#
+#
+# Configuring everything can get somewhat complicated. It is the eCos
+# application that knows what I/O facilities within the auxiliary it
+# wants to access, but it may not know all the details. The eCos
+# component architecture makes things a bit more complicated still,
+# generic code such as this ecosynth.tcl script has no way of knowing
+# what I/O facilities might be provided by some package or other.
+#
+# For example, a target-side ethernet driver may want to send outgoing
+# ethernet packets to some script or program on the host and receive
+# incoming ethernet packets. However it does not necessarily know what
+# the host-side should do with those ethernet packets, e.g. use a
+# spare Linux ethernet device, use the Linux kernel's ethertap
+# facility, ... Although that kind of information could be handled by
+# target-side configury, host-side configuration files will often be
+# more appropriate. Specifically it would allow a single eCos
+# synthetic target application to run in a variety of environments,
+# using different ways to provide the I/O, with no need to do any
+# reconfiguring or rebuilding of the target side.
+#
+#
+# The basic approach that is taken is:
+#
+#   1) the eCos application tells the auxiliary what I/O facilities
+#      it is interested in. This should happen as a result
+#      of static constructors or of device driver initialization
+#      routines. The application has no control over the implementation
+#      of the I/O facilities, it just expects something on the other
+#      end to respond sensibly to requests.
+#
+#      For example, a synthetic target ethernet driver will supply
+#      an initialization routine via its NETDEVTAB_ENTRY. This
+#      routine will send a request to the auxiliary asking for a
+#      device of type ethernet, id "eth0", provided by
+#      CYGPKG_DEVS_ETH_ECOSYNTH, version current. The auxiliary will
+#      now attempt to load a suitable Tcl script ethernet.tcl from a
+#      location determined using the package name and version.
+#      
+#   2) there is a primary target definition file which can be
+#      specified as the final argument on the command line, with
+#      "default" being the default value. The code will look for
+#      this file with or without a .tdf extension, first in the
+#      current directory, then in ~/.ecos/synth/. This file is
+#      actually a Tcl script that gets executed in the current
+#      interpreter. However typically it will only contain
+#      entries such as:
+#
+#          synth_device eth0 {
+#              ...
+#          }
+#
+#   3) There are additional optional configuration files
+#      ~/.ecos/synth/initrc.tcl and ~/.ecos/synth/mainrc.tcl which can
+#      be used for further customization. initrc.tcl will get run
+#      early on, mainrc.tcl will get run once initialization is
+#      complete. Specifically the target-side code will send an
+#      appropriate request after invoking all the static constructors.
+#      At this time the auxiliary will run mainrc.tcl, and in addition
+#      it may issue warnings about unused arguments etc.
+#
+#   4) there may also be separate configuration files for GUI
+#      preferences etc. These are distinct from the initrc and
+#      mainrc files in that they are generated rather than
+#      hand-written.
+
+# }}}
+# {{{  Basic initialization                                     
+
+# ----------------------------------------------------------------------------
+# There should be two channels corresponding to the pipe between the
+# eCos application and the auxiliary. These should be configured
+# appropriately. If either channel does not exist then that is a
+# very good indication that the system is not properly initialized,
+# i.e. that this script is not being run by the ecosynth executable
+# and by implication that no eCos application is involved.
+
+if {([info exists synth::_channel_to_app] == 0) ||
+    ([info exists synth::_channel_from_app] == 0) ||
+    ([info exists synth::_ecosynth_version] == 0) ||
+    ([info exists synth::_ppid] == 0) ||
+    ([info exists synth::_ecosynth_repository] == 0) ||
+    ([info exists synth::_ecosynth_libexecdir] == 0) ||
+    ([info exists synth::_ecosynth_package_dir] == 0) ||
+    ([info exists synth::_ecosynth_package_version] == 0) ||
+    ([info exists synth::_ecosynth_package_install] == 0) ||
+    ([info commands synth::_send_SIGIO] == "") ||
+    ([info commands synth::_send_SIGKILL] == "") } {
+
+    puts stderr "ecosynth.tcl: the current interpreter has not been properly initialized."
+    puts stderr "    This script should only be invoked by the ecosynth executable when"
+    puts stderr "    an eCos synthetic target application is run."
+    exit 1
+}
+
+# Is the script currently being executed the most recent version?
+# This check should only happen if an environment variable
+# ECOSYNTH_DEVEL is set, because the installed tools may have come
+# from somewhere other than the current repository.
+if { [info exists ::env(ECOSYNTH_DEVEL)] } {
+    set _orig_name [file join $synth::_ecosynth_repository $synth::_ecosynth_package_dir $synth::_ecosynth_package_version \
+	    "host" [file tail [info script]]]
+    if { [file exists $_orig_name] && [file readable $_orig_name] && ($_orig_name != [info script]) } {
+	if { [file mtime $_orig_name] >= [file mtime [info script]] } {
+	    puts "$_orig_name is more recent than install: executing that."
+	    source $_orig_name
+	    return
+	}
+    }
+    unset _orig_name
+}
+
+fconfigure $synth::_channel_to_app   -buffering none
+fconfigure $synth::_channel_from_app -encoding binary
+fconfigure $synth::_channel_to_app   -encoding binary
+fconfigure $synth::_channel_from_app -translation binary
+fconfigure $synth::_channel_to_app   -translation binary
+
+# Define additional globals and procedures inside the synth:: namespace.
+# Variables and functions that begin with an _ are considered internal
+# and should not be used directly.
+namespace eval synth {
+    
+    # Unfortunately the name of the eCos executable is lost at this stage.
+    # Within the eCos application it was held in argv[0], but that has been
+    # overridden with the name of the auxiliary. However we have access to the
+    # parent process id so we can use /proc to get the required information.
+    variable ecos_appname ""
+    catch {
+	set synth::ecos_appname [file readlink "/proc/[set synth::_ppid]/exe"]
+	set synth::ecos_appname [file tail $synth::ecos_appname]
+    }
+
+    # The install location can be determined from the script name.
+    # This is used for e.g. loading bitmaps, even if ECOSYNTH_DEVEL
+    # is set, because some of the files may be generated.
+    # ECOSYNTH_DEVEL only affects Tcl scripts.
+    variable install_dir [file join $synth::_ecosynth_libexecdir "ecos" $synth::_ecosynth_package_install]
+    
+    # Is the eCos application still running? This is worth keeping
+    # track of so that send_reply and raise_interrupt do not try to
+    # interact with a program that is no longer running.
+    variable ecos_running 1
+
+    # This variable is used to enter the event loop
+    variable _ecosynth_exit 0
+
+    # Is GUI mode enabled?
+    variable flag_gui [expr { "" != [info commands "tk"] } ]
+
+    # When running in GUI mode the GUI should stay up even after the application
+    # has exited, so that the user can take a good look around. When running in
+    # non-GUI mode this program should exit as soon it has finished cleaning up.
+    variable flag_immediate_exit    [expr { 0 == $synth::flag_gui} ]
+    
+    # Is the GUI ready to accept output?
+    variable flag_gui_ready 0
+    
+    # Flags and variables related to command-line arguments
+    variable flag_help          0
+    variable flag_keep_going    0
+    variable flag_no_rc         0
+    variable flag_verbose       0
+    variable flag_debug         0
+    variable logfile            ""
+    variable target_definition  ""
+    variable geometry           "<none>"
+}
+
+# }}}
+# {{{  Hooks & atexit support                                   
+
+# ----------------------------------------------------------------------------
+# A lot of the flexibility of ecosynth is provided by hooks. Device scripts
+# and, more importantly, the per-user initrc and mainrc scripts can install
+# hooks that get called when an event occurs, for example when the eCos
+# applications attempts to transmit an ethernet packet.
+#
+# A special hook is used to implement atexit handling. This involves redefining
+# the "exit" command so that it will invoke the appropriate hooks first.
+
+namespace eval synth {
+    # All hooks are held in an array, indexed by the hook name, with each
+    # array entry being a list of functions to be invoked.
+    array set _hooks [list]
+
+    proc hook_define { name } {
+	if { [info exists synth::_hooks($name)] } {
+	    synth::report_error "Attempt to create hook $name which already exists.\n"
+	} else {
+	    set synth::_hooks($name) [list]
+	}
+    }
+
+    proc hook_defined { name } {
+	return [info exists synth::_hooks($name)]
+    }
+    
+    proc hook_add { name function } {
+	if { ! [info exists synth::_hooks($name)] } {
+	    synth::report_error "Attempt to attach a function to an unknown hook $name\n"
+	    set synth::_hooks($name) [list]
+	}
+	lappend synth::_hooks($name) $function
+    }
+
+    proc hook_call { name args } {
+	if { ! [info exists synth::_hooks($name) ] } {
+	    synth::report_error "Attempt to invoke unknown hook $name\n"
+	} else {
+	    foreach function $synth::_hooks($name) {
+		$function $args
+	    }
+	}
+    }
+
+    # Define an initial set of hooks
+    synth::hook_define "exit"                  ;# The auxiliary is exiting
+    synth::hook_define "ecos_exit"             ;# The eCos application has exited
+    synth::hook_define "ecos_initialized"      ;# eCos static constructors have run
+    synth::hook_define "help"                  ;# --help
+}
+
+# Rename the builtin exit command so that it can still be accessed.
+rename exit _hook_real_exit
+
+# And define a replacement for exit which will invoke the appropriate
+# hook. Care has to be taken in case of recursive exit calls, each
+# hook function is only called once.
+
+proc exit { { code 0 } } {
+    while { [llength $synth::_hooks(exit)] > 0 } {
+	set handler [lindex $synth::_hooks(exit) end]
+	set synth::_hooks(exit) [lrange $synth::_hooks(exit) 0 end-1]
+
+	# For now assume no errors - it is not clear what could be done
+	# about them anyway.
+	catch { eval $handler [list]}
+    }
+    _hook_real_exit $code
+}
+
+# }}}
+# {{{  Output                                                   
+
+# ----------------------------------------------------------------------------
+# The usual set of utilities for issuing warnings, errors, ...
+#
+# There are three possibilities to consider:
+#
+#   1) running in text-only mode. The output should just go to stdout
+#
+#   2) running in GUI mode and the text window exists. Just update the
+#      window
+#
+#   3) running in GUI mode but the text window is not yet ready. The
+#      output needs to be buffered for now, and will be flushed
+#      later.
+#
+# Also, if for some reason this program exits while there is output still
+# buffered that output should also go to stdout.
+#
+# If any errors occur during initialization, e.g. an invalid device script
+# or user initialization scripts, those get reported and an error count
+# is maintained. When the eCos application reports that initialization is
+# complete it will be sent back a status for the auxiliary, and will
+# exit if things have not started up correctly. This tries to ensure that
+# if there are multiple errors the user sees all of them.
+
+namespace eval synth {
+
+    variable _pending_output [list]
+    variable _logfd ""
+    variable _error_count 0
+
+    proc logfile_open { } {
+	synth::report "Opening logfile $synth::logfile"
+	set msg ""
+	if { [catch { set synth::_logfd [open $synth::logfile "w"] } msg ] } {
+	    synth::report_error "Unable to open logfile \"$synth::logfile\"\n    $msg\n"
+	}
+    }
+
+    # A default implementation of output. This gets overwritten later when running
+    # in GUI mode, so if GUI mode is enabled then this proc must be called before
+    # the GUI is ready and the data must be queued.
+    proc output { msg filter } {
+	if { ! $synth::flag_gui } {
+	    # If a logfile exists, output normally goes there rather than
+	    # to standard output. The exception is for errors which
+            # always go to stderr, in addition to the logfile.
+	    if { "" != $synth::_logfd } {
+		puts -nonewline $synth::_logfd $msg
+		if { "error" == $filter } {
+		    puts -nonewline stderr $msg
+		}
+	    } else {
+		if { "error" == $filter } {
+		    puts -nonewline stderr $msg
+		} else {
+		    puts -nonewline $msg
+		}
+	    }
+	} else {
+	    lappend synth::_pending_output [list $msg $filter]
+	}
+    }
+    
+    # Invoked by the text window code once everything is ready
+    # and synth::output has been redefined.
+    proc _flush_output { } {
+	foreach msg $synth::_pending_output {
+	    synth::output [lindex $msg 0] [lindex $msg 1]
+	}
+	set synth::_pending_output [list]
+    }
+
+    # Cope with early exits. This will only have an effect if
+    # _flush_output has not been called yet, and by implication
+    # if synth::output has not yet been redefined.
+    proc _exit_flush_output { arg_list } {
+	if { 0 != [llength $synth::_pending_output] } {
+	    set synth::flag_gui 0
+	    synth::_flush_output
+	}
+    }
+    synth::hook_add "exit" synth::_exit_flush_output
+    
+    proc report { msg } {
+	synth::output $msg "report"
+    }
+
+    proc report_warning { msg } {
+	synth::output "Warning: $msg" "warning"
+    }
+
+    proc report_error { msg } {
+	incr synth::_error_count
+	synth::output "Error: $msg" "error"
+    }
+
+    # Internal errors indicate a serious problem within ecosynth or
+    # a device-specific script. For now this results in output to
+    # stderr, a backtrace, and termination of the auxiliary, which
+    # should also cause the eCos application to shut down.
+    #
+    # An alternative approach would involve calling ::error and
+    # benefitting from its backtrace generation, but there are various
+    # places where it makes to sense to catch problems and call
+    # synth::error rather than internal_error
+    proc internal_error { msg } {
+	puts stderr "ecosynth, an internal error has occurred:"
+	puts stderr "    $msg"
+	puts stderr "---------- backtrace -------------------------------------------------"
+	for { set level [info level] } { $level > 0 } { incr level -1 } {
+	    puts stderr [info level $level]
+	}
+	puts stderr "----------------------------------------------------------------------"
+	puts stderr "ecosynth, exiting."
+	exit 1
+    }
+
+    # Dummy implementations of the exported filter routines, in case a script
+    # tries to create a filter even when not running in graphical mode
+    variable _dummy_filters [list]
+    
+    proc filter_exists { name } {
+	set result 0
+	if { -1 != [lsearch -exact $synth::_dummy_filters $name] } {
+	    set result 1
+	}
+	return $result
+    }
+
+    proc filter_get_list { } {
+	return $synth::_dummy_filters
+    }
+
+    proc filter_add { name args } {
+	if { [synth::filter_exists $name] } {
+	    synth::internal_error "attempt to install filter $name twice.\n"
+	}
+	lappend synth::_dummy_filters $name
+    }
+}
+
+# }}}
+# {{{  Argument processing and global options                   
+
+# ----------------------------------------------------------------------------
+# Argument processing. The eCos application will usually just pass its
+# command line arguments to the auxiliary. Four special arguments will
+# have been examined already:
+#
+#    -io, --io
+#        I/O facilities, i.e. the auxiliary should run
+#    -ni, -nio, --ni, --nio
+#        No I/O facilities, i.e. the auxiliary should not be run.
+#    -nw, --nw, --no-windows
+#        No windows, i.e. disable the GUI
+#    -w, --w, --windows
+#        Enable the GUI
+#
+# There are a number of additional flags available as standard:
+#
+#    -v, --version
+#        The usual
+#    -h, --help
+#        Ditto
+#    -k, --k, --keep-going
+#        Ignore errors as much as possible
+#    -nr, --no-rc
+#        Skip the initrc and mainrc files
+#    -x, --exit
+#        The auxiliary should exit at the same time as the eCos application.
+#    -nx, --no-exit
+#        Inverse of the above
+#    -V, --verbose
+#        The usual
+#    --debug
+#        Not intended for end users
+#    -l <file>, -l=<file>, --logfile <file>, --logfile=<file>
+#        Send all output to the specified file. In GUI mode this is in addition
+#        to the main text window. In non-GUI mode this is instead of stdout.
+#    -t <file>, -t=<file>, --target <file>, --target=<file>
+#        Specify the target definition file.
+#
+# Many X applications accept a common set of options, e.g. -display,
+# -geometry, etc. Although usually Tk will process these, there are
+# some problems - see ecosynth.c, ecosynth_appinit() for details.
+# Hence -geometry has to be processed here.
+#
+#    -geometry <geom>
+#
+#
+# Some device-specific scripts may want to support additional
+# command line arguments. This is somewhat messy, since the core
+# code has no way of knowing what devices might be available and
+# hence what the actual valid arguments are. It would be possible
+# to just ignore any arguments that are not used by any device,
+# but that could really confuse a user who has made a typo. Instead
+# the code below keeps track of which arguments have been "consumed",
+# allowing it to issue a warning about unconsumed arguments after
+# initialization.
+#
+# Arguments can take the following forms:
+#
+#    1) -flag or --flag.
+#    2) -name=value or --name=value
+#    3) -name value or --name value
+#
+# There is a possibility of confusion if any of the values begin with a hyphen.
+# It is hard to do anything about this without advance knowledge of what all
+# the valid arguments are. Instead the user can avoid problems by using
+# the -name=value variant on the command line.
+#
+# There is also possible confusion if a single argument can occur multiple
+# times. If that is permitted then things can get rather messy, and
+# the current API does not really handle it.
+
+namespace eval synth {
+
+    # Keep track of all arguments which have not yet been consumed.
+    array set _argv_unconsumed [list]
+    for { set i 0 } { $i < $::argc } { incr i } {
+	set synth::_argv_unconsumed($i) [lindex $::argv $i]
+    }
+
+    # Provide a list of just those arguments that have not yet
+    # been consumed.
+    proc argv_get_unconsumed { } {
+	set result [list]
+	for { set i 0 } { $i < $::argc } {incr i } {
+	    if { [info exists synth::_argv_unconsumed($i)] } {
+		lappend result $synth::_argv_unconsumed($i)
+	    }
+	}
+	return $result
+    }
+
+    proc _argv_consume { index } {
+	if { [info exists synth::_argv_unconsumed($index)] } {
+	    unset synth::_argv_unconsumed($index)
+	}
+    }
+    
+    # Internal routine. Given a string of the form "-flag" or "-name=",
+    # return an index within argv or -1 if not found. As a side effect
+    # this "consumes" the argument.
+    proc _argv_lookup { name } {
+	set result -1
+	if { "=" != [string index $name end] } {
+	    for { set i 0 } { $i < $::argc } { incr i } {
+		set arg [lindex $::argv $i]
+		if { [string equal $arg $name] || [string equal $arg "-[set name]"] } {
+		    set result $i
+		    synth::_argv_consume $i
+		    break
+		}
+	    }
+	} else {
+	    set name [string range $name 0 end-1]
+	    set len  [string length $name]
+	    for { set i 0 } { $i < $::argc } { incr i } {
+		set arg [lindex $::argv $i]
+		if { [string equal -length $len $arg $name] } {
+		    if { "=" == [string index $arg $len] } {
+			set result $i
+			synth::_argv_consume $i
+			break;
+		    } elseif { ([string length $arg] == $len) && ($i < ($::argc - 1)) } {
+			set result $i
+			synth::_argv_consume $i
+			synth::_argv_consume [expr $i + 1]
+			break
+		    }
+		} elseif { [string equal -length [expr $len + 1] $arg "-[set name]"] } {
+		    if { "=" == [string index $arg [expr $len + 1]] } {
+			set result $i
+			synth::_argv_consume $i
+			break
+		    } elseif { ([string length $arg] == [expr $len + 1]) && ($i < ($::argc - 1)) } {
+			set result $i
+			synth::_argv_consume $i
+			synth::_argv_consume [expr $i + 1]
+			break
+		    }
+		}
+	    }
+	}
+	return $result
+    }
+
+    # Look for a given argument on the command line.
+    proc argv_defined { name } {
+	set result 0
+	set index [synth::_argv_lookup $name]
+	if { -1 != $index } {
+	    set result 1
+	}
+	return $result
+    }
+    
+    # Return the value associated with a given argument, which must be present.
+    proc argv_get_value { name } {
+	if { "=" != [string index $name end] } {
+	    synth::internal_error "attempt to get a value for a simple flag argument \"$name\".\n"
+	}
+	set result ""
+	set index [synth::_argv_lookup $name]
+	if { -1 == $index } {
+	    synth::internal_error "attempt to get the value associated with a non-existent argument \"$name\".\n"
+	}
+	set arg [lindex $::argv $index]
+	set len [string length $name]
+	if { [string equal -length $len $arg $name] } {
+	    set result [string range $arg $len end]
+	} elseif { [string equal -length [expr $len + 1] $arg "-[set name]"] } {
+	    set result [string range $arg [expr $len + 1] end]
+	} else {
+	    set result [lindex $::argv [expr $index + 1]]
+	}
+	return $result
+    }
+
+    # -ni/-nio are not relevant. If present then they would have been handled
+    # within the eCos application, the auxiliary would not have been spawned,
+    # and this script would not be running.
+
+    # -io will have been processed by the eCos application.
+    # -nw, -w, and related options have been processed by the C code.
+    # Look them up anyway to consume them.
+    synth::_argv_lookup "-io"
+    synth::_argv_lookup "-nw"
+    synth::_argv_lookup "-no-windows"
+    synth::_argv_lookup "-w"
+    synth::_argv_lookup "-windows"
+
+    # Now cope with the other standard flags
+    if { [synth::argv_defined "-v"] || [synth::argv_defined "--version"] } {
+	# Just output the version message and exit. The eCos application
+	# will do the same. The version is obtained from configure.in,
+	# and also from the install directory. The synthetic target
+	# startup code will exit quietly if the auxiliary exits at this
+	# stage. This output should go via puts rather than the
+	# synth:: output routines, since the GUI will never appear if
+	# --version is specified.
+	puts "ecosynth: version $synth::_ecosynth_version"
+	puts "        : install location [file dirname [info script]]"
+	exit 0
+    }
+
+    if { [synth::argv_defined "-l="] } {
+	set synth::logfile [synth::argv_get_value "-l="]
+    } elseif { [synth::argv_defined "-logfile="] } {
+	set synth::logfile [synth::argv_get_value "-logfile="]
+    }
+    if { "" != $synth::logfile } {
+	synth::logfile_open
+    }
+
+    # -h/--help would normally also result in an immediate exit. However,
+    # the device-specific scripts have not yet been loaded so there
+    # is no way of reporting their options. Hence the usage information
+    # is delayed until later. Suppressing GUI mode as a side effect is
+    # probably a good idea as well, that way the output appears in the
+    # current console window.
+    if { [synth::argv_defined "-h"] || [synth::argv_defined "-help"] } {
+	set synth::flag_help 1
+	set synth::flag_gui 0
+    }
+    
+    if { [synth::argv_defined "-debug"] } {
+	set synth::flag_debug 1
+    }
+    
+    if { [synth::argv_defined "-k"] || [synth::argv_defined "-keep-going"] } {
+	set synth::flag_keep_going 1
+    }
+
+    if { [synth::argv_defined "-nr"] || [synth::argv_defined "-no-rc"]} {
+	set synth::flag_no_rc 1
+    }
+
+    if { [synth::argv_defined "-x"] || [synth::argv_defined "-exit"] } {
+	set synth::flag_immediate_exit 1
+    } elseif { [synth::argv_defined "-nx"] || [synth::argv_defined "-no-exit"] } {
+	set synth::flag_immediate_exit 0
+    }
+
+    if { [synth::argv_defined "-V"] || [synth::argv_defined "-verbose"] } {
+	set synth::flag_verbose 1
+    }
+
+    if { [synth::argv_defined "-t="] } {
+	set synth::target_definition [synth::argv_get_value "-t="]
+    } elseif { [synth::argv_defined "-target="] } {
+	set synth::target_definition [synth::argv_get_value "-target="]
+    }
+
+    # Arguably -geometry should only be checked when the GUI is enabled,
+    # but doing so at all times is harmless.
+    # Note that '-geometry ""' means that any value held in the
+    # preferences file should be ignored. Hence the regexp below 
+    # accepts the empty string, and treats it separately from
+    # uninitialized.
+    if { [synth::argv_defined "-geometry="] } {
+	set synth::geometry [synth::argv_get_value "-geometry="]
+
+	if { ![regexp -- {^([0-9]+x[0-9]+)?([+-][0-9]+[+-][0-9]+)?$} $synth::geometry] } {
+	    synth::report_warning "Invalid geometry string $synth::geometry\n"
+	    set synth::geometry "<none>"
+	}
+    }
+
+    if { $synth::flag_debug } {
+	synth::report \
+	    "Results of initial command-line parsing:\n   \
+	          --help            $synth::flag_help\n   \
+	          --keep-going      $synth::flag_keep_going\n   \
+	          --no-rc           $synth::flag_no_rc\n   \
+	          --exit            $synth::flag_immediate_exit\n   \
+	          --verbose         $synth::flag_verbose\n   \
+	          logfile           $synth::logfile\n   \
+	          target definition $synth::target_definition\n   \
+	          geometry          $synth::geometry\n   \
+	          unconsumed        [synth::get_unconsumed_args]\n"
+    }
+}
+
+# }}}
+# {{{  Create and populate ~/.ecos/synth                        
+
+# ----------------------------------------------------------------------------
+# If the per-user configuration directories do not exist yet, create them.
+# Also install default initrc.tcl and mainrc.tcl files which do nothing, but
+# which can be edited. If problems occur then the user gets a warning
+# but execution proceeds.
+#
+# Some people may object to this automatic creation of directories and
+# configuration files. However there is plenty of precedent, and the
+# files involved are small. Messages are generated so that the user
+# knows what has happened.
+#
+# Currently the default target definition file is not copied from
+# the install tree into the per-user tree. Although some users will
+# be happy having this file in ~/.ecos/synth, others may prefer it
+# to be more visible in the current directory.
+
+if { ![file exists "~/.ecos"] } {
+    synth::report "Creating new directory ~/.ecos for eCos configuration files.\n"
+    if { 0 != [catch { file mkdir "~/.ecos" }] } {
+	synth::report_warning "failed to create directory ~/.ecos\n"
+    }
+}
+if { [file exists "~/.ecos"] && [file isdirectory "~/.ecos"] && ![file exists "~/.ecos/synth"] } {
+    synth::report "Creating new directory ~/.ecos/synth for synthetic target configuration files.\n"
+    if { 0 != [catch { file mkdir "~/.ecos/synth" } ] } {
+	synth::report_warning "failed to create directory ~/.ecos/synth\n"
+    } else {
+	# initrc and mainrc are only copied when the directory is first created,
+	# so that users can delete them if unwanted - even though the
+	# default versions do nothing.
+	synth::report "Installing default configuration files ~/.ecos/synth/initrc.tcl and ~/.ecos/synth/mainrc.tcl\n"
+	catch { file copy -- [file join $synth::install_dir "user_initrc.tcl"] "~/.ecos/synth/initrc.tcl"}
+	catch { file copy -- [file join $synth::install_dir "user_mainrc.tcl"] "~/.ecos/synth/mainrc.tcl"}
+    }
+}
+
+# }}}
+# {{{  Read target definition file                              
+
+# ----------------------------------------------------------------------------
+# Once the GUI is up and running it is possible to start reading in some
+# configuration files. The first of these is the target definition file.
+# Typically this would be ~/.ecos/synth/default.tdf. An alternative
+# definition file can be specified on the command line with the
+# -t argument, and the code will look in the current directory,
+# in ~/.ecos/synth, and in the install tree.
+#
+# The purpose of the target definition file is to specify exactly
+# how I/O gets implemented. For example the eCos application may
+# want to access a network device eth0, but that device could be
+# implemented in a variety of ways (e.g. a real ethernet device
+# on the Linux host, or a fake device provided by the ethertap
+# facility). It is the target definition file that provides
+# this information.
+#
+# The file is of course just another Tcl script, running in the
+# current interpreter. There seems little point in using a safe
+# interpreter given the considerable number of other Tcl scripts
+# that are being used, some of which need the ability to e.g.
+# run other programs. The main command is synth_device which
+# takes two arguments, a device name and some options for that
+# device, e.g.:
+#
+#    synth_device eth0 {
+#        use eth1    
+#    }
+#
+#    synth_device eth1 {
+#        use tap0
+#    }    
+#
+# When the eCos device driver looks up eth0 this will cause a
+# device-specific Tcl script to be loaded, which can examine
+# this data.
+#
+# This code has no way of knowing what constitutes valid or invalid
+# contents for an eth0 device, especially since the Tcl script that
+# could provide such knowledge has not been loaded. Instead it is
+# assumed that the contents is another set of Tcl commands such as
+# "physical", which will of course not be defined so the Tcl interpreter
+# will invoke "unknown" which is temporarily redefined here. This makes
+# it possible for the device-specific commands to have arbitrary number
+# of arguments, or to define Tcl fragments for hooks, or whatever.
+#
+# As with argument processing, the code attempts to keep track of
+# which devices and options have been "consumed" and can issue
+# warnings about any unused devices or options. This helps to track
+# down typos and similar problems. These warnings are only output
+# when running at verbose mode, since it is fairly normal practice
+# to have a single target definition file which supports 
+# a number of different eCos applications with different I/O
+# requirements.
+
+namespace eval synth {
+    # A list of all devices specified in the target definition file.
+    # For now assume that a given device will only be specified once.
+    variable _tdf_devices [list]
+    
+    # An array with additional details of each device. This will have
+    # entries such as _tdf_device_options(eth0,4), where the second
+    # argument is a per-device index. The value of each entry is
+    # a list of the actual command and its arguments. This use of
+    # an index allows for multiple instances of a per-device
+    # option.
+    array set _tdf_device_options [list]
+
+    # While reading in the device details it is necessary to keep track
+    # of the current device, if any. Otherwise the implementation of
+    # "unknown" will not be able to update _tdf_device_options. An index
+    # is needed as well.
+    variable _tdf_current_device ""
+    variable _tdf_current_index  0
+
+    # Keep track of which devices and options have been consumed
+    variable _tdf_consumed_devices [list]
+    variable _tdf_consumed_options [list]
+    
+    proc tdf_has_device { name } {
+	return [expr -1 != [lsearch -exact $synth::_tdf_devices $name]]
+    }
+
+    proc tdf_get_devices { } {
+	return $synth::_tdf_devices
+    }
+    
+    proc _tdf_get_option_index { devname option } {
+	synth::_tdf_consume_device $devname
+	for { set i 0 } { [info exists synth::_tdf_device_options($devname,$i)] } { incr i } {
+	    if { $option == [lindex $synth::_tdf_device_options($devname,$i) 0] } {
+		synth::_tdf_consume_option $devname $i
+		return $i
+	    }
+	}
+	return -1
+    }
+    
+    proc _tdf_get_option_indices { devname option } {
+	synth::_tdf_consume_device $devname
+	set result [list]
+	for { set i 0 } { [info exists synth::_tdf_device_options($devname,$i)] } { incr i } {
+	    if { $option == [lindex $synth::_tdf_device_options($devname,$i) 0] } {
+		synth::_tdf_consume_option $devname $i
+		lappend result $i
+	    }
+	}
+	return $result
+    }
+    
+    proc tdf_has_option { devname option } {
+	return [expr -1 != [synth::_tdf_get_option_index $devname $option]]
+    }
+
+    proc tdf_get_option { devname option } {
+	set index [synth::_tdf_get_option_index $devname $option]
+	if { -1 != $index } {
+	    lappend synth::_tdf_consumed_options "$devname,$index"
+	    return [lrange $synth::_tdf_device_options($devname,$index) 1 end]
+	} else {
+	    return [list]
+	}
+    }
+
+    proc tdf_get_options { devname option } {
+	set result [list]
+	set indices [synth::_tdf_get_option_indices $devname $option]
+	foreach index $indices {
+	    lappend result [lrange $synth::_tdf_device_options($devname,$index) 1 end]
+	}
+	return $result
+    }
+    
+    proc tdf_get_all_options { devname } {
+	set result [list]
+	for { set i 0 } { [info exists synth::_tdf_device_options($devname,$i)] } { incr i } {
+	    lappend synth::_tdf_consumed_options "$devname,$index"
+	    lappend result $synth::_tdf_device_options($devname,$i)
+	}
+	return $result
+    }
+
+    proc _tdf_consume_device { name } {
+	if { -1 == [lsearch -exact $synth::_tdf_consumed_devices $name] } {
+	    lappend synth::_tdf_consumed_devices $name
+	}
+    }
+
+    proc _tdf_consume_option { devname index } {
+	if { -1 == [lsearch -exact $synth::_tdf_consumed_options "$devname,$index"] } {
+	    lappend synth::_tdf_consumed_options "$devname,$index"
+	}
+    }
+    
+    proc tdf_get_unconsumed_devices { } {
+	set result [list]
+	foreach devname $synth::_tdf_devices {
+	    if { -1 == [lsearch -exact $synth::_tdf_consumed_devices $devname] } {
+		lappend result $devname
+	    }
+	}
+	return $result
+    }
+
+    proc tdf_get_unconsumed_options { } {
+	set result [list]
+	foreach devname $synth::_tdf_devices {
+	    if { -1 == [lsearch -exact $synth::_tdf_consumed_devices $devname] } {
+		# Do not report all the options for a device that has not been consumed at all
+		continue
+	    }
+	    for { set i 0 } { [info exists synth::_tdf_device_options($devname,$i)] } { incr i } {
+		if { -1 == [lsearch -exact $synth::_tdf_consumed_options "$devname,$i"] } {
+		    lappend result [list $devname $synth::_tdf_device_options($devname,$i)]
+		}
+	    }
+	}
+	return $result
+    }
+}
+
+# Look for the target definition file.
+set _tdf $synth::target_definition
+if { "" == $_tdf } {
+    set _tdf "default"
+}
+set _config_file ""
+
+set _dirlist [list [pwd] "~/.ecos/synth" $synth::install_dir]
+foreach _dir $_dirlist {
+    set _candidate "[file join $_dir $_tdf].tdf"  ; # file join does the right thing for absolute paths
+    if { [file isfile $_candidate] } {
+	set _config_file $_candidate
+	break
+    } else {
+	set _candidate [file join $_dir $_tdf]
+	if { [file isfile $_candidate] } {
+	    set _config_file $_candidate
+	    break
+	}
+    }
+}
+if { "" == $_config_file } {
+    if { "" != $synth::target_definition } {
+	# The user explicitly specified a file, so it must be read in.
+	# If it cannot be found then that should be treated as an error.
+	set msg "Unable to find target definition file $synth::target_definition\n"
+	if { "absolute" !=  [file pathtype $synth::target_definition] } {
+	    append msg "    Searched $_dirlist\n"
+	}
+	synth::report_error $msg
+	exit 1
+    } else {
+	# This is a mild error, because default.tdf should be installed
+	# below libexec. However the default file does not actually
+        # define anything, it is just a set of comments, so there is
+	# nothing to be gained by issuing a warning.
+    }
+} else {
+
+    set synth::target_definition $_config_file
+    
+    proc synth_device { name data } {
+	if { "" != $synth::_tdf_current_device } {
+	    error "synth_device $name is nested inside $synth::_tdf_current_device\nNesting of synth_device entries is not allowed."
+	}
+	if { -1 != [lsearch -exact $synth::_tdf_devices $name] } {
+	    error "Duplicate entry for synth_device $name"
+	}
+	set synth::_tdf_current_device $name
+	set synth::_tdf_current_index 0
+	lappend synth::_tdf_devices $name
+	eval $data
+	# If the eval resulted in an error, propagate it immediately rather than attempt
+	# any form of recovery. The downside is that only error per run will be
+	# reported.
+	set synth::_tdf_current_device ""
+    }
+    rename unknown _synth_unknown
+    proc unknown { args } {
+	if { "" == $synth::_tdf_current_device } {
+	    # An unknown command at the toplevel. Pass this to the
+	    # original "unknown" command, in the unlikely event that
+	    # the user really did want to autoload a library or do
+	    # something similar. 
+	    eval _synth_unknown $arg
+	    return
+	}
+
+	# Anything else is treated as an option within the synth_device
+	set synth::_tdf_device_options($synth::_tdf_current_device,$synth::_tdf_current_index) $args
+	incr synth::_tdf_current_index
+    }
+
+    set _config_file_msg ""
+    set _result [catch { source $_config_file } _config_file_msg ]
+    
+    rename unknown ""
+    rename synth_device ""
+    rename _synth_unknown unknown
+
+    if { $_result } {
+	# Any problems reading in the target definition file should be
+	# treated as an error: I/O is unlikely to behave in the way
+	# that the user expects.
+	set msg "An error occurred while reading in the target definition file\n    $_config_file\n    $_config_file_msg\n"
+	synth::report_error $msg
+	exit 1
+    }
+    unset _result _config_file_msg
+}
+
+unset _dirlist _tdf _config_file _candidate
+
+# }}}
+
+if { $synth::flag_gui } {
+# {{{  Main GUI code                                            
+
+# {{{  Session file                                             
+
+# ----------------------------------------------------------------------------
+# The tool manages a file ~/.ecos/synth/guisession, holding information
+# such as the size and position of the main window. The aim is to give
+# the user a fairly consistent interface between sessions. The information
+# is saved during exit handling, and also in response to the window
+# manager WM_SAVE_YOURSELF request. However note that the latter does
+# not extend to user session information - restarting the eCos application
+# the next time a user logs in is inappropriate for eCos, plus if
+# the application is being run inside gdb (a likely scenario) it is gdb
+# that should handle restarting the application.
+#
+# Using a single file has limitations. Specifically the user may be
+# switching between a number of different target definition files,
+# each resulting in a subtly different layout, and arguably there
+# should be separate session information for each one. However
+# distinguishing between per-target and global settings would be
+# very complicated.
+#
+# The most obvious implementation involves the options database.
+#
+# FIXME: implement properly
+
+namespace eval synth {
+    # Make sure we are using the right options from .Xdefaults etc.
+    tk appname "ecosynth"
+
+    if { $synth::flag_debug } {
+	# synth::report "Reading in session file ~/.ecos/synth/guisession\n"
+    }
+    
+    # synth::report_warning "Support for reading session file ~/.ecos/synth/guisession not yet implemented.\n"
+    
+    if { [file exists "~/.ecos/synth/guisession"] } {
+	if {0 != [catch { option readfile "~/.ecos/synth/guisession" userDefault} msg]} {
+	    # synth::report_error "Failed to read GUI session information from file ~/.ecos/synth/guisession\n    $msg\n"
+	}
+    }
+
+    proc _update_session_file { arg_list } {
+	# synth::report_warning "Support for updating session file ~/.ecos/synth/guisession not yet implemented.\n"
+    }
+    proc _handle_wm_save_yourself { } {
+	# synth::report_warning "Support for WM_SAVE_YOURSELF not yet implemented\n"
+    }
+
+    synth::hook_add "exit" synth::_update_session_file
+}
+
+# }}}
+# {{{  Load images                                              
+
+# ----------------------------------------------------------------------------
+# Load various useful bitmaps etc. into memory, so that they can be accessed
+# by any code that needs them.
+#
+# Running1 is a coloured version of the eCos logo. running2 and running3 are
+# used by alternative implementations of the heartbeat: running2 has the
+# red and black reversed, and running3 is mostly a mirror image of the normal
+# logo.
+namespace eval synth {
+
+    proc load_image { image_name filename } {
+	set result 0
+	set type [file extension $filename]
+	if { ! [file exists $filename] } {
+	    synth::report_error "Image $filename has not been installed.\n"
+	} elseif { ! [file readable $filename] } {
+	    synth::report_error "Image $filename is not readable.\n"
+	} elseif { (".xbm" == $type) } {
+	    if { 0 == [catch { set $image_name [image create bitmap -file $filename] }] } {
+		set result 1
+	    } else {
+		synth::report_error "Bitmap image $filename is invalid.\n"
+	    }
+	} else {
+	    if { 0 == [catch { set $image_name [image create photo -file $filename] }] } {
+		set result 1
+	    } else {
+		synth::report_error "Image $filename is invalid.\n"
+	    }
+	}
+	return $result
+    }
+    
+    set _images [list "tick_yes.xbm" "tick_no.xbm" "save.xbm" "cut.xbm" "copy.xbm" "paste.xbm" \
+	    "help.xbm" "running1.ppm" "saveall.xbm" ]
+    foreach _image $_images {
+	variable image_[file rootname $_image]
+	synth::load_image "synth::image_[file rootname $_image]" [file join $synth::install_dir $_image]
+    }
+    unset _images _image
+}
+
+# }}}
+# {{{  Balloon help                                             
+
+namespace eval synth {
+
+    variable _balloon_messages
+    variable _balloon_pending ""
+    
+    toplevel .balloon
+    label .balloon.info -borderwidth 2 -relief groove -background "light yellow"
+    pack .balloon.info -side left -fill both -expand 1
+    wm overrideredirect .balloon 1
+    wm withdraw .balloon
+    
+    proc register_balloon_help { widget message } {
+	set synth::_balloon_messages($widget) $message
+	bind $widget <Enter> { synth::_balloonhelp_pending %W }
+	bind $widget <Leave> { synth::_balloonhelp_cancel }
+    }
+    
+    proc _balloonhelp_pending { widget } {
+	synth::_balloonhelp_cancel
+	set synth::_balloon_pending [after 1200 [list synth::_balloonhelp_show $widget]]
+    }
+    
+    proc _balloonhelp_cancel { } {
+	if { "" != $synth::_balloon_pending } {
+	    after cancel $synth::_balloon_pending
+	    set synth::_balloon_pending ""
+	} else {
+	    wm withdraw .balloon
+	}
+    }
+
+    proc _balloonhelp_show { widget } {
+	.balloon.info configure -text $synth::_balloon_messages($widget)
+	set x [expr [winfo rootx $widget] + 2]
+	set y [expr [winfo rooty $widget] + [winfo height $widget] + 2]
+	wm geometry .balloon +$x+$y
+	wm deiconify .balloon
+	raise .balloon
+	set synth::_balloon_pending ""
+    }
+}
+
+# }}}
+# {{{  Window manager settings                                  
+
+# ----------------------------------------------------------------------------
+# Set up the current program name in the title bar etc.
+
+namespace eval synth {
+
+    if { $synth::flag_debug } {
+	synth::report "Performing required interactions with window manager\n"
+    }
+
+    # The toplevel is withdrawn during startup. It is possible that
+    # some of the windows and other objects created initially will end
+    # up being deleted again before the system is fully up and running,
+    # and the event loop is entered before then to accept requests from
+    # the eCos application. This could cause confusing changes. The
+    # toplevel is displayed in response to the constructors-done request.
+    wm withdraw .
+
+    # For now disable all attempts to use the "send" command. Leaving it
+    # enabled would introduce security problems.
+    rename "::send" {}
+    
+    variable title "eCos synthetic target"
+    if { "" != $synth::ecos_appname} {
+	append synth::title ": $synth::ecos_appname ($synth::_ppid)"
+    }
+    wm title . $synth::title
+
+    # Use the specified geometry, or that from the last session.
+    # Obviously how well this works depends very much on the
+    # window manager being used.
+    set _geometry ""
+    if { "" ==  $synth::geometry} {
+	# Command line request to suppress the preferences. Revert
+	# to a default size.
+	set _geometry "640x480"
+    } elseif { "<none>" == $synth::geometry } {
+	# No command line option, use the value from the preferences file
+	# FIXME: implement
+	set _geometry "640x480"
+    } else {
+	# There was an explicit -geometry option on the command line. Use it.
+	set synth::_geometry $synth::geometry
+	if { [regexp -- {^([0-9]+x[0-9]+).*$} $synth::_geometry] } {
+	    wm sizefrom . "user"
+	}
+	if { [regexp -- {^.*([+-][0-9]+[+-][0-9]+)$} $synth::_geometry] } {
+	    wm positionfrom . "user"
+	}
+    }
+    wm geometry . $synth::_geometry
+    unset synth::_geometry
+
+    set _file [file join $synth::install_dir "ecosicon.xbm"]
+    if { [file readable $synth::_file] } {
+	wm iconbitmap . "@$synth::_file"
+    }
+    set _file [file join $synth::install_dir "ecosiconmask.xbm"]
+    if { [file readable $synth::_file] } {
+	wm iconmask . "@$synth::_file"
+    }
+    unset synth::_file
+    
+    if { "" != $synth::ecos_appname } {
+	wm iconname . "ecosynth: $synth::ecos_appname"
+    } else {
+	wm iconname . "ecosynth"
+    }
+
+    wm protocol . "WM_DELETE_WINDOW" synth::_handle_exit_request
+    wm protocol . "WM_SAVE_YOURSELF" synth::_handle_wm_save_yourself
+}
+
+# }}}
+# {{{  Exit and kill handling                                   
+
+# ----------------------------------------------------------------------------
+# Exit handling. The user may request program termination using various
+# different ways:
+#   1) File->Exit
+#   2) ctrl-Q, the shortcut for the above
+#   3) the Window Manager's delete-window request
+#
+# If eCos has already exited then the request can be handled straightaway.
+# The invocation of exit will go via the exit hooks so appropriate
+# clean-ups will take place.
+#
+# If eCos has not already exited then it is assumed that the user wants
+# the eCos application to terminate as well as the GUI. This can be achieved
+# via the interrupt subsystem. However, there is a risk that the application
+# has crashed, or is blocked in gdb, or has interrupts permanently disabled,
+# in which case it is not going to respond to the SIGIO. To allow for this
+# a number of retries are attempted, and after five seconds of this the
+# application is killed off forcibly.
+
+namespace eval synth {
+    
+    variable _handle_exit_retries 0
+    variable _handle_exit_after   ""
+    
+    proc _handle_exit_request { } {
+
+	if { !$synth::ecos_running } {
+	    exit 0
+	}
+	# Setting this flag causes ecosynth to exit immediately once
+	# the application terminates.
+	set synth::flag_immediate_exit 1
+
+	# Now ask the application to exit
+	synth::request_application_exit
+
+	# Set up a timer to retry this
+	if { "" == $synth::_handle_exit_after } {
+	    set synth::_handle_exit_after [after 1000 synth::_handle_exit_timer]
+
+	    # And output something so the user knows the request has been received
+	    synth::report "Waiting for the eCos application to exit.\n"
+	}
+    }
+
+    # This routine requests termination of eCos, but not of 
+    # ecosynth
+    proc _handle_kill_request { } {
+	if { $synth::ecos_running } {
+	    synth::request_application_exit
+	    if { "" == $synth::_handle_exit_after } {
+		set synth::_handle_exit_after [after 1000 synth::_handle_exit_timer]
+	    }
+	}
+    }
+
+    proc _handle_exit_timer { } {
+	if { $synth::ecos_running } {
+	    incr synth::_handle_exit_retries
+	    if { $synth::_handle_exit_retries < 5 } {
+		synth::request_application_exit
+		synth::report "Still waiting for the eCos application to exit.\n"
+	    } else {
+		synth::_send_SIGKILL
+	    }
+	    set synth::_handle_exit_after [after 1000 synth::_handle_exit_timer]
+	}
+    }
+}
+
+# }}}
+# {{{  Main window layout                                       
+
+# ----------------------------------------------------------------------------
+# The window layout is as follows:
+#  1) a menu bar at the top (surprise surprise). Many of the menus will be
+#     empty or nearly so, but device-specific scripts may want to extend
+#     the menus.
+#  2) a toolbar. This is primarily for use by device-specific scripts
+#  3) a central grid.
+#  4) a status line at the bottom.
+#
+# The central grid is organised as a 3x3 set of frames. The centre frame holds
+# the main text display, plus associated scrollbars, and is the frame that
+# will expand or shrink as the toplevel is resized. The remaining eight frames
+# (nw, n, ne, e, se, s, sw, w) are available for use by device-specific
+# scripts, typically under control of settings in the target definition file.
+# It is very possible that some or all of these eight frames will be empty,
+# and if an entire row or column is empty then Tk will make them invisible.
+#
+# Possible enhancements:
+# 1) implement some sort of paning/resizing around the central text window.
+#    That would provide some way of letting the user control the space
+#    taken by device-specific subwindows. This would be implemented
+#    by modifying the weights assigned to different rows/columns.
+# 2) it would be very useful if the main text window could be split,
+#    like emacs. This would require multiple text widgets, with output
+#    being pasted in each one.
+# 3) possibly the text window should not be hard-wired to the centre frame,
+#    instead its frame could be selected by preferences somehow.
+
+if { $synth::flag_debug } {
+    synth::report "Creating main window layout\n"
+}
+
+# The various frames are generally accessed via variables
+
+menu .menubar -borderwidth 1
+menu .menubar.file
+menu .menubar.edit
+menu .menubar.view
+menu .menubar.windows
+menu .menubar.help
+
+. configure -menu .menubar
+.menubar add cascade -label "File"    -underline 0 -menu .menubar.file
+.menubar add cascade -label "Edit"    -underline 0 -menu .menubar.edit
+.menubar add cascade -label "View"    -underline 0 -menu .menubar.view
+.menubar add cascade -label "Windows" -underline 0 -menu .menubar.windows
+.menubar add cascade -label "Help"    -underline 0 -menu .menubar.help
+
+.menubar.file add command -label "Save"        -underline 0 -accelerator "Ctrl-S" -command [list synth::_handle_file_save]
+.menubar.file add command -label "Save As..."  -underline 5                       -command [list synth::_handle_file_save_as]
+.menubar.file add command -label "Save All..." -underline 6                       -command [list synth::_handle_file_save_all]
+.menubar.file add command -label "Kill eCos"   -underline 0                       -command [list synth::_handle_kill_request]
+.menubar.file add command -label "Exit"        -underline 1 -accelerator "Ctrl-Q" -command [list synth::_handle_exit_request]
+bind . <Control-KeyPress-q> [list synth::_handle_exit_request]
+bind . <Control-KeyPress-s> [list synth::_handle_file_save]
+
+# Once eCos has exited, the kill option should be disabled
+namespace eval synth {
+    proc _menubar_ecos_exit_clean { arg_list } {
+	.menubar.file entryconfigure "Kill eCos" -state disabled
+    }
+    synth::hook_add "ecos_exit" synth::_menubar_ecos_exit_clean
+}
+
+frame .toolbar -borderwidth 1 -relief groove
+if { "" != $synth::image_save } {
+    button .toolbar.save    -image $synth::image_save -borderwidth 0 -command [list synth::_handle_file_save]
+    pack .toolbar.save -side left -padx 2
+    synth::register_balloon_help .toolbar.save "Save visible output"
+}
+if { "" != $synth::image_saveall } {
+    button .toolbar.saveall -image $synth::image_saveall -borderwidth 0 -command [list synth::_handle_file_save_all]
+    pack .toolbar.saveall -side left -padx 2
+    synth::register_balloon_help .toolbar.saveall "Save all output"
+}
+if { "" != $synth::image_cut } {
+    button .toolbar.cut    -image $synth::image_cut -borderwidth 0 -state disabled -command [list synth::_handle_edit_cut]
+    pack .toolbar.cut -side left -padx 2
+    synth::register_balloon_help .toolbar.cut "Cut"
+}
+if { "" != $synth::image_copy } {
+
+    button .toolbar.copy    -image $synth::image_copy -borderwidth 0 -command [list synth::_handle_edit_copy]
+    pack .toolbar.copy -side left -padx 2
+    synth::register_balloon_help .toolbar.copy "Copy"
+}
+if { "" != $synth::image_paste } {
+    button .toolbar.paste    -image $synth::image_paste -borderwidth 0 -state disabled -command [list synth::_handle_edit_paste]
+    pack .toolbar.paste -side left -padx 2
+    synth::register_balloon_help .toolbar.paste "Paste"
+}
+pack .toolbar -side top -fill x
+
+frame .main
+frame .main.nw -borderwidth 0
+frame .main.n  -borderwidth 0
+frame .main.ne -borderwidth 0
+frame .main.e  -borderwidth 0
+frame .main.se -borderwidth 0
+frame .main.s  -borderwidth 0
+frame .main.sw -borderwidth 0
+frame .main.w  -borderwidth 0
+
+frame .main.centre
+
+frame .main.border_nw_n      -width 2 -background black -borderwidth 0
+frame .main.border_n_ne      -width 2 -background black -borderwidth 0
+frame .main.border_w_centre  -width 2 -background black -borderwidth 0
+frame .main.border_centre_e  -width 2 -background black -borderwidth 0
+frame .main.border_sw_s      -width 2 -background black -borderwidth 0
+frame .main.border_s_se      -width 2 -background black -borderwidth 0
+frame .main.border_nw_w      -height 2 -background black -borderwidth 0
+frame .main.border_n_centre  -height 2 -background black -borderwidth 0
+frame .main.border_ne_e      -height 2 -background black -borderwidth 0
+frame .main.border_w_sw      -height 2 -background black -borderwidth 0
+frame .main.border_centre_s  -height 2 -background black -borderwidth 0
+frame .main.border_e_se      -height 2 -background black -borderwidth 0
+
+text .main.centre.text -xscrollcommand [list .main.centre.horizontal set] -yscrollcommand [list .main.centre.vertical set]
+scrollbar .main.centre.horizontal -orient horizontal -command [list .main.centre.text xview]
+scrollbar .main.centre.vertical   -orient vertical -command [list .main.centre.text yview]
+grid configure .main.centre.text -row 0 -column 0 -sticky news
+grid configure .main.centre.vertical -row 0 -column 1 -sticky ns
+grid configure .main.centre.horizontal -row 1 -column 0 -sticky ew
+# Is there anything useful to be done in 1,1? e.g. a >> button to
+# go directly to perform ".main.centre.text see end"
+
+# Make sure that row 0 column 0, i.e. the text widget rather than the
+# scrollbars, grows to fit all available space.
+grid rowconfigure .main.centre 0 -weight 1
+grid rowconfigure .main.centre 1 -weight 0
+grid columnconfigure .main.centre 0 -weight 1
+grid columnconfigure .main.centre 1 -weight 0
+
+grid configure .main.nw              -row 0 -column 0 -sticky news
+grid configure .main.border_nw_n     -row 0 -column 1 -sticky ns
+grid configure .main.n               -row 0 -column 2 -sticky news
+grid configure .main.border_n_ne     -row 0 -column 3 -sticky ns
+grid configure .main.ne              -row 0 -column 4 -sticky news
+grid configure .main.border_nw_w     -row 1 -column 0 -sticky ew
+grid configure .main.border_n_centre -row 1 -column 1 -columnspan 3  -sticky ew
+grid configure .main.border_ne_e     -row 1 -column 4 -sticky ew
+grid configure .main.w               -row 2 -column 0 -sticky news
+grid configure .main.border_w_centre -row 2 -column 1 -sticky ns
+grid configure .main.centre          -row 2 -column 2 -sticky news
+grid configure .main.border_centre_e -row 2 -column 3 -sticky ns
+grid configure .main.e               -row 2 -column 4 -sticky news
+grid configure .main.border_w_sw     -row 3 -column 0 -sticky ew
+grid configure .main.border_centre_s -row 3 -column 1 -columnspan 3 -sticky ew
+grid configure .main.border_e_se     -row 3 -column 4 -sticky ew
+grid configure .main.sw              -row 4 -column 0 -sticky news
+grid configure .main.border_sw_s     -row 4 -column 1 -sticky ns
+grid configure .main.s               -row 4 -column 2 -sticky news
+grid configure .main.border_s_se     -row 4 -column 3 -sticky ns
+grid configure .main.se              -row 4 -column 4 -sticky news
+grid columnconfigure .main 0 -weight 0
+grid columnconfigure .main 1 -weight 0
+grid columnconfigure .main 2 -weight 1
+grid columnconfigure .main 3 -weight 0
+grid columnconfigure .main 4 -weight 0
+grid rowconfigure .main 0 -weight 0
+grid rowconfigure .main 1 -weight 0
+grid rowconfigure .main 2 -weight 1
+grid rowconfigure .main 3 -weight 0
+grid rowconfigure .main 4 -weight 0
+
+# The .main frame should not be packed into the main window yet.
+# Until all devices have been instantiated the various subwindows
+# are not yet known, so the desired size of .main is not known
+# either. Packing it too early and then adding more windows
+# causes confusion.
+
+# }}}
+# {{{  Help                                                     
+
+# ----------------------------------------------------------------------------
+# Two main sources of documentation are of interest to the synthetic
+# target. The first is the toplevel eCos documentation. The second
+# is the documentation specific to the generic target. Device-specific
+# scripts may want to add menu entries for their own documentation.
+#
+# The problems are:
+#   1) where to find the documentation
+#   2) how to view it?
+#
+# The documentation should be in the component repository. If there is
+# a variable ECOS_REPOSITORY then that gives the appropriate information.
+# Otherwise things get messy because the repository being used for
+# eCos may not match the repository used when building the host-side
+# support - the versions should match but the repository may have
+# moved. Never the less that is the best we can do.
+# NOTE: sources.redhat.com might provide another alternative, but the
+# documentation is not organized in the same way as the repository.
+#
+# As for how to view the documentation, this is up to user preferences
+# but ecosynth has built-in knowledge of three different viewers. 
+
+namespace eval synth {
+
+    if { $synth::flag_debug } {
+	synth::report "Setting up help menu\n"
+    }
+    
+    variable _browser1   "mozilla -remote openURL(%s)"
+    variable _browser2   "mozilla %s"
+    variable _browser3   "gnome-help-browser %s"
+    variable _main_help  ""
+    variable _synth_help ""
+    set _repo ""
+    
+    if { [info exists env(ECOS_REPOSITORY)] } {
+	set _repo $env(ECOS_REPOSITORY)
+    } else {
+	set _repo $synth::_ecos_repository
+    }
+    if { ![file exists [file join $_repo "ecos.db"]] } {
+	synth::report_warning "Failed to locate eCos component repository.\n   \
+		Please define an environment variable ECOS_REPOSITORY.\n"
+    } else {
+	# FIXME: this needs attention once the documentation is more sorted
+	set synth::_main_help [file join $_repo "index.html"]
+	if { ![file exists $synth::_main_help] } {
+	    if { 0 } {
+		synth::report_warning "Failed to locate toplevel documentation file $synth::_main_help\n   \
+	                               Help->eCos menu option disabled.\n"
+	    }
+	    set synth::_main_help ""
+	} else {
+	    set synth::_main_help "file://$_main_help"
+	}
+	
+	set synth::_synth_help [file join $_repo $synth::_ecosynth_package_dir $synth::_ecosynth_package_version "doc/hal-synth-arch.html"]
+	if { ![file exists $synth::_synth_help] } {
+	    synth::report_warning "Failed to locate synthetic target documentation $synth::_synth_help\n   \
+		    Help->Synthetic target menu option disabled.\n"
+	    set synth::_synth_help ""
+	} else {
+	    set synth::_synth_help "file://$_synth_help"
+	}
+    }
+
+    if { "" != $_main_help } {
+	.menubar.help add command -label "eCos" -command [list synth::_menu_help $synth::handle_help]
+    } else {
+	.menubar.help add command -label "eCos" -state disabled
+    }
+    if { "" != $_synth_help } {
+	.menubar.help add command -label "Synthetic target" -command [list synth::handle_help "$synth::_synth_help"]
+    } else {
+	.menubar.help add command -label "Synthetic target" -state disabled
+    }
+    
+    unset _repo
+    
+    proc handle_help { which } {
+	set command [format $synth::_browser1 $which]
+	if { 0 != [catch { eval exec -- "$command > /dev/null" } & ] } {
+	    set command [format $synth::_browser2 $which]
+	    if { 0 != [catch { eval exec -- "$command > /dev/null &" } ] } {
+		set command [format $synth::_browser3 $which]
+		if { 0 != [catch { eval exec -- "$command > /dev/null &"} ] } {
+		    synth::report_warning "Unable to start a help browser.\n   Please check the settings in Edit->Preferences.\n"
+		}
+	    }
+	}
+    }
+
+    # FIXME: add an about box as well.
+}
+
+# }}}
+# {{{  Filters                                                  
+
+# ----------------------------------------------------------------------------
+# The central text window is expected to provide the bulk of the information
+# to the user. This information can be voluminous, so filtering is desirable.
+#
+# There are two types of filters. System filters are provided by ecosynth
+# itself and by device-specific scripts. For example ecosynth has a filter
+# for warnings, and the console device has a filter for eCos trace messages.
+# In addition users can specify their own filters using regular expressions,
+# and those filters take priority. Note that there is an assumption that
+# output is predominantly line-based: if partial lines get output then
+# some confusion is possible.
+#
+# With tk the implementation is relatively straightforward: the text widget's
+# tag facility does all the hard work of controlling how text gets displayed.
+# It is possible to show or hide text using -elide, colours can be controlled
+# using -background and -foreground, ... Not all of this functionality
+# is made available to the user just yet.
+
+namespace eval synth {
+    # The bulk of the information is held in arrays, indexed by the name of
+    # the filter. Lists are used to keep track of all valid names.
+    variable _system_filter_list      [list]
+    variable _system_filter_settings
+    variable _user_filter_list        [list]
+    variable _user_filter_settings
+
+    # Does a given system filter already exist?
+    proc filter_exists { name } {
+	set result 0
+	if { -1 != [lsearch -exact $synth::_system_filter_list $name] } {
+	    set result 1
+	}
+	return $result
+    }
+
+    proc filter_get_list { } {
+	return $synth::_system_filter_list
+    }
+    
+    # Parsing support. All filters take a number of standard options:
+    #
+    #   -text "message"      - how to identify this filter to the user
+    #   -hide [0|1]          - whether or not this text should be hidden by default
+    #   -foreground <colour>
+    #   -background <colour>
+    #
+    # The details of the currently supported options are known only to
+    # filter_parse_options and filter_add, allowing new options such
+    # as font manipulation to be added in future.
+    #
+    # There are two ways of adding a filter. filter_add is typically used
+    # inside ecosynth.tcl with known good data. filter_add_parsed is
+    # used with user-provided data, e.g. from the target definition file,
+    # after a call to filter_validate.
+    proc filter_parse_options { arg_list result_ref message_ref } {
+	upvar 1 $result_ref result
+	upvar 1 $message_ref message
+	set message ""
+
+	set text_set        0
+	set hide_set        0
+	set foreground_set  0
+	set background_set  0
+	
+	set len [llength $arg_list]
+	for { set i 0 } { $i < $len } { incr i } {
+	    set arg [lindex $arg_list $i]
+	    if { ( "-text" == $arg) ||
+	         ( "-hide" == $arg) ||
+	         ( "-foreground" == $arg) || ( "-fg" == $arg) ||
+	         ( "-background" == $arg) || ( "-bg" == $arg) } {
+
+		 incr i
+                 if { $i >= $len } {
+		     append message "    Missing data after argument $arg\n"
+		 } else {
+		     set data [lindex $arg_list $i]
+		     if { "-text" == $arg } {
+			 if { $text_set } {
+			     append message "    Attempt to set -text option twice.\n"
+			 } else {
+			     set text_set 1
+			     set result("-text") $data
+			 }
+		     } elseif { "-hide" == $arg } {
+			 if { $hide_set } {
+			     append message "    Attempt to set -hide option twice.\n"
+			 } else {
+			     set hide_set 1
+			     if { ! [string is boolean -strict $data] } {
+				 append message "    -hide should be given a boolean value, not \"$data\"\n"
+			     } else {
+				 set result("-hide") [expr $data ? 1 : 0]
+			     }
+			 }
+		     } elseif { ( "-foreground" == $arg) || ( "-fg" == $arg ) } {
+			 if { $foreground_set } {
+			     append message "    Attempt to set -foreground twice.\n"
+			 } else {
+			     set foreground_set 1
+			     # FIXME: is there some way of validating this color?
+			     set result("-foreground") $data
+			 }
+		     } elseif { ( "-background" == $arg) || ( "-bg" == $arg ) } {
+			 if { $background_set } {
+			     append message "    Attempt to set -background twice.\n"
+			 } else {
+			     set background_set 1
+			     # FIXME: is there some way of validating this color?
+			     set result("-background") $data
+			 }
+		     }
+		 }
+	     } else {
+		 append message "    Unknown option \"$arg\".\n"
+	     }
+	}
+
+	if { "" == $message } {
+	    return 1
+	} else {
+	    return 0
+	}
+    }
+
+    # Add a new system filter, after the options have been parsed 
+    proc filter_add_parsed { name data_ref } {
+	upvar 1 $data_ref data
+
+	set text       $name
+	set hide       0
+	set foreground "<default>"
+	set background "<default>"
+	if { [info exists data("-text")] } {
+	    set text $data("-text")
+	}
+	if { [info exists data("-hide")] } {
+	    set hide $data("-hide")
+	}
+	if { [info exists data("-foreground")] } {
+	    set foreground $data("-foreground")
+	} 
+	if { [info exists data("-background")] } {
+	    set background $data("-background")
+	}
+	
+	if { $hide } {
+	    .main.centre.text tag configure $name -elide 1
+	} else {
+	    .main.centre.text tag configure $name -elide 0
+	}
+	if { "<default>" == $foreground } {
+	    .main.centre.text tag configure $name -foreground [.main.centre.text cget -foreground]
+	} else {
+	    set msg ""
+	    if [catch {	.main.centre.text tag configure $name -foreground $foreground } msg ] {
+		synth::report_warning "Unable to configure color \"$foreground\"\n    $msg\n"
+		set foreground "<default>"
+		.main.centre.text tag configure $name -foreground [.main.centre.text cget -foreground]
+	    }
+	}
+	if { "<default>" == $background } {
+	    .main.centre.text tag configure $name -background [.main.centre.text cget -background]
+	} else {
+	    set msg ""
+	    if [catch {	.main.centre.text tag configure $name -background $background } msg ] {
+		synth::report_warning "Unable to configure color \"$background\"\n    $msg\n"
+		set background "<default>"
+		.main.centre.text tag configure $name -background [.main.centre.text cget -background]
+	    }
+	}
+	
+	lappend synth::_system_filter_list $name
+	set synth::_system_filter_settings($name,text)       $text
+	set synth::_system_filter_settings($name,hide)       $hide
+	set synth::_system_filter_settings($name,foreground) $foreground
+	set synth::_system_filter_settings($name,background) $background
+
+	# System tags should only get added during initialization. Hence the
+	# first time the system filters window is brought up all filters
+	# should be defined. However, just in case a new filter is added
+	# in the middle of a run...
+	if { [winfo exists .system_filters] } {
+	    destroy .system_filters
+	}
+    }
+    
+    # Add a new system filter, performing the appropriate parsing.
+    proc filter_add { name args } {
+
+	if { [synth::filter_exists $name] } {
+	    synth::internal_error "attempt to install filter $name twice.\n"
+	}
+	array set data [list]
+	set   msg ""
+
+	if { ![synth::filter_parse_options $args data msg] } {
+	    # Any dubious arguments to the internal filter_add are treated as fatal.
+	    synth::internal_error "unable to create new filter $name.\n$msg"
+	} else {
+	    filter_add_parsed $name data
+	}
+    }
+
+    filter_add "report"  -text "ecosynth messages"
+    filter_add "error"   -text "ecosynth errors"   -foreground red
+    # amber is not a standard colour. Amber leds emit light in the range
+    # 595-605 nm, corresponding to rgb values of approx. FF4200.
+    # OrangeRed is close enough at FF4500
+    filter_add "warning" -text "ecosynth warnings" -foreground OrangeRed
+
+    # Bring up the system filters window, creating it if necessary.
+    # Keeping the toplevel around but iconified/withdrawn when
+    # unwanted means that properties such as size and position will
+    # tend to be preserved.
+    variable _system_filter_new_settings
+    variable _system_filter_widgets
+    
+    proc _menu_view_system_filters { } {
+	if { [winfo exists .system_filters] } {
+	    if { "normal" == [wm state .system_filters] } {
+		raise .system_filters
+	    } else {
+		wm deiconify .system_filters
+	    }
+	    return
+	}
+	toplevel .system_filters
+	wm title .system_filters "ecosynth system filters"
+	wm protocol .system_filters "WM_DELETE_WINDOW" [list synth::_menu_view_system_filters_cancel]
+	wm group .system_filters .
+	
+	frame .system_filters.main
+	label .system_filters.main.header1 -text "Filter"
+	label .system_filters.main.header2 -text "Hide"
+	label .system_filters.main.header3 -text "Foreground"
+	label .system_filters.main.header4 -text "Background"
+	set text_fg [.system_filters.main.header1 cget -foreground]
+	frame .system_filters.main.row0 -height 1 -background $text_fg
+	frame .system_filters.main.row2 -height 1 -background $text_fg
+	frame .system_filters.main.col0 -width 1  -background $text_fg
+	frame .system_filters.main.col2 -width 1  -background $text_fg
+	frame .system_filters.main.col4 -width 1  -background $text_fg
+	frame .system_filters.main.col6 -width 1  -background $text_fg
+	frame .system_filters.main.col8 -width 1  -background $text_fg
+	grid .system_filters.main.row0 -row 0 -column 0 -columnspan 9 -sticky ew
+	grid .system_filters.main.header1 -row 1 -column 1 -sticky news
+	grid .system_filters.main.header2 -row 1 -column 3 -sticky news
+	grid .system_filters.main.header3 -row 1 -column 5 -sticky news
+	grid .system_filters.main.header4 -row 1 -column 7 -sticky news
+	grid .system_filters.main.row2 -row 2 -column 0 -columnspan 9 -sticky ew
+
+	set row 3
+	foreach filter $synth::_system_filter_list {
+	    set synth::_system_filter_new_settings($filter,hide) $synth::_system_filter_settings($filter,hide)
+	    set synth::_system_filter_new_settings($filter,foreground) $synth::_system_filter_settings($filter,foreground)
+	    set synth::_system_filter_new_settings($filter,background) $synth::_system_filter_settings($filter,background)
+	    
+	    set synth::_system_filter_widgets($filter,label) \
+		    [label .system_filters.main.filter_name_$row -text $synth::_system_filter_settings($filter,text)]
+	    set synth::_system_filter_widgets($filter,hide) \
+		    [checkbutton .system_filters.main.filter_hide_$row -borderwidth 2 -indicatoron false -selectcolor "" \
+		    -image $synth::image_tick_no -selectimage $synth::image_tick_yes -variable synth::_system_filter_new_settings($filter,hide)]
+	    set synth::_system_filter_widgets($filter,foreground) [button .system_filters.main.filter_foreground_$row -borderwidth 2 \
+		    -command [list synth::_menu_view_system_filters_choose_foreground $filter]]
+	    set synth::_system_filter_widgets($filter,background) [button .system_filters.main.filter_background_$row -borderwidth 2 \
+		    -command [list synth::_menu_view_system_filters_choose_background $filter]]
+
+	    grid .system_filters.main.filter_name_$row       -row $row -column 1 -sticky news
+	    grid .system_filters.main.filter_hide_$row       -row $row -column 3 -sticky news
+	    grid .system_filters.main.filter_foreground_$row -row $row -column 5 -sticky news
+	    grid .system_filters.main.filter_background_$row -row $row -column 7 -sticky news
+
+	    incr row
+	    frame .system_filters.main.row$row -height 1 -background $text_fg
+	    grid .system_filters.main.row$row -row $row -column 0 -columnspan 9 -sticky ew
+	    incr row
+	}
+	grid .system_filters.main.col0 -row 0 -column 0 -rowspan $row -sticky ns
+	grid .system_filters.main.col2 -row 0 -column 2 -rowspan $row -sticky ns
+	grid .system_filters.main.col4 -row 0 -column 4 -rowspan $row -sticky ns
+	grid .system_filters.main.col6 -row 0 -column 6 -rowspan $row -sticky ns
+	grid .system_filters.main.col8 -row 0 -column 8 -rowspan $row -sticky ns
+
+	for { set i 0 } { $i < $row } { incr i 2 } {
+	    grid rowconfigure .system_filters.main $i -weight 0
+	}
+	for { set i 1 } { $i < $row } { incr i 2 } {
+	    grid rowconfigure .system_filters.main $i -weight 1
+	}
+	for { set i 0 } { $i < 9 } { incr i 2 } {
+	    grid columnconfigure .system_filters.main $i -weight 0
+	}
+	for { set i 1 } { $i < 9 } { incr i 2 } {
+	    grid columnconfigure .system_filters.main $i -weight 1
+	}
+	
+	pack .system_filters.main -side top -fill both -expand 1 -pady 4 -padx 4
+
+	# FIXME: add try and revert buttons
+	frame .system_filters.buttons
+	button .system_filters.buttons.ok     -text "OK"     -command [list synth::_menu_view_system_filters_ok]
+	button .system_filters.buttons.cancel -text "Cancel" -command [list synth::_menu_view_system_filters_cancel]
+	pack .system_filters.buttons.ok .system_filters.buttons.cancel -side left -expand 1
+	pack .system_filters.buttons -side bottom -fill x -pady 4
+
+	frame .system_filters.separator -height 2 -borderwidth 1 -relief sunken
+	pack .system_filters.separator -side bottom -fill x -pady 4
+
+	bind .system_filters <KeyPress-Return> [list synth::_menu_view_system_filters_ok]
+	bind .system_filters <KeyPress-Escape> [list synth::_menu_view_system_filters_cancel]
+
+	synth::_menu_view_system_filters_reset
+    }
+
+    proc _menu_view_system_filters_reset { } {
+	foreach filter $synth::_system_filter_list {
+	    set synth::_system_filter_new_settings($filter,hide) $synth::_system_filter_settings($filter,hide)
+	    set synth::_system_filter_new_settings($filter,foreground) $synth::_system_filter_settings($filter,foreground)
+	    set synth::_system_filter_new_settings($filter,background) $synth::_system_filter_settings($filter,background)
+
+	    set colour $synth::_system_filter_new_settings($filter,foreground)
+	    if { "<default>" == $colour } {
+		set colour [.system_filters.main.header1 cget -foreground]
+	    }
+	    $synth::_system_filter_widgets($filter,label) configure -foreground $colour 
+	    $synth::_system_filter_widgets($filter,foreground) configure -background $colour -activebackground $colour
+
+	    set colour $synth::_system_filter_new_settings($filter,background)
+	    if { "<default>" == $colour } {
+		set colour [.system_filters.main.header1 cget -background]
+	    }
+	    $synth::_system_filter_widgets($filter,label) configure -background $colour
+	    $synth::_system_filter_widgets($filter,background) configure -background $colour -activebackground $colour
+	}
+    }
+
+    # Change a colour. For now this involves calling Tk's chooseColor utility.
+    # This is simple but not quite right: it would be much better to allow
+    # the foreground and background to be modified in the same dialog, providing
+    # immediate feedback on how the text will actually appear; it should also
+    # provide some simple way of reverting to the default.
+    proc _menu_view_system_filters_choose_foreground { filter } {
+	set current_colour $synth::_system_filter_new_settings($filter,foreground)
+	if { "<default>" == $current_colour } {
+	    set current_colour [.system_filters.main.header1 cget -foreground]
+	}
+	set new_colour [tk_chooseColor -parent .system_filters -title "$synth::_system_filter_settings($filter,text) foreground" \
+		-initialcolor $current_colour]
+	if { "" != $new_colour } {
+	    set synth::_system_filter_new_settings($filter,foreground) $new_colour
+	    $synth::_system_filter_widgets($filter,label) configure -foreground $new_colour
+	    $synth::_system_filter_widgets($filter,foreground) configure -background $new_colour -activebackground $new_colour
+	}
+    }
+    
+    proc _menu_view_system_filters_choose_background { filter } {
+	set current_colour $synth::_system_filter_new_settings($filter,background)
+	if { "<default>" == $current_colour } {
+	    set current_colour [.system_filters.main.header1 cget -background]
+	}
+	set new_colour [tk_chooseColor -parent .system_filters -title "$synth::_system_filter_settings($filter,text) background" \
+		-initialcolor $current_colour]
+	if { "" != $new_colour } {
+	    set synth::_system_filter_new_settings($filter,background) $new_colour
+	    $synth::_system_filter_widgets($filter,label) configure -background $new_colour
+	    $synth::_system_filter_widgets($filter,background) configure -background $new_colour -activebackground $new_colour
+	}
+    }
+    
+    proc _menu_view_system_filters_ok { } {
+	wm withdraw .system_filters
+	foreach filter $synth::_system_filter_list {
+	    if { $synth::_system_filter_settings($filter,hide) != $synth::_system_filter_new_settings($filter,hide) } {
+		set hide $synth::_system_filter_new_settings($filter,hide)
+		set synth::_system_filter_settings($filter,hide) $hide
+		if { $hide } {
+		    .main.centre.text tag configure $filter -elide 1
+		} else {
+		    .main.centre.text tag configure $filter -elide 0
+		}
+	    }
+	    if { $synth::_system_filter_settings($filter,foreground) != $synth::_system_filter_new_settings($filter,foreground) } {
+		set foreground $synth::_system_filter_new_settings($filter,foreground)
+		set synth::_system_filter_settings($filter,foreground) $foreground
+		.main.centre.text tag configure $filter -foreground $foreground
+	    }
+	    if { $synth::_system_filter_settings($filter,background) != $synth::_system_filter_new_settings($filter,background) } {
+		set background $synth::_system_filter_new_settings($filter,background)
+		set synth::_system_filter_settings($filter,background) $background
+		.main.centre.text tag configure $filter -background $background
+	    }
+	}
+    }
+
+    proc _menu_view_system_filters_cancel { } {
+	wm withdraw .system_filters
+	synth::_menu_view_system_filters_reset
+    }
+
+    # Now add a suitable entry to the View menu.
+    .menubar.view add command -label "System filters..." -command [list synth::_menu_view_system_filters]
+
+    # User filters.
+    # FIXME: implement
+    # .menubar.view add command -label "User filters..." -command [list synth::_menu_view_filters] -state disabled
+}
+
+# }}}
+# {{{  Text window                                              
+
+# ----------------------------------------------------------------------------
+# The central text window is expected to provide the bulk of the information
+# to the user. Various filtering mechanisms are desirable. For example the
+# user should be able to control whether or not eCos trace messages are
+# currently visible, not to mention other characteristics such as font
+# and colours. The text widget's tag mechanism makes this relatively simple.
+
+namespace eval synth {
+
+    # Should the user be able to edit the text window, e.g. to add annotations?
+    # This is disabled by default but can be enabled.
+    variable flag_read_only 1
+    
+    # By default disable wrapping. Possibly it should be possible to
+    # enable this on a per-tag basis.
+    .main.centre.text configure -wrap "none"
+
+    # Give the text widget the focus by default. That way operations
+    # like page-up work immediately.
+    focus .main.centre.text
+    
+    # If editing is currently disallowed, do not accept any input.
+    # The code below is probably not quite sufficient, it is
+    # ASCII-centric. A separate binding for Alt- sequences ensures
+    # that the top-level menu processing continues to work.
+    # Similarly a separate binding for Control- sequences ensures
+    # that the shortcuts continue to work.
+    bind .main.centre.text <Alt-KeyPress> {
+	continue
+    }
+    bind .main.centre.text <Control-KeyPress> {
+	continue
+    }
+    bind .main.centre.text <KeyPress> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} elseif { 0 != [llength %A] } {
+	    break
+	} elseif { ("Return" == "%K") || ("Tab" == "%K") || ("space" == "%K") } {
+	    break
+	} else {
+	    continue
+	}
+    }
+    # There are a few special control- bindings built in to the Tk text
+    # widget which perform editing operations
+    bind .main.centre.text <Control-KeyPress-h> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    bind .main.centre.text <Control-KeyPress-d> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    bind .main.centre.text <Control-KeyPress-k> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    bind .main.centre.text <Control-KeyPress-o> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    bind .main.centre.text <Control-KeyPress-t> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    
+    # Implement support for the normal edit menu operations.
+    # FIXME: add a search facility
+    .menubar.edit insert end command -label "Cut"        -command [list synth::_handle_edit_cut]        -underline 2 -accelerator "Ctrl-X" -state disabled
+    .menubar.edit insert end command -label "Copy"       -command [list synth::_handle_edit_copy]       -underline 0 -accelerator "Ctrl-C"
+    .menubar.edit insert end command -label "Paste"      -command [list synth::_handle_edit_paste]      -underline 0 -accelerator "Ctrl-V" -state disabled
+    .menubar.edit insert end command -label "Clear"      -command [list synth::_handle_edit_clear]      -underline 3 -accelerator "Del"    -state disabled
+    .menubar.edit insert end command -label "Select All" -command [list synth::_handle_edit_select_all] -underline 9 -accelerator "Ctrl-A"
+    .menubar.edit insert end checkbutton -label "Read Only" -variable synth::flag_read_only
+    .menubar.edit insert end separator
+    proc _trace_read_only { name1 name2 op } {
+	if { !$synth::flag_read_only } {
+	    .menubar.edit entryconfigure "Cut"   -state normal
+	    .menubar.edit entryconfigure "Paste" -state normal
+	    .menubar.edit entryconfigure "Clear" -state normal
+	    .toolbar.cut configure -state normal
+	    .toolbar.paste configure -state normal
+	} else {
+	    .menubar.edit entryconfigure "Cut"   -state disabled
+	    .menubar.edit entryconfigure "Paste" -state disabled
+	    .menubar.edit entryconfigure "Clear" -state disabled
+	    .toolbar.cut configure -state disabled
+	    .toolbar.paste configure -state disabled
+	}
+    }
+    trace variable synth::flag_read_only "w" synth::_trace_read_only
+
+    # Support for cut'n'paste etc. The widget does most of the hard
+    # work, but this code has to distinguish between read-only and
+    # read-write windows.
+    #
+    # Some operations such as clear may operate on everything in the
+    # selection, including hidden text that happens to be in the
+    # range. That may or may not be the right thing to do. It is right
+    # if the intent is to get rid of all events during a period of
+    # time, but wrong if the user wants to get rid of specific text.
+    bind . <Control-KeyPress-x> [list synth::_handle_edit_cut]
+    bind . <Control-KeyPress-c> [list synth::_handle_edit_copy]
+    bind . <Control-KeyPress-v> [list synth::_handle_edit_paste]
+    bind . <KeyPress-Delete>    [list synth::_handle_edit_clear]
+    bind . <Control-KeyPress-a> [list synth::_handle_edit_select_all]
+    
+    bind .main.centre.text <<Paste>> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    bind .main.centre.text <<Cut>> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    bind .main.centre.text <<Clear>> {
+	if { !$synth::flag_read_only } {
+	    continue
+	} else {
+	    break
+	}
+    }
+    
+    proc _handle_edit_cut { } {
+	event generate .main.centre.text "<<Cut>>"
+    }
+
+    proc _handle_edit_copy { } {
+	event generate .main.centre.text "<<Copy>>"
+    }
+
+    proc _handle_edit_paste { } {
+	event generate .main.centre.text "<<Paste>>"
+    }
+
+    proc _handle_edit_clear { } {
+	event generate .main.centre.text "<<Clear>>"
+    }
+
+    proc _handle_edit_select_all { } {
+	.main.centre.text tag add sel 1.0 "end - 1 chars"
+    }
+
+    # Most output to the text window goes through this routine. It inserts
+    # some text with an appropriate tag. In addition it will ensure that
+    # the new text is visible if appropriate, and if a logfile has been
+    # specified then that will be updated as well.
+    proc output { msg tag } {
+	set ytail [lindex [.main.centre.text yview] 1]
+	set xhead [lindex [.main.centre.text xview] 0]
+	.main.centre.text insert end $msg $tag
+	if { (1.0 == $ytail) && (0.0 == $xhead) } {
+	    .main.centre.text see end
+	}
+	if { "" != $synth::_logfd } {
+	    puts -nonewline $synth::_logfd $msg
+	}
+    }
+
+    # Text output is now possible, so flush anything that is still buffered.
+    # xview and yview may not give the right results until the window
+    # is mapped, so always make the last text visible.
+    set synth::flag_gui_ready 1
+    synth::_flush_output
+    .main.centre.text see end
+
+    
+    # Support for saving the current document. Save applies only to
+    # the currently visible text. SaveAll gives the hidden text as
+    # well.
+    variable _savefile ""
+    proc _handle_file_save { } {
+	if { "" == $synth::_savefile } {
+	    set synth::_savefile [tk_getSaveFile -parent .]
+	    if { "" == $synth::_savefile } {
+		return
+	    }
+	}
+	set msg ""
+	if { 0 != [catch { set fd [open $synth::_savefile "w"] } msg] } {
+	    synth::report_error "$msg\n"
+	    if { $synth::_system_filter_settings(error,hide) } {
+		tk_messageBox -type "ok" -icon "error" -parent . -message "$msg\n"
+	    }
+	    return
+	}
+	set number_lines [expr int([.main.centre.text index end])]
+	for { set i 1 } { $i < $number_lines } { incr i } {
+	    set tags [.main.centre.text tag names "[set i].0"]
+	    if {[llength $tags] > 0 } {
+		set tag [lindex $tags 0]
+		if { [info exists synth::_system_filter_settings($tag,hide)] &&
+		     $synth::_system_filter_settings($tag,hide) } {
+		    continue
+		}
+	    }
+	    puts $fd [.main.centre.text get "[set i].0" "[set i].end"]
+	}
+	close $fd
+    }
+
+    proc _handle_file_save_as { } {
+	set new_savefile [tk_getSaveFile -parent .]
+	if { "" == $new_savefile } {
+	    return
+	}
+	set synth::_savefile $new_savefile
+	synth::_handle_file_save
+    }
+
+    proc _handle_file_save_all { } {
+	set new_savefile [tk_getSaveFile -parent .]
+	if { "" == $new_savefile } {
+	    return
+	}
+	set msg ""
+	if { 0 != [catch { set fd [open $new_savefile "w"] } msg] } {
+	    synth::report_error "$msg\n"
+	    if { $synth::_system_filter_settings(error,hide) } {
+		tk_messageBox -type "ok" -icon "error" -parent . -message "$msg\n"
+	    }
+	    return
+	}
+	puts -nonewline $fd [.main.centre.text get 1.0 end]
+	close $fd
+    }
+}
+
+# }}}
+# {{{  Heartbeat and status                                     
+
+# ----------------------------------------------------------------------------
+# This code manages a status line at the bottom of the main window.
+# This involves a little heartbeat window, a label with the
+# text Running or Exited, some padding, and an additional status
+# line for use by other code.
+#
+# A variety of heartbeats have been attempted. The current one is
+# still not very good, but will do for now. Others are if 0'd out.
+# Note that these others may require additional images to be
+# preloaded.
+
+namespace eval synth {
+    frame .status -borderwidth 1 -relief groove
+    
+    if { 1 } {
+	# The eCos logo, bouncing horizontally
+	variable _heartbeat_image_width [image width $synth::image_running1]
+	variable _heartbeat_offset 0
+	variable _heartbeat_ltor   1
+
+	frame .status.heartbeat -width $synth::_heartbeat_image_width -height [image height $synth::image_running1]
+	pack  .status.heartbeat -side left
+	label .status.heartbeat.image -image $synth::image_running1 -anchor w -borderwidth 0
+	place .status.heartbeat.image -x $synth::_heartbeat_offset -y 0
+
+	proc _heartbeat_update { } {
+	    if { ! $synth::ecos_running } {
+		place configure .status.heartbeat.image -x 0 -y 0
+	    } else {
+		if { $synth::_heartbeat_ltor } {
+		    incr synth::_heartbeat_offset 4
+		} else {
+		    incr synth::_heartbeat_offset -4
+		}
+		place configure .status.heartbeat.image -x $synth::_heartbeat_offset
+
+		if { $synth::_heartbeat_offset < (5 - $synth::_heartbeat_image_width) } {
+		    set synth::_heartbeat_ltor 1
+		} elseif { $synth::_heartbeat_offset > ( $synth::_heartbeat_image_width -5) } {
+		    set synth::_heartbeat_ltor 0
+		}
+		after 100 synth::_heartbeat_update
+	    }
+	}
+	after 100 synth::_heartbeat_update
+	
+    } elseif { 0 } {
+	# The eCos logo, alternating between a normal and an inverse version
+	variable _heartbeat_image_width [image width $synth::image_running1]
+	variable _heartbeat_inverse ""
+	variable _heartbeat_normal  ""
+	variable _heartbeat_inverse_width     1
+	variable _heartbeat_normal_width      1
+	
+	canvas .status.heartbeat_canvas -width [image width $synth::image_running1] -height [image height $synth::image_running1]
+	pack .status.heartbeat_canvas -side left
+	label .status.heartbeat_canvas.background -image $synth::image_running1 -anchor w -borderwidth 0
+	label .status.heartbeat_canvas.inverse    -image $synth::image_running2 -anchor w -borderwidth 0
+	label .status.heartbeat_canvas.normal     -image $synth::image_running1 -anchor w -borderwidth 0
+	.status.heartbeat_canvas create window 0 0 -anchor nw -window .status.heartbeat_canvas.background
+	set synth::_heartbeat_inverse [.status.heartbeat_canvas create window 0 0 -anchor nw -window .status.heartbeat_canvas.inverse]
+	raise .status.heartbeat_canvas.inverse .status.heartbeat_canvas.background
+	set synth::_heartbeat_normal  [.status.heartbeat_canvas create window 0 0 -anchor nw -window .status.heartbeat_canvas.normal]
+	raise .status.heartbeat_canvas.normal .status.heartbeat_canvas.inverse
+
+	.status.heartbeat_canvas itemconfigure $synth::_heartbeat_inverse -width $synth::_heartbeat_inverse_width
+	.status.heartbeat_canvas itemconfigure $synth::_heartbeat_normal  -width $synth::_heartbeat_normal_width
+
+	proc _heartbeat_update { } {
+	    if { ! $synth::ecos_running } {
+		.status.heartbeat_canvas delete $synth::_heartbeat_inverse
+		.status.heartbeat_canvas delete $synth::_heartbeat_normal
+	    } else {
+		if { $synth::_heartbeat_inverse_width < $synth::_heartbeat_image_width } {
+		    incr synth::_heartbeat_inverse_width 2
+		    .status.heartbeat_canvas itemconfigure $synth::_heartbeat_inverse -width $synth::_heartbeat_inverse_width
+		} elseif { $synth::_heartbeat_normal_width < $synth::_heartbeat_image_width } {
+		    incr synth::_heartbeat_normal_width 2
+		    .status.heartbeat_canvas itemconfigure $synth::_heartbeat_normal -width $synth::_heartbeat_normal_width
+		} else {
+		    set synth::_heartbeat_inverse_width 1
+		    set synth::_heartbeat_normal_width 1
+		    .status.heartbeat_canvas itemconfigure $synth::_heartbeat_inverse -width $synth::_heartbeat_inverse_width
+		    .status.heartbeat_canvas itemconfigure $synth::_heartbeat_normal  -width $synth::_heartbeat_normal_width
+		}
+		after 100 synth::_heartbeat_update
+	    }
+	}
+	after 100 synth::_heartbeat_update
+    
+    } elseif { 0 } {
+	# The eCos logo moving left to right, then replaced by a slightly smaller
+	# mirror version moving right to left, sort of as if rotating around a torus
+	variable _heartbeat_image_width [image width $synth::image_running1]
+	variable _heartbeat_offset [expr -1 * [image width $synth::image_running1]]
+	variable _heartbeat_ltor 1
+	
+	frame .status.heartbeat -width $synth::_heartbeat_image_width -height [image height $synth::image_running1]
+	pack  .status.heartbeat -side left
+	label .status.heartbeat.label -image $synth::image_running1 -anchor w -borderwidth 0
+
+	place .status.heartbeat.label -x $synth::_heartbeat_offset -y 0
+
+	proc _heartbeat_update { } {
+	    if { ! $synth::ecos_running } {
+		.status.heartbeat.label configure -image $synth::image_running1
+		place configure .status.heartbeat.label -x 0
+	    } else {
+		if { $synth::_heartbeat_ltor } {
+		    incr synth::_heartbeat_offset 4
+		} else {
+		    incr synth::_heartbeat_offset -4
+		}
+		place configure .status.heartbeat.label -x $synth::_heartbeat_offset
+		if { $synth::_heartbeat_offset < (0 - $synth::_heartbeat_image_width) } {
+		    .status.heartbeat.label configure -image $synth::image_running1
+		    set synth::_heartbeat_ltor 1
+		} elseif { $synth::_heartbeat_offset > $synth::_heartbeat_image_width } {
+		    .status.heartbeat.label configure -image $synth::image_running3
+		    set synth::_heartbeat_ltor 0
+		}
+		after 100 synth::_heartbeat_update
+	    }
+	}
+	after 100 synth::_heartbeat_update
+    }
+
+    label .status.running -width 10 -text "Running" -anchor w
+    pack .status.running -side left
+    proc _heartbeat_exit_hook { arg_list } {
+	.status.running configure -text "Exited"
+    }
+    synth::hook_add "ecos_exit" synth::_heartbeat_exit_hook
+    
+    label .status.text -text "" -anchor w
+    pack .status.text -side left -fill x -expand 1
+    pack .status -side bottom -fill x
+}
+
+# }}}
+# {{{  Preferences                                              
+
+namespace eval synth {
+
+    if { $synth::flag_debug } {
+	synth::report "Setting up preferences window.\n"
+    }
+
+    variable _pref_browser1 ""
+    variable _pref_browser2 ""
+    variable _pref_browser3 ""
+    
+    toplevel .preferences
+    wm title .preferences "ecosynth preferences"
+    wm withdraw .preferences
+    wm protocol .preferences "WM_DELETE_WINDOW" [list synth::_menu_edit_preferences_cancel]
+    wm group .preferences .
+
+    # NOTE: the fixed-size padx/pady arguments should probably be determined 
+    # using a font calculation. The fixed width for the column 0 entries is also
+    # a cheat.
+    set _pref_col0_width 24
+    
+    frame .preferences.help
+    frame .preferences.help.frame -borderwidth 2 -relief groove
+    pack .preferences.help.frame -fill both -expand 1 -pady 10
+    frame .preferences.help.frame.blank -height 10
+    label .preferences.help.frame.label1 -text "Preferred browser"  -width $synth::_pref_col0_width -anchor w
+    label .preferences.help.frame.label2 -text "First alternative"  -width $synth::_pref_col0_width -anchor w
+    label .preferences.help.frame.label3 -text "Second alternative" -width $synth::_pref_col0_width -anchor w
+    entry .preferences.help.frame.entry1 -width 40 -relief sunken -textvariable synth::_pref_browser1
+    entry .preferences.help.frame.entry2 -width 40 -relief sunken -textvariable synth::_pref_browser2
+    entry .preferences.help.frame.entry3 -width 40 -relief sunken -textvariable synth::_pref_browser3
+    grid .preferences.help.frame.blank -row 0 -column 0
+    grid .preferences.help.frame.label1  -row 1 -column 0 -sticky w
+    grid .preferences.help.frame.label2  -row 2 -column 0 -sticky w
+    grid .preferences.help.frame.label3  -row 3 -column 0 -sticky w
+    grid .preferences.help.frame.entry1  -row 1 -column 1 -sticky ew
+    grid .preferences.help.frame.entry2  -row 2 -column 1 -sticky ew
+    grid .preferences.help.frame.entry3  -row 3 -column 1 -sticky ew
+    grid columnconfigure .preferences.help.frame 0 -weight 0
+    grid columnconfigure .preferences.help.frame 1 -weight 1
+    
+    label .preferences.help.title -text "Help"
+    place .preferences.help.title -in .preferences.help.frame -relx .1 -x -5 -y -10 -bordermode outside
+    pack .preferences.help -fill both -expand 1 -padx 10
+
+    frame .preferences.buttons
+    button .preferences.buttons.ok     -text "OK"     -command [list synth::_menu_edit_preferences_ok]
+    button .preferences.buttons.cancel -text "Cancel" -command [list synth::_menu_edit_preferences_cancel]
+    pack .preferences.buttons.ok .preferences.buttons.cancel -side left -expand 1
+    pack .preferences.buttons -side bottom -fill x -pady 4
+
+    frame .preferences.separator -height 2 -borderwidth 1 -relief sunken
+    pack .preferences.separator -side bottom -fill x -pady 4
+
+    bind .preferences <KeyPress-Return> [list synth::_menu_edit_preferences_ok]
+    bind .preferences <KeyPress-Escape> [list synth::_menu_edit_preferences_cancel]
+
+    variable _saved_focus ""
+    proc _menu_edit_preferences { } {
+	set synth::_saved_focus [focus]
+	set synth::_pref_browser1 $synth::_browser1
+	set synth::_pref_browser2 $synth::_browser2
+	set synth::_pref_browser3 $synth::_browser3
+	if { "normal" == [wm state .preferences] } {
+	    raise .preferences
+	} else {
+	    wm deiconify .preferences
+	}
+	focus .preferences.help.frame.entry1
+    }
+
+    proc _menu_edit_preferences_ok { } {
+	if { $synth::_browser1 != $synth::_pref_browser1 } {
+	    set synth::_browser1 $synth::_pref_browser1
+	}
+	if { $synth::_browser2 != $synth::_pref_browser2 } {
+	    set synth::_browser2 $synth::_pref_browser2
+	}
+	if { $synth::_browser3 != $synth::_pref_browser3 } {
+	    set synth::_browser3 $synth::_pref_browser3
+	}
+
+	wm withdraw .preferences
+	catch { focus $synth::_saved_focus }
+    }
+
+    proc _menu_edit_preferences_cancel { } {
+	wm withdraw .preferences
+	catch { focus $synth::_saved_focus }
+    }
+    
+    .menubar.edit add command -label "Preferences..." -command [list synth::_menu_edit_preferences]
+}
+
+# }}}
+# {{{  Clean-up                                                 
+
+# ----------------------------------------------------------------------------
+# GUI clean-up.
+#
+# Once all the device-specific scripts have been loaded and initialized, it
+# is time to go through the various components of the GUI and clean up 
+# anything that is not actually required.
+namespace eval synth {
+
+    proc _cleanup_gui { } {
+
+	if { $synth::flag_debug } {
+	    synth::report "Cleaning up unused GUI items.\n"
+	}
+	
+	# File, Edit, View and Help should always have contents, unless
+	# the user has deleted entries via the mainrc file. The Windows
+	# menu will be empty unless contents have been added. There is
+	# always a global binding for ctrl-Q, and the window manager
+	# should always provide a way of killing off the application,
+	# so there is no need to treat File specially.
+	if { 0 == [.menubar.file index end] } {
+	    .menubar delete "File"
+	}
+	if { 0 == [.menubar.edit index end] } {
+	    .menubar delete "Edit"
+	}
+	if { 0 == [.menubar.view index end] } {
+	    .menubar delete "View"
+	}
+	if { 0 == [.menubar.windows index end] } {
+	    .menubar delete "Windows"
+	}
+	if { 0 == [.menubar.help index end] } {
+	    .menubar delete "Help"
+	}
+
+	# If the toolbar is empty get rid of it.
+	if { 0 == [llength [winfo children .toolbar]] } {
+	    pack forget .toolbar
+	    destroy .toolbar
+	}
+	
+	set can_destroy [list]
+	# Remove some or all of the top, left hand, right hand or bottom
+	# sets of frames, if nobody is using them.
+	if { (0 == [llength [pack slaves .main.nw]]) &&
+	     (0 == [llength [pack slaves .main.n]]) &&
+	     (0 == [llength [pack slaves .main.ne]]) } {
+            lappend can_destroy .main.nw .main.border_nw_n .main.n .main.border_n_ne .main.ne
+	    lappend can_destroy .main.border_nw_w .main.border_n_centre .main.border_ne_e
+        }
+	if { (0 == [llength [pack slaves .main.nw]]) &&
+	     (0 == [llength [pack slaves .main.w]]) &&
+	     (0 == [llength [pack slaves .main.sw]]) } {
+            lappend can_destroy .main.nw .main.border_nw_w .main.w .main.border_w_sw .main.sw
+	    lappend can_destroy .main.border_nw_n .main.border_w_centre .main.border_w_sw
+        }
+	if { (0 == [llength [pack slaves .main.ne]]) &&
+	     (0 == [llength [pack slaves .main.e]]) &&
+	     (0 == [llength [pack slaves .main.se]]) } {
+            lappend can_destroy .main.ne .main.border_ne_e .main.e .main.border_e_se .main.se
+	    lappend can_destroy .main.border_n_ne .main.border_centre_e .main.border_s_se
+        }
+	if { (0 == [llength [pack slaves .main.sw]]) &&
+	     (0 == [llength [pack slaves .main.s]]) &&
+	     (0 == [llength [pack slaves .main.se]]) } {
+            lappend can_destroy .main.sw .main.border_sw_s .main.s .main.border_s_se .main.se
+	    lappend can_destroy .main.border_w_sw .main.border_centre_s .main.border_e_se
+        }
+
+ 	foreach frame [lsort -unique $can_destroy] {
+	    grid forget $frame
+	}
+ 	foreach frame [lsort -unique $can_destroy] {
+	    destroy $frame
+	}
+
+	# Now that the full window layout is known the .main frame can be
+	# packed. Doing this before now could cause problems because the
+	# desired sizes of the subwindows are not known.
+	pack .main -expand 1 -fill both
+    }
+}
+
+# }}}
+# {{{  Screen dump support                                      
+
+# Create screen dumps for the main window or for various subwindows.
+# Normally disabled, but useful when generating documentation.
+# FIXME: there seem to be problems getting the desired info about
+# transient windows, e.g. sizes. Hence the generated dumps still
+# require a lot of hand editing for now.
+if { 0 } {
+
+    bind . <Alt-w> {
+	exec xwd -out main.xwd -frame -id [winfo id .]
+    }
+
+    bind . <Alt-f> {
+	.menubar invoke "File"
+	after 100 exec xwd -out menu_file.xwd -frame -id [winfo id .]
+    }
+
+    bind . <Alt-e> {
+	.menubar invoke "Edit"
+	after 100 exec xwd -out menu_edit.xwd -frame -id [winfo id .]
+    }
+
+    bind . <Alt-v> {
+	.menubar invoke "View"
+	after 100 exec xwd -out menu_view.xwd -frame -id [winfo id .]
+    }
+
+    # The Help menu will extend beyond the window boundaries
+    bind . <Alt-h> {
+	.menubar invoke "Help"
+	after 100 exec xwd -out menu_help.xwd -root
+    }
+}
+
+# }}}
+
+# }}}
+}
+
+# {{{  Device instantiation                                     
+
+# ----------------------------------------------------------------------------
+# This code handles the loading of device-specific scripts in response
+# to requests from the eCos application, and the instantiation of devices.
+# The application's request provides four pieces of information, held in
+# null-terminated strings in the request buffer:
+#
+#   package name      e.g. hal/synth/arch
+#   package version   e.g. current
+#   device type       e.g. console or ethernet
+#   device instance   e.g. eth0, or an empty string
+#   device data       e.g. 1024x768 for frame buffer resolution
+#
+# The first two pieces of information can be concatenated to give a
+# path to the install location. The third identifies a suitable
+# tcl script, e.g. console.tcl. This is sufficient to locate and load
+# the tcl script. It should return an instantiation procedure which will
+# be invoked with the instance name (or an empty string if there will only
+# ever be one instance of this device type). The instantiation procedure
+# will then be called with a number and the device instance string, and
+# should return a handler for all requests intended for that device.
+#
+# If the package name and version are empty strings then an application-specific
+# device is being initialized, and the code will search in the current
+# directory and in ~/.ecos/synth
+
+namespace eval synth {
+    # Map package/version/type on to an instantiation procedure
+    array set _instantiation_procs [list]
+
+    # Map device instances on to handlers.
+    array set _device_handlers [list]
+    array set _device_names    [list]
+    variable _next_device_id 1
+
+    # Let scripts know their install location and their source dir
+    variable device_install_dir ""
+    variable device_src_dir     ""
+    
+    # One handler is predefined.
+    set synth::_device_handlers(0)    synth::_handle_ecosynth_requests
+    set synth::_device_names(0)       "ecosynth I/O auxiliary"
+
+    proc _handle_INSTANTIATE { data } {
+
+	set list [split $data \0]
+	if { [llength $list] < 5 } {
+	    synth::send_reply -1 0 ""
+	    return
+	}
+	set package_dir     [lindex $list 0]
+	set package_version [lindex $list 1]
+	set device_type     [lindex $list 2]
+	set device_instance [lindex $list 3]
+	set device_data     [lindex $list 4]
+
+	if { ![info exists synth::_instantiation_procs($package_dir,$package_version,$device_type)] } {
+	    # The required script has not yet been loaded.
+	    if { "" != $package_dir } {
+		# The device is provided by a package
+		set synth::device_install_dir [file join $synth::_ecosynth_libexecdir "ecos" $package_dir $package_version]
+		set synth::device_src_dir     [file join $synth::_ecosynth_repository $package_dir $package_version]
+	    
+		set script [file join $::synth::device_install_dir "[set device_type].tcl"]
+		if { ![file exists $script] } {
+		    synth::report_error "Unable to initialize device $device_type\n    Script \"$script\" not found.\n"
+		    synth::send_reply -1 0 ""
+		    return
+		} elseif { ![file readable $script] } {
+		    synth::report_error "Unable to initialize device $device_type\n    Script \"$script\" not readable.\n"
+		    synth::send_reply -1 0 ""
+		    return
+		}
+
+		# Is there a more recent version in the repository
+		if { [info exists ::env(ECOSYNTH_DEVEL)] } {
+		    set _orig_name [file join $synth::device_src_dir "host" "[set device_type].tcl"]
+		    if { [file exists $_orig_name] && [file readable $_orig_name] } {
+			if { [file mtime $_orig_name] >= [file mtime $script] } {
+			    puts "$_orig_name is more recent than install: executing that."
+			    set script $_orig_name
+			}
+		    }
+		}
+	    } else {
+		# The device is application-specific
+		set script [file join [pwd] "[set device_type].tcl"]
+		if { ![file exists $script] || ![file readable $script] } {
+		    set script [file join "~/.ecos/synth" "[set device_type].tcl"]
+		    if { ![file exists $script] || ![file readable $script] } {
+			synth::report_error "Unable to initialize device $device_type\n    Script $device_type.tcl not found in [pwd] or ~/.ecos/synth\n"
+			synth::send_reply -1 0 ""
+			return
+		    }
+		}
+	    }
+	    
+	    # The uplevel ensures that the device script operates at the global
+	    # level, so any namespaces it creates are also at global level
+	    # and not nested inside synth. This avoids having to add
+	    # synth:: to lots of variable accesses and generally avoids confusion
+	    set result [catch { uplevel #0 source $script } instantiator]
+	    if { 0 != $result } {
+		synth::report_error "Unable to initialize device $device_type\n  Error loading script \"$script\"\n  $instantiator\n"
+		synth::send_reply -1 0 ""
+		return
+	    }
+
+	    set synth::_instantiation_procs($package_dir,$package_version,$device_type) $instantiator
+	}
+
+	set handler [$synth::_instantiation_procs($package_dir,$package_version,$device_type) \
+		$synth::_next_device_id $device_instance $device_data]
+	if { "" == $handler } {
+	    synth::send_reply -1 0 ""
+	} else {
+	    set result $synth::_next_device_id
+	    incr synth::_next_device_id
+	    
+	    set synth::_device_handlers($result) $handler
+	    if { "" != $device_instance } {
+		set synth::_device_names($result) $device_instance
+	    } else {
+		set synth::_device_names($result) $device_type
+	    }
+	    synth::send_reply $result 0 ""
+	}
+    }
+}
+
+# }}}
+# {{{  Interrupt handling                                       
+
+# ----------------------------------------------------------------------------
+# Interrupt handling. Device handlers can request an interrupt number
+# using allocate_interrupt, and typically they will transmit this
+# number to the eCos device driver during initialization. Device handlers
+# can at any time call raise_interrupt with that number, which typically
+# will result in SIGIO being sent to the eCos application. The latter will
+# send a request to retrieve a mask of current pending interrupts.
+#
+# Exit handling, in the sense of the user selecting File->Exit, is also
+# handled here. Such an exit request also involves raising SIGIO and
+# then sending a specially format response to the get-pending request.
+
+namespace eval synth {
+  
+    # The next interrupt number to be allocated. Interrupt source 0 is reserved
+    # for the timer, which is handled within eCos itself via SIGALRM
+    # rather than by the I/O auxiliary.
+    variable _interrupt_next 1
+    
+    # Keep track of which interrupts belong to which devices, for display and
+    # diagnostic purposes.
+    array set _interrupt_names [list]
+    set _interrupt_names(0) "system clock"
+    
+    # A mask of current pending interrupts
+    variable _interrupt_pending 0
+
+    # Is an exit request pending?
+    variable _interrupt_exit_pending 0
+
+    # Allow other code to hook into the interrupt system, e.g. to display
+    # pending interrupts.
+    synth::hook_define "interrupt"
+    
+    # For now interrupts are always allocated dynamically, which effectively
+    # means in the order of C++ static constructors. This means that interrupt
+    # allocation depends on the application, and may even change as the application
+    # is relinked.
+    #
+    # An alternative approach would allow device scripts to request specific
+    # interrupt numbers, making the system a bit more deterministic, but
+    # introducing complications such as shared interrupt numbers. On the other
+    # hand that would make it easier to test chained interrupt support and
+    # the like.
+    # FIXME: add support for allocating specific interrupt numbers
+    proc interrupt_allocate { name } {
+	if { $synth::_interrupt_next == 32 } {
+	    synth::report_error "Unable to allocate an interrupt vector for $name\nAll 32 interrupt vectors are already in use.\n"
+	    return -1
+	}
+	set result $synth::_interrupt_next
+	set synth::_interrupt_names($result) $name
+	incr synth::_interrupt_next
+	return $result
+    }
+
+    # Allow information about the device->interrupt mappings to be retrieved
+    proc interrupt_get_max { } {
+	return [expr $synth::_interrupt_next - 1]
+    }
+    proc interrupt_get_devicename { number } {
+	if { [info exists synth::_interrupt_names($number) ] } {
+	    return $synth::_interrupt_names($number)
+	} else {
+	    return ""
+	}
+    }
+
+    # Raise a specific interrupt. If the interrupt is already pending
+    # this has no effect because a SIGIO will have been sent to the
+    # eCos application already. Otherwise SIGIO needs to be raised.
+    proc interrupt_raise { number } {
+	if { $number >= $synth::_interrupt_next } {
+	    error "Attempt to raise invalid interrupt $number."
+	}
+	if { !$synth::ecos_running } {
+	    return
+	}
+	set or_mask [expr 0x01 << $number]
+	if { 0 == ($or_mask & $synth::_interrupt_pending) } {
+	    # This interrupt was not previously pending, so action is needed.
+	    set synth::_interrupt_pending [expr $synth::_interrupt_pending | $or_mask]
+	    synth::hook_call "interrupt" $number
+	    synth::_send_SIGIO
+	}
+    }
+
+    # Request application exit. This is typically called in response to
+    # File->Exit.
+    proc request_application_exit { } {
+	set synth::_interrupt_exit_pending 1
+	synth::_send_SIGIO
+    }
+    
+    # The eCos application wants to know about pending interrupts. It maintains
+    # its own set of pending interrupts, so once the information has been
+    # transferred there are no pending interrupts left in the I/O auxiliary,
+    # only in the eCos app. A pending exit is indicated by non-empty data,
+    # the actual data does not matter.
+    proc _handle_GET_IRQ_PENDING {  } {
+	if { $synth::_interrupt_exit_pending } {
+	    synth::send_reply $synth::_interrupt_pending 1 "x"
+	} else {
+	    synth::send_reply $synth::_interrupt_pending 0 ""
+	}
+	set synth::_interrupt_pending 0
+    }
+}
+
+# }}}
+# {{{  Initialization complete                                  
+
+# ----------------------------------------------------------------------------
+# This is called once all static constructors have been run, i.e. when all
+# eCos devices should be initialized. It does the following:
+#
+# 1) invoke any "initialized" hooks set up by device scripts.
+#
+# 2) run the per-user mainrc.tcl script, if it exists, so that users can
+#    install hooks, modify the GUI display, etc.
+#
+# 3) warn about any unused command line arguments
+#
+# 4) optionally warn about any unused entries in the target definition file
+#
+# 5) clean up the GUI, e.g. remove unwanted windows and borders, and display it.
+#
+# However if the user specified --help then, instead of all the above,
+# a help message is displayed and the auxiliary exits, hopefully taking the
+# eCos application with it.
+
+namespace eval synth {
+
+    proc _handle_CONSTRUCTORS_DONE { } {
+
+	if { $synth::flag_help } {
+	    puts "Usage : <eCos application> <options>"
+	    puts "    Options are passed to the I/O auxiliary, and are not"
+	    puts "    accessible to the eCos application."
+	    puts "Standard options:"
+	    puts " -io                         : run with I/O facilities."
+	    puts " -nio                        : run with no I/O facilities at all."
+	    puts " -nw, --no-windows           : run in console mode."
+	    puts " -w, --windows               : run in GUI mode (default)."
+	    puts " -v, --version               : display the version of the I/O auxiliary."
+	    puts " -h, --help                  : show this help text."
+	    puts " -k, --keep-going            : ignore errors in init scripts or the"
+	    puts "                               target definition file."
+	    puts " -nr, --no-rc                : do not run the user's init scripts."
+	    puts " -x, --exit                  : terminate I/O auxiliary as soon as the eCos"
+	    puts "                               application exits (default in console mode)."
+	    puts " -nx, --no-exit              : I/O auxiliary keeps running even after eCos"
+	    puts "                               application has exited (default in GUI mode)."
+	    puts " -V, --verbose               : provide additional output during the run."
+	    puts " -l <file>, --logfile <file> : send all output to the specified file. In"
+	    puts "                               GUI mode this in addition to the main text"
+	    puts "                               window. In console mode this is instead of"
+	    puts "                               stdout."
+	    puts " -t <file>, --target <file>  : use the specified .tdf file as the target"
+	    puts "                               definition. The auxiliary will look for this"
+	    puts "                               file in the current directory, ~/.ecos, and"
+	    puts "                               finally the install location."
+	    puts " -geometry <geometry>        : size and position for the main window."
+	    synth::hook_call "help"
+	    exit 1
+	}
+	
+	synth::hook_call "ecos_initialized"
+	
+	# ----------------------------------------------------------------------------
+	if { !$synth::flag_no_rc } {
+	    set _config_file [file join "~/.ecos/synth" "mainrc.tcl"]
+	    if { [file exists $_config_file] } {
+		if { [file readable $_config_file] } {
+		    if { [catch { source $_config_file } msg ] } {
+			set error "Failed to execute user initialization file  \"$_config_file\"\n"
+			append error "  $msg\n"
+			if { $synth::flag_verbose } {
+			    append error "------- backtrace ------------------------------------------\n"
+			    append error $::errorInfo
+			    append error "\n------- backtrace ends -------------------------------------\n"
+			}
+			synth::report_error $error
+		    }
+		} else {
+		    synth::report_error "No read access to user initialization file \"$_config_file\"\n"
+		}
+	    }
+	    unset _config_file
+	}
+	
+	# ----------------------------------------------------------------------------
+	# Report any arguments that have not been used up by the auxiliary itself
+	# or by any device handlers
+	set unconsumed_args [synth::argv_get_unconsumed]
+	foreach arg $unconsumed_args { 
+	    synth::report_warning "Unrecognised command line option \"$arg\", ignored.\n"
+	}
+
+	# ----------------------------------------------------------------------------
+	if { $synth::flag_verbose } {
+	    set unconsumed_devices [synth::tdf_get_unconsumed_devices]
+	    set unconsumed_options [synth::tdf_get_unconsumed_options]
+	    if { (0 != [llength $unconsumed_devices]) || (0 != [llength $unconsumed_options]) } {
+		set msg "Target definition file $synth::target_definition\n"
+		foreach dev $unconsumed_devices {
+		    append msg "    synth_device \"$dev\" not recognised.\n"
+		}
+		foreach option $unconsumed_options {
+		    set dev [lindex $option 0]
+		    set opt [lindex $option 1]
+		    append msg "    synth_device \"$dev\", option \"$opt\" not recognised.\n"
+		}
+		synth::report_warning $msg
+	    }
+	}
+
+	#  ----------------------------------------------------------------------------
+	if { $synth::flag_gui } {
+	    synth::_cleanup_gui
+	    wm deiconify .
+	}
+	
+	# ----------------------------------------------------------------------------
+	# Finally send a reply back to the application so it can really
+	# start running. Alternatively, if any errors occurred during
+	# initialization and the user did not specify --keep-going then
+	# send back an error code, causing the eCos application to terminate.
+	if { (0 == $synth::_error_count) || $synth::flag_keep_going } {
+	    synth::send_reply 1 0 ""
+	} else {
+	    synth::send_reply 0 0 ""
+	}
+    }
+}
+
+# }}}
+# {{{  Requests for the I/O auxiliary itself                    
+
+# ----------------------------------------------------------------------------
+# There are three requests which can be aimed at the I/O auxiliary itself,
+# rather than at device-specific scripts. These are: INSTANTIATE to instantiate
+# a device; CONSTRUCTORS_DONE to indicate when initialization is complete;
+# and GET_IRQ_PENDING which deals with interrupts.
+
+namespace eval synth {
+    
+    proc _handle_ecosynth_requests { devid request arg1 arg2 request_data request_len reply_len } {
+	if { 0x01 == $request } {
+	    synth::_handle_INSTANTIATE $request_data
+	} elseif { 0x02 == $request } {
+	    synth::_handle_CONSTRUCTORS_DONE
+	} elseif { 0x03 == $request } {
+	    synth::_handle_GET_IRQ_PENDING
+	} elseif { 0x04 == $request } {
+	    synth::_handle_GET_VERSION
+	} else {
+	    error "The eCos application has sent an invalid request sent to the I/O auxiliary"
+	}
+    }
+
+    variable _SYNTH_AUXILIARY_PROTOCOL_VERSION	0x01
+    proc _handle_GET_VERSION { } {
+	synth::send_reply $synth::_SYNTH_AUXILIARY_PROTOCOL_VERSION 0 ""
+    }
+}
+
+# }}}
+# {{{  Application exit                                         
+
+# ----------------------------------------------------------------------------
+# The application has exited. This is detected by an EOF event on the pipe
+# from the eCos application.
+#
+# First the rest of the system is informed about the event using the
+# appropriate hook. This should ensure that the various device-specific
+# scripts do the right thing, e.g shut down sub-processes. Next, if
+# the immediate exit flag is set then that is obeyed. This flag is set by
+# default when in command-line mode because there is no point in continuing
+# to run if there is neither an application nor a GUI for the user to interact
+# with. It also gets set if the user has explicitly requested an exit.
+#
+# The exit call will invoke the appropriate hooks.
+namespace eval synth {
+    
+    proc _application_has_exited { } {
+
+	set synth::ecos_running 0
+	synth::hook_call "ecos_exit"
+	
+	# Depending on command-line arguments and whether or not the GUI is present,
+	# the auxiliary should now exit
+	if { $synth::flag_immediate_exit } {
+	    exit 0
+	} elseif { !$synth::flag_gui } {
+	    synth::report "eCos application has exited: I/O auxiliary still running in the background.\n"
+	}
+    }
+}
+
+# }}}
+# {{{  Communication with the eCos application                  
+
+namespace eval synth {
+    
+    # ----------------------------------------------------------------------------
+    # The basic communication routines between the auxiliary and the
+    # eCos application. _read_request is invoked whenever there is
+    # a pending event on the pipe from the eCos application, either
+    # a request or an EOF. It 
+
+    # Keep track of a couple of things to detect protocol mismatches.
+    variable _reply_expected 0
+    variable _expected_rxlen 0
+    
+    # Receive a single request from the eCos application and invoke the
+    # appropriate handler.
+    proc _read_request { } {
+	# Read a single request from the application, or possibly EOF
+	set devid   0
+	set reqcode 0
+	set arg1    0
+	set arg2    0
+	set txlen   0
+	set txdata  ""
+	set rxlen   0
+	set request [read $synth::_channel_from_app 24]
+	
+	if { [eof $synth::_channel_from_app] } {
+	    fileevent $synth::_channel_from_app readable ""
+	    synth::_application_has_exited
+	    return
+	}
+
+	# If a real request is sent then currently the application should
+	# not be expecting a reply
+	if { $synth::_reply_expected } {
+	    error "The eCos application should not be sending a request when there is still a reply pending"
+	}
+
+	set binary_result [binary scan $request "iiiiii" devid reqcode arg1 arg2 txlen rxlen]
+	if { 6 != $binary_result } {
+	    error "Internal error decoding request from eCos application"
+	}
+
+	# If running on a 64-bit platform then the above numbers will have been sign-extended,
+	# which could lead to confusing results
+	set devid   [expr $devid   & 0x0FFFFFFFF]
+	set reqcode [expr $reqcode & 0x0FFFFFFFF]
+	set arg1    [expr $arg1    & 0x0FFFFFFFF]
+	set arg2    [expr $arg2    & 0x0FFFFFFFF]
+	set txlen   [expr $txlen   & 0x0FFFFFFFF]
+	set rxlen   [expr $rxlen   & 0x0FFFFFFFF]
+
+	# The top bit of rxlen is special and indicates whether or not a reply is expected.
+	set synth::_reply_expected [expr 0 != ($rxlen & 0x080000000)]
+	set synth::_expected_rxlen [expr $rxlen & 0x07FFFFFFF]
+	
+	# Is there additional data to be read
+	if { $txlen > 0 } {
+	    set txdata [read $synth::_channel_from_app $txlen]
+	    if { [eof $synth::_channel_from_app] } {
+		fileevent $synth::_channel_from_app readable ""
+		synth::_application_has_exited
+		return
+	    }
+	}
+
+	# The devid can be used to get hold of a handler function, and that will do
+	# the hard work.
+	if { ![info exists synth::_device_handlers($devid)] } {
+	    error "A request has been received for an unknown device $devid"
+	}
+
+	$synth::_device_handlers($devid) $devid $reqcode $arg1 $arg2 $txdata $txlen $synth::_expected_rxlen
+    }
+    
+    # Register _read_request as the handler for file events on the pipe from
+    # the application.
+    fileevent $synth::_channel_from_app readable synth::_read_request
+    
+    # Send a reply back to eCos. This consists of a two-word structure,
+    # result and length, followed by the data if any. Currently this
+    # raises an error if there is a mismatch between the specified and
+    # actual length of the data. Possibly the code should cope with
+    # data strings that exceed the specified length, extracting a
+    # suitable substring.
+    proc send_reply { result { length 0 } { data "" } } {
+	# Make sure that a reply is actually expected.
+	if { !$synth::_reply_expected } {
+	    error "Attempt to send reply to application when no request has been sent"
+	} else {
+	    set synth::_reply_expected 0
+	}
+	
+	if { $length > $synth::_expected_rxlen } {
+	    error "Reply contains more data than the application expects: $length bytes instead of $synth::_expected_rxlen"
+	}
+	if { ($length > 0) && ([string length $data] != $length) } {
+	    error "Mismatch between specified and actual data length: $length [string length $data]"
+	}
+	if { !$synth::ecos_running } {
+	    return
+	}
+	
+	set struct [binary format "ii" $result $length]
+	# Ignore any errors when writing down the pipe. The only likely error is
+	# when the application has exited, causing a SIGPIPE which Tcl
+        # will handle. The application should be waiting for this response.
+	catch {
+	    puts -nonewline $synth::_channel_to_app $struct
+	    if { $length > 0 } {
+		puts -nonewline $synth::_channel_to_app $data
+	    }
+	} 
+    }
+}
+
+# }}}
+
+# {{{  initrc                                                   
+
+# ----------------------------------------------------------------------------
+# Just before control is returned to the eCos application, run the per-user
+# file, ~/.ecos/synth/initrc.tcl. The main GUI is now in place and the target
+# definition file has been read in,  but no eCos static constructors have
+# been run yet and hence no devices have been loaded or activated.
+# All the various core procedures have been defined. initrc gives the user
+# a chance to install hooks, redefine some internals, and so on.
+# Another initialization file mainrc.tcl gets read in later, just before
+# the eCos application really starts running.
+#
+# Possibly ecosynth should also read in a system-wide initialization
+# file equivalent to emacs' site-start.el, but the extra complexity
+# does not seem warranted just yet.
+
+if { !$synth::flag_no_rc } {
+    set _config_file [file join "~/.ecos/synth" "initrc.tcl"]
+    if { [file exists $_config_file] } {
+	if { [file readable $_config_file] } {
+	    if { [catch { source $_config_file } msg ] } {
+		set error "Failed to execute user initialization file  \"$_config_file\"\n"
+		append error "  $msg\n"
+		if { $synth::flag_verbose } {
+		    append error "------- backtrace ------------------------------------------\n"
+		    append error $::errorInfo
+		    append error "\n------- backtrace ends -------------------------------------\n"
+		}
+		synth::report_error $error
+	    }
+	} else {
+	    synth::report_error "No read access to user initialization file \"$_config_file\"\n"
+	}
+    }
+    unset _config_file
+}
+
+# }}}
+# {{{  Done      						
+
+# ----------------------------------------------------------------------------
+# The last few steps.
+
+# Once everything has been initialized the application can be woken up again.
+# It should be blocked waiting for a single byte on the pipe.
+if { $synth::flag_debug } {
+    synth::report "Core initialization complete, resuming the eCos application.\n"
+}
+
+puts -nonewline $synth::_channel_to_app  "."
+
+# Enter the event loop. In console mode there is a problem if -nx has been
+# specified: there may not be any event handlers left once the eCos application
+# has exited, so the vwait would abort. This is avoided by a dummy after proc.
+if { !$synth::flag_gui && !$synth::flag_immediate_exit } {
+    namespace eval synth {
+	proc _dummy_after_handler { } {
+	    after 1000000 synth::_dummy_after_handler
+	}
+    }
+    after 1000000 synth::_dummy_after_handler
+}
+
+vwait synth::_ecosynth_exit
+
+# }}}
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/help.xbm
@@ -0,0 +1,6 @@
+#define help_width 16
+#define help_height 15
+static unsigned char help_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0x30, 0x06, 0x30, 0x06,
+   0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01,
+   0x80, 0x01, 0x00, 0x00, 0x00, 0x00};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/paste.xbm
@@ -0,0 +1,6 @@
+#define paste_width 16
+#define paste_height 15
+static unsigned char paste_bits[] = {
+   0x00, 0x00, 0xe0, 0x01, 0x3e, 0x3f, 0xd1, 0x22, 0x09, 0x24, 0xf9, 0x27,
+   0x01, 0x20, 0xc1, 0x3f, 0x41, 0x20, 0x41, 0x50, 0x41, 0x77, 0x41, 0x40,
+   0x41, 0x4e, 0x7e, 0x40, 0xc0, 0x7f};
new file mode 100644
index 0000000000000000000000000000000000000000..dc461b0350e991932690eec86a8fe5ead8d00e1f
GIT binary patch
literal 1981
zc$~eI+YNvq3;_LR3LOC>OyB_Szl0-H6C!Eo!?Xk%J|vC3_CT*3j=07g_LKsAu^8ih
z<vusx0u)wmC%V!d+<tVS<7$eBCflHKRyR!1KtkfOMWmFHts^uzyp>o@W$PBB>6rML
zI;3q#jVWi%>HI;nAjJu*ZYbJu)>OVvxYDYEhAG!faz5eXV(U-)rC5VSm=-(W1hnLK
HG`c_^fXf89
new file mode 100644
index 0000000000000000000000000000000000000000..38ccc9fac1a9cc15057cca74d19018fd9d58cc2d
GIT binary patch
literal 1981
zc$~%5!3}^Q3<XfnOraxa#0eb0{g-frYGNc!+g}ADHXbC6Jou>F66UcVmoUW`=&pSo
zvaa)yuC$0%u3Jeby}+%fFP+ck<RH3&=3TT$(M<}eLasRpYB}As1;Ozlvc$}}Lr&{$
z@_U`3UItp2bJkXz53~t6nV8XiN;^7%v)18j@g<Fx>d@5WHA9&<__)mZoBdLL`H`0C
Ll{CusYx+VDfm4Qk
new file mode 100644
index 0000000000000000000000000000000000000000..32a02b28b1255f00722684a751eb388c57312d96
GIT binary patch
literal 1981
zc$~$Q(G7qg3`G5A3LOC>OyB_Szl0;G35jWF?}9aG!;fCLSFY%m!xG1s!<<q$eyx3-
z-0RvtJg@g$H@eWJ3CRJe1ua!{#!9_?_!Nk0P7raWT1+ZK$D{5<a&;S3;QE-RxmL}+
zCR)DX(Y2sa+bC^~M%>=$7As%i=&FBn%{aQ>$3;|Rf?_wj;=dHq6&i8l(yYcpXY7qO
H2k~W{(>$hY
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/save.xbm
@@ -0,0 +1,6 @@
+#define save_width 16
+#define save_height 15
+static unsigned char save_bits[] = {
+  0x00, 0x00, 0xfe, 0xff, 0x0a, 0xa0, 0x0a, 0xe0, 0x0a, 0xa0, 0x0a, 0xa0,
+  0x0a, 0xa0, 0x0a, 0xa0, 0xf2, 0x9f, 0x02, 0x80, 0xf2, 0x9f, 0xf2, 0x93,
+  0xf2, 0x93, 0xf2, 0x93, 0xfc, 0xff, };
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/saveall.xbm
@@ -0,0 +1,6 @@
+#define saveall_width 16
+#define saveall_height 15
+static unsigned char saveall_bits[] = {
+  0x00, 0x00, 0xfe, 0xff, 0x0a, 0xa0, 0x4a, 0xea, 0xaa, 0xaa, 0xea, 0xaa,
+  0xaa, 0xaa, 0x0a, 0xa0, 0xf2, 0x9f, 0x02, 0x80, 0xf2, 0x9f, 0xf2, 0x93,
+  0xf2, 0x93, 0xf2, 0x93, 0xfc, 0xff, };
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/tick_no.xbm
@@ -0,0 +1,5 @@
+#define tick_no_width 11
+#define tick_no_height 11
+static unsigned char tick_no_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x8c, 0x01, 0xd8, 0x00, 0x70, 0x00,
+   0xd8, 0x00, 0x8c, 0x01, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/tick_yes.xbm
@@ -0,0 +1,5 @@
+#define tick_yes_width 11
+#define tick_yes_height 11
+static unsigned char tick_yes_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0xc4, 0x01, 0xec, 0x00,
+   0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/user_initrc.tcl
@@ -0,0 +1,9 @@
+# ~/.ecos/synth/initrc.tcl
+#
+# This configuration file is executed by ecosynth, the eCos synthetic
+# target auxiliary program, early on during initialization. Typically
+# this file is used to set up search paths and similar variables. The
+# eCos synthetic target documentation should be consulted for more
+# information.
+#
+# This file is executed in a Tcl interpreter, so Tcl syntax applies. 
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/host/user_mainrc.tcl
@@ -0,0 +1,10 @@
+# ~/.ecos/synth/mainrc.tcl
+#
+# This configuration file is executed by ecosynth, the eCos synthetic
+# target auxiliary program, just before the application is allowed
+# to continue. The target definition file has been processed and the
+# GUI has been set up, although usually the event loop will not have
+# been entered and no windows will have been displayed yet.
+#
+# This file is executed in a Tcl interpreter, so Tcl syntax applies. 
+
--- a/packages/hal/synth/arch/current/include/hal_io.h
+++ b/packages/hal/synth/arch/current/include/hal_io.h
@@ -11,6 +11,7 @@
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under
@@ -199,17 +200,33 @@ typedef volatile CYG_ADDRWORD HAL_IO_REG
 #define CYG_HAL_SYS_SIGINT               2
 #define CYG_HAL_SYS_SIGQUIT              3
 #define CYG_HAL_SYS_SIGILL               4
+#define CYG_HAL_SYS_SIGTRAP              5
+#define CYG_HAL_SYS_SIGABRT              6
 #define CYG_HAL_SYS_SIGBUS               7
 #define CYG_HAL_SYS_SIGFPE               8
+#define CYG_HAL_SYS_SIGKILL              9
+#define CYG_HAL_SYS_SIGUSR1             10
 #define CYG_HAL_SYS_SIGSEGV             11
+#define CYG_HAL_SYS_SIGUSR2             12
 #define CYG_HAL_SYS_SIGPIPE             13
 #define CYG_HAL_SYS_SIGALRM             14
 #define CYG_HAL_SYS_SIGTERM             15
+#define CYG_HAL_SYS_SIGSTKFLT           16
 #define CYG_HAL_SYS_SIGCHLD             17
 #define CYG_HAL_SYS_SIGCONT             18
 #define CYG_HAL_SYS_SIGSTOP             19
 #define CYG_HAL_SYS_SIGTSTP             20
+#define CYG_HAL_SYS_SIGTTIN             21
+#define CYG_HAL_SYS_SIGTTOU             22
+#define CYG_HAL_SYS_SIGURG              23
+#define CYG_HAL_SYS_SIGXCPU             24
+#define CYG_HAL_SYS_SIGXFSZ             25
+#define CYG_HAL_SYS_SIGVTALRM           26
+#define CYG_HAL_SYS_SIGPROF             27
+#define CYG_HAL_SYS_SIGWINCH            28
 #define CYG_HAL_SYS_SIGIO               29
+#define CYG_HAL_SYS_SIGPWR              30
+#define CYG_HAL_SYS_SIGSYS              31
 
 #define CYG_HAL_SYS_SA_NOCLDSTOP        0x00000001
 #define CYG_HAL_SYS_SA_NOCLDWAIT        0x00000002
@@ -317,6 +334,13 @@ struct cyg_hal_sys_itimerval {
     struct cyg_hal_sys_timeval  hal_it_value;
 };
 
+// System calls and related constants, or rather the subset that is
+// needed internally.
+#define CYG_HAL_SYS_R_OK    0x04
+#define CYG_HAL_SYS_W_OK    0x02
+#define CYG_HAL_SYS_X_OK    0x01
+#define CYG_HAL_SYS_F_OK    0x00
+
 /* lseek whence flags */
 #define CYG_HAL_SYS_SEEK_SET        0       /* Seek from beginning of file.  */
 #define CYG_HAL_SYS_SEEK_CUR        1       /* Seek from current position.  */
@@ -399,6 +423,13 @@ externC int             cyg_hal_sys_seti
 externC int             cyg_hal_sys_gettimeofday(struct cyg_hal_sys_timeval*,
                                                  struct cyg_hal_sys_timezone*);
 
+externC int             cyg_hal_sys_access(const char*, int);
+externC int             cyg_hal_sys_fork(void);
+externC int             cyg_hal_sys_execve(const char*, const char* [], const char* []);
+externC int             cyg_hal_sys_pipe(int []);
+externC int             cyg_hal_sys_close(int);
+externC int             cyg_hal_sys_dup2(int, int);
+ 
 // The actual implementation appears to return the new brk() value.
 externC void*           cyg_hal_sys_brk(void*);
 
@@ -416,8 +447,35 @@ extern const char**     cyg_hal_sys_envi
 
 // ----------------------------------------------------------------------------
 // Interaction between the application and the auxiliary.
-// Not yet available, but there is a hardware-initialization routine.
-externC void hal_synthetic_target_init(void);
+
+// Is the  auxiliary actually in use/available? This flag should be tested by
+// device drivers prior to attempting any communication with the auxiliary.
+extern cyg_bool synth_auxiliary_running;
+ 
+// The fundamental I/O operation: sending a request to the auxiliary and
+// optionally getting back a reply. A null pointer for the response field
+// indicates that no reply is expected. 
+externC void synth_auxiliary_xchgmsg(int /* devid */, int /* request */,
+                                     int /* arg1  */, int /* arg2 */,
+                                     const unsigned char* /* txdata */, int /* txlen */,
+                                     int* /* response */,
+                                     unsigned char* /* rxdata */,  int* /* actual_rxlen */,
+                                     int /* rxlen */);
+
+// Request that the auxiliary instantiates a given device, loading appropriate
+// support code as required. This function takes the following arguments:
+// 1) the location of the package that should provide this device, e.g.
+//    devs/eth/synth
+// 2) the version of that package currently being used, e.g. "current"
+// 3) the name of the device, e.g. "ethernet". This identifies the
+//    Tcl script that should be loaded to handle requests for this device.
+// 4) the name of the device instance, e.g. "eth0".
+// 5) device-specific initialization data. 
+externC int  synth_auxiliary_instantiate(const char*, const char*, const char*, const char*, const char*);
+
+// Support for generating strings
+#define SYNTH_MAKESTRING1(a) #a
+#define SYNTH_MAKESTRING(a)  SYNTH_MAKESTRING1(a)
  
 //-----------------------------------------------------------------------------
 #endif // ifndef CYGONCE_HAL_HAL_IO_H
--- a/packages/hal/synth/arch/current/src/synth_diag.c
+++ b/packages/hal/synth/arch/current/src/synth_diag.c
@@ -8,6 +8,7 @@
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under
@@ -65,17 +66,25 @@
 #include <cyg/infra/cyg_ass.h>
 
 //-----------------------------------------------------------------------------
-
-// When the auxiliary exists, hal_diag_init() will need to contact it and
-// get hold of a suitable console device.
+// If the auxiliary exists, hal_diag_init() will try to contact it and
+// instantiate a console device. Subsequent console writes will be
+// redirected to that device, as long as the auxiliary is up and running.
+// If the auxiliary is not being used or has exited, console writes
+// will instead go to stdout.
 //
-// When interacting with stdin/stdout, arguably there should be some
-// manipulation of tty settings e.g. to support single character
-// input. However it is not clear which settings would be preferable
-// to the default.
+// This code also contains an implementation of hal_diag_read_char()
+// which is probably not very useful. Currently it works by reading
+// from stdin, but no attempt is made to set the tty into raw mode
+// or anything like that. 
+
+static int auxiliary_console_id = -1;
 
 void hal_diag_init( void )
 {
+    if (synth_auxiliary_running) {
+        auxiliary_console_id = synth_auxiliary_instantiate("hal/synth/arch", SYNTH_MAKESTRING(CYGPKG_HAL_SYNTH), "console",
+                                                      (const char*) 0, (const char*) 0);
+    }
 }
 
 // Output a single character.
@@ -86,39 +95,53 @@ void hal_diag_init( void )
 // I/O intensive facilities like unbuffered tracing). Therefore
 // this code will buffer lines up to 128 characters before
 // doing the I/O.
+//
+// NOTE: one problem is that there is no support for flushing buffers
+// at this level. Therefore if say C library stdio ends up mapped to
+// HAL diagnostics I/O then functions like fflush() and setvbuf() will
+// not behave the way they should. There is no simple workaround at
+// this level, the required information is not available.
 
 void hal_diag_write_char(char c)
 {
     static int  diag_index = 0;
-    static char diag_buffer[128];
+    static unsigned char diag_buffer[128];
 
     CYG_ASSERT(diag_index < 128, "Diagnostic buffer overflow");
     
-    diag_buffer[diag_index++] = c;
+    diag_buffer[diag_index++] = (unsigned char) c;
     if (('\n' == c) || (128 == diag_index)) {
-        int     written;
-        char*   next    = diag_buffer;
+        if ((-1 != auxiliary_console_id) && synth_auxiliary_running) {
+            synth_auxiliary_xchgmsg(auxiliary_console_id, 0, 0, 0, diag_buffer, diag_index, (int *) 0, (unsigned char*) 0, (int *)0, 0);
+            diag_index = 0;
+        } else {
+            int     written;
+            char*   next    = diag_buffer;
 
-        while (diag_index > 0) {
-            written = cyg_hal_sys_write(1, next, diag_index);
-            if (written > 0) {
-                diag_index -= written;
-                next       += written;
-            } else if ((-CYG_HAL_SYS_EINTR != written) && (-CYG_HAL_SYS_EAGAIN != written)) {
-                CYG_FAIL("Unexpected error writing to stdout.");
-                diag_index = 0;
-                break;
+            while (diag_index > 0) {
+                written = cyg_hal_sys_write(1, next, diag_index);
+                if (written > 0) {
+                    diag_index -= written;
+                    next       += written;
+                } else if ((-CYG_HAL_SYS_EINTR != written) && (-CYG_HAL_SYS_EAGAIN != written)) {
+                    CYG_FAIL("Unexpected error writing to stdout.");
+                    diag_index = 0;
+                    break;
+                }
             }
+            CYG_ASSERT(0 == diag_index, "All data should have been written out");
+            diag_index = 0;
+            cyg_hal_sys_fdatasync(1);
         }
-        CYG_ASSERT(0 == diag_index, "All data should have been written out");
-        diag_index = 0;
-        cyg_hal_sys_fdatasync(1);
     }
 }
 
-// Diagnostic input. It is not clear that this is actually useful. The
-// read syscall will get woken up by the itimer alarm, but we don't
-// want to stop reading if that's the case
+// Diagnostic input. It is not clear that this is actually useful,
+// input would normally go to gdb rather than to the application. If
+// keyboard input really is required then that should be handled via a
+// suitable device driver interacting with the auxiliary, not at the
+// HAL level. The read syscall will get woken up by the itimer alarm,
+// but we don't want to stop reading if that's the case
 
 void hal_diag_read_char(char *c)
 {
--- a/packages/hal/synth/arch/current/src/synth_entry.c
+++ b/packages/hal/synth/arch/current/src/synth_entry.c
@@ -8,6 +8,7 @@
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under
@@ -99,6 +100,8 @@ cyg_hal_invoke_constructors (void)
 // startup.
 
 externC void    cyg_start( void );
+externC void    synth_hardware_init(void);
+externC void    synth_hardware_init2(void);
 
 void _linux_entry( void )
 {
@@ -135,9 +138,9 @@ void _linux_entry( void )
     // "Initialize any global pointer register". There is no such register.
 
     // Perform platform-specific initialization. Actually, all Linux
-    // platforms can share this. It involves setting up signal handlers
-    // and so on.
-    hal_synthetic_target_init();
+    // platforms can share this. It involves setting up signal handlers,
+    // starting the I/O auxiliary, and so on.
+    synth_hardware_init();
 
     // This is not a ROM startup, so no need to worry about copying the
     // .data section.
@@ -149,6 +152,14 @@ void _linux_entry( void )
     // Invoke the C++ constructors.
     cyg_hal_invoke_constructors();
 
+    // Once the C++ constructors have been invoked, a second stage
+    // of hardware initialization is desirable. At this point all
+    // eCos device drivers should have been initialized so the
+    // I/O auxiliary will have loaded the appropriate support
+    // scripts, and the auxiliary can now map the window(s) on to
+    // the display and generally operate normally.
+    synth_hardware_init2();
+    
     // "Call cyg_start()". OK.
     cyg_start();
 
--- a/packages/hal/synth/arch/current/src/synth_intr.c
+++ b/packages/hal/synth/arch/current/src/synth_intr.c
@@ -8,6 +8,7 @@
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under
@@ -50,32 +51,34 @@
 // sigprocmask handling.
 //
 // In the synthetic target interrupts and exceptions are based around
-// POSIX sighandlerals. When the clock ticks a SIGALRM signal is raised.
+// POSIX sighandlers. When the clock ticks a SIGALRM signal is raised.
 // When the I/O auxiliary wants to raise some other interrupt, it
 // sends a SIGIO signal. When an exception occurs this results in
 // signals like SIGILL and SIGSEGV. This implies an implementation
-// where the VSR is the signal handler. Disabling interrupts then
-// means using sigprocmask() to block certain signals, and enabling
-// interrupts means unblocking those signals.
+// where the VSR is the signal handler. Disabling interrupts would
+// then mean using sigprocmask() to block certain signals, and
+// enabling interrupts means unblocking those signals.
 //
 // However there are a few problems. One of these is performance: some
 // bits of the system such as buffered tracing make very extensive use
 // of enabling and disabling interrupts, so making a sigprocmask
 // system call each time adds a lot of overhead. More seriously, there
 // is a subtle discrepancy between POSIX signal handling and hardware
-// interrupts. It is expected that signal handlers return, and then
-// the system automatically passes control back to the foreground thread.
+// interrupts. Signal handlers are expected to return, and then the
+// system automatically passes control back to the foreground thread.
 // In the process, the sigprocmask is manipulated before invoking the
 // signal handler and restored afterwards. Interrupt handlers are
 // different: it is quite likely that an interrupt results in another
-// eCos thread being activated, so the signal handler does not actually
-// return until the interrupted thread gets another chance to run.
+// eCos thread being activated, so the signal handler does not
+// actually return until the interrupted thread gets another chance to
+// run. 
 //
-// The second problem can be addressed by making the sigprocmask part of
-// the thread state, saving and restoring it as part of a context switch.
-// This matches quite nicely onto typical real hardware, where there might
-// be a flag inside some control register that controls whether or not
-// interrupts are enabled. However this adds further to the overhead.
+// The second problem can be addressed by making the sigprocmask part
+// of the thread state, saving and restoring it as part of a context
+// switch (c.f. siglongjmp()). This matches quite nicely onto typical
+// real hardware, where there might be a flag inside some control
+// register that controls whether or not interrupts are enabled.
+// However this adds more system calls to context switch overhead.
 //
 // The alternative approach is to implement interrupt enabling and
 // disabling in software. The sigprocmask is manipulated only once,
@@ -93,14 +96,14 @@
 // interrupts. This is not currently implemented.
 //
 // At first glance it might seem that an interrupt stack could be
-// implemented trivially using sigaltstack. This does not quite work.
-// The problem is that signal handlers do not always return
-// immediately, so the system does not get a chance to clean up the
-// signal handling stack. A separate interrupt stack is possible but
-// would have to be implemented here, in software, e.g. by having the
-// signal handler invoke the VSR on that stack. Unfortunately the
-// system may have pushed quite a lot of state on to the current stack
-// already when raising the signal, so things could get messy.
+// implemented trivially using sigaltstack. This does not quite work:
+// signal handlers do not always return immediately, so the system
+// does not get a chance to clean up the signal handling stack. A
+// separate interrupt stack is possible but would have to be
+// implemented here, in software, e.g. by having the signal handler
+// invoke the VSR on that stack. Unfortunately the system may have
+// pushed quite a lot of state on to the current stack already when
+// raising the signal, so things could get messy.
 
 // ----------------------------------------------------------------------------
 #include <pkgconf/hal.h>
@@ -114,11 +117,14 @@
 #endif
 
 #include <cyg/infra/cyg_type.h>         // base types
+#include <cyg/infra/diag.h>
 #include <cyg/hal/hal_arch.h>
 #include <cyg/hal/hal_intr.h>
 #include <cyg/hal/hal_io.h>
 #include <cyg/infra/cyg_ass.h>          // Assertions are safe in the synthetic target
 
+#include "synth_protocol.h"
+
 // ----------------------------------------------------------------------------
 // Statics.
 
@@ -138,10 +144,10 @@ static volatile cyg_bool_t  synth_sigalr
 static void (*synth_VSR)(void)                          = (void (*)(void)) 0;
 
 // The current ISR status and mask registers, or rather software
-// emulations there of. These are not static since
-// application-specific VSRs may want to examine/manipulate these.
-// They are also not exported in any header file, forcing people
-// writing such VSRs to know what they are doing.
+// emulations thereof. These are not static since application-specific
+// VSRs may want to examine/manipulate these. They are also not
+// exported in any header file, forcing people writing such VSRs to
+// know what they are doing.
 volatile cyg_uint32 synth_pending_isrs      = 0;
 volatile cyg_uint32 synth_masked_isrs       = 0xFFFFFFFF;
 
@@ -171,12 +177,18 @@ synth_default_isr(cyg_vector_t vector, c
     return CYG_ISR_HANDLED;
 }
 
-// The VSR is invoked under the following circumstances:
+// The VSR is invoked
+//  1) directly by a SIGALRM or SIGIO signal handler, if interrupts
+//     were enabled.
+//  2) indirectly by hal_enable_interrupts(), if a signal happened
+//     while interrupts were disabled. hal_enable_interrupts()
+//     will have re-invoked the signal handler.
 //
-//  1) interrupts were globally enabled, but are now disabled.
-//  2) there are pending ISRs which are not masked off
+// On entry interrupts are disabled, and there should be one or more
+// pending ISRs which are not masked off.
 //
-// The implementation is as per the HAL specification, where applicable.
+// The implementation is as per the HAL specification, where
+// applicable.
 
 static void
 synth_default_vsr(void)
@@ -192,8 +204,8 @@ synth_default_vsr(void)
     // synchronously via enable_interrupts.
 
     // Increment the kernel scheduler lock, if the kernel is present.
-    // This prevents any attempts at context switching while interrupt
-    // handling is in progress.
+    // This prevents context switching while interrupt handling is in
+    // progress.
 #ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
     cyg_scheduler_lock();
 #endif
@@ -207,17 +219,20 @@ synth_default_vsr(void)
     // Decode the actual external interrupt being delivered. This is
     // determined from the pending and masked variables. Only one isr
     // source can be handled here, since interrupt_end must be invoked
-    // with details of that interrupt.
+    // with details of that interrupt. Multiple pending interrupts
+    // will be handled by a recursive call 
     HAL_LSBIT_INDEX(isr_vector, (synth_pending_isrs & ~synth_masked_isrs));
     CYG_ASSERT((CYGNUM_HAL_ISR_MIN <= isr_vector) && (isr_vector <= CYGNUM_HAL_ISR_MAX), "ISR vector must be valid");
-    
+
     isr_result = (*synth_isr_handlers[isr_vector].isr)(isr_vector, synth_isr_handlers[isr_vector].data);
 
     // Do not switch back from the interrupt stack, there isn't one.
     
     // Interrupts were not enabled before, so they must be enabled
     // now. This may result in a recursive invocation if other IRQs
-    // are still pending.
+    // are still pending. The ISR should have either acknowledged or
+    // masked the current interrupt source, to prevent a recursive
+    // call for the current interrupt.
     hal_enable_interrupts();
 
     // Now call interrupt_end() with the result of the isr and the
@@ -225,7 +240,7 @@ synth_default_vsr(void)
     // a context switch to another thread. In the latter case, when
     // the current thread is reactivated we end up back here. The
     // third argument should be a pointer to the saved state, but that
-    // is only relevant for thread-aware debugging which is not
+    // is only relevant for thread-aware debugging which is not yet
     // supported by the synthetic target.
     {
         extern void interrupt_end(cyg_uint32, CYG_ADDRESS, HAL_SavedRegisters*);
@@ -238,7 +253,7 @@ synth_default_vsr(void)
 
 // Enabling interrupts. If a SIGALRM or SIGIO arrived at an inconvenient
 // time, e.g. when already interacting with the auxiliary, then these
-// will have been left pending and must be servied now. Next, enabling
+// will have been left pending and must be serviced now. Next, enabling
 // interrupts means checking the interrupt pending and mask registers
 // and seeing if the VSR should be invoked.
 void
@@ -262,7 +277,7 @@ hal_enable_interrupts(void)
     // is to raise a signal, e.g. SIGUSR1. That way all interrupts
     // come in via the system's signal handling mechanism, and
     // it might be possible to do something useful with saved contexts
-    // etc.
+    // etc., facilitating thread-aware debugging.
     if (0 != (synth_pending_isrs & ~synth_masked_isrs)) {
         hal_interrupts_enabled = false;
         (*synth_VSR)();
@@ -457,11 +472,12 @@ synth_exception_sighandler(int sig)
 // handler for CYGNUM_HAL_INTERRUPT_RTC, but it depends on the HAL
 // for low-level manipulation of the clock hardware.
 //
-// There is a problem with HAL_CLOCK_READ(). The obvious implementation
-// would use getitimer(), but that has the wrong behaviour: it is intended
-// for fairly coarse intervals and works in terms of system clock ticks,
-// as opposed to a fine-grained implementation that actually examines the
-// system clock. Instead it is necessary to use gettimeofday(). 
+// There is a problem with HAL_CLOCK_READ(). The obvious
+// implementation would use getitimer(), but that has the wrong
+// behaviour: it is intended for fairly coarse intervals and works in
+// terms of system clock ticks, as opposed to a fine-grained
+// implementation that actually examines the system clock. Instead use
+// gettimeofday().
 
 static struct cyg_hal_sys_timeval synth_clock   = { 0, 0 };
 
@@ -470,7 +486,8 @@ hal_clock_initialize(cyg_uint32 period)
 {
     struct cyg_hal_sys_itimerval    timer;
 
-    // Needed for hal_clock_read()
+    // Needed for hal_clock_read(), if HAL_CLOCK_READ() is used before
+    // the first clock interrupt.
     cyg_hal_sys_gettimeofday(&synth_clock, (struct cyg_hal_sys_timezone*) 0);
     
     // The synthetic target clock resolution is in microseconds. A typical
@@ -508,7 +525,8 @@ synth_alrm_sighandler(int sig)
     // A timer signal means that IRQ 0 needs attention.
     synth_pending_isrs |= 0x01;
 
-    // If any of the pending interrupts are not masked, invoke the VSR
+    // If any of the pending interrupts are not masked, invoke the
+    // VSR. That will reenable interrupts.
     if (0 != (synth_pending_isrs & ~synth_masked_isrs)) {
         (*synth_VSR)();
     } else {
@@ -548,6 +566,22 @@ hal_clock_read(void)
 // there may already be ongoing communication with the auxiliary.
 // Instead some volatile flags are used to keep track of which signals
 // were raised while interrupts were disabled. 
+//
+// It might be better to perform the interaction with the auxiliary
+// as soon as possible, i.e. either in the SIGIO handler or when the
+// current communication completes. That way the mask of pending
+// interrupts would remain up to date even when interrupts are
+// disabled, thus allowing applications to run in polled mode.
+
+// A little utility called when the auxiliary has been asked to exit,
+// implicitly affecting this application as well. The sole purpose
+// of this function is to put a suitably-named function on the stack
+// to make it more obvious from inside gdb what is happening.
+static void
+synth_io_handle_shutdown_request_from_auxiliary(void)
+{
+    cyg_hal_sys_exit(0);
+}
 
 static void
 synth_io_sighandler(int sig)
@@ -564,7 +598,28 @@ synth_io_sighandler(int sig)
 
     // Update the interrupt status "register" to match pending interrupts
     // Contact the auxiliary to find out what interrupts are currently pending there.
-    CYG_FAIL("SIGIO should not occur until the auxiliary is implemented");
+    // If there is no auxiliary at present, e.g. because it has just terminated
+    // and things are generally somewhat messy, ignore it.
+    //
+    // This code also deals with the case where the user has requested program
+    // termination. It would be wrong for the auxiliary to just exit, since the
+    // application could not distinguish that case from a crash. Instead the
+    // auxiliary can optionally return an additional byte of data, and if that
+    // byte actually gets sent then that indicates pending termination.
+    if (synth_auxiliary_running) {
+        int             result;
+        int             actual_len;
+        unsigned char   dummy[1];
+        synth_auxiliary_xchgmsg(SYNTH_DEV_AUXILIARY, SYNTH_AUXREQ_GET_IRQPENDING, 0, 0,
+                                (const unsigned char*) 0, 0,        // The auxiliary does not need any additional data
+                                &result, dummy, &actual_len, 1);
+        synth_pending_isrs |= result;
+        if (actual_len) {
+            // The auxiliary has been asked to terminate by the user. This
+            // request has now been passed on to the eCos application.
+            synth_io_handle_shutdown_request_from_auxiliary();
+        }
+    }
 
     // If any of the pending interrupts are not masked, invoke the VSR
     if (0 != (synth_pending_isrs & ~synth_masked_isrs)) {
@@ -579,33 +634,17 @@ synth_io_sighandler(int sig)
 }
 
 // ----------------------------------------------------------------------------
-// SIGPIPE and SIGCHLD are special, related to the auxiliary process.
-static void
-synth_pipe_sighandler(int sig)
-{
-    CYG_ASSERT(CYG_HAL_SYS_SIGPIPE == sig, "The right signal handler should be invoked");
-    CYG_FAIL("The auxiliary is not yet implemented");
-}
-
-static void
-synth_chld_sighandler(int sig)
-{
-    CYG_ASSERT(CYG_HAL_SYS_SIGCHLD == sig, "The right signal handler should be invoked");
-    CYG_FAIL("The auxiliary is not yet implemented");
-}
-
-// ----------------------------------------------------------------------------
 // Here we define an action to do in the idle thread. For the
-// synthetic architecture it makes no sense to spin eating processor
-// time that other processes could make use of. Instead we call
-// select. The itimer will still go off and kick the scheduler back
-// into life so giving up an escape path from the select. There is one
-// problem: in some configurations, e.g. when preemption is disabled,
-// the idle thread must yield continuously rather than blocking.
+// synthetic target it makes no sense to spin eating processor time
+// that other processes could make use of. Instead we call select. The
+// itimer will still go off and kick the scheduler back into life,
+// giving us an escape path from the select. There is one problem: in
+// some configurations, e.g. when preemption is disabled, the idle
+// thread must yield continuously rather than blocking.
 void
 hal_idle_thread_action(cyg_uint32 loop_count)
 {
-#ifndef CYGIMP_IDLE_THREAD_YIELD
+#ifndef CYGIMP_HAL_IDLE_THREAD_SPIN
     cyg_hal_sys__newselect(0,
                            (struct cyg_hal_sys_fd_set*) 0,
                            (struct cyg_hal_sys_fd_set*) 0,
@@ -614,11 +653,583 @@ hal_idle_thread_action(cyg_uint32 loop_c
 #endif
     CYG_UNUSED_PARAM(cyg_uint32, loop_count);
 }
+
+// ----------------------------------------------------------------------------
+// The I/O auxiliary.
+//
+// I/O happens via an auxiliary process. During startup this code attempts
+// to locate and execute a program ecosynth which should be installed in
+// ../libexec/ecosynth relative to some directory on the search path.
+// Subsequent I/O operations involve interacting with this auxiliary.
+
+#define MAKESTRING1(a) #a
+#define MAKESTRING2(a) MAKESTRING1(a)
+#define AUXILIARY       "../libexec/ecos/hal/synth/arch/" MAKESTRING2(CYGPKG_HAL_SYNTH) "/ecosynth"
+
+// Is the auxiliary up and running?
+cyg_bool    synth_auxiliary_running   = false;
+
+// The pipes to and from the auxiliary.
+static int  to_aux      = -1;
+static int  from_aux    = -1;
+
+// Attempt to start up the auxiliary. Note that this happens early on
+// during system initialization so it is "known" that the world is
+// still simple, e.g. that no other files have been opened.
+static void
+synth_start_auxiliary(void)
+{
+#define BUFSIZE 256
+    char        filename[BUFSIZE];
+    const char* path = 0;
+    int         i, j;
+    cyg_bool    found   = false;
+    int         to_aux_pipe[2];
+    int         from_aux_pipe[2];
+    int         child;
+    int         aux_version;
+#if 1
+    // Check for a command line argument -io. Only run the auxiliary if this
+    // argument is provided, i.e. default to traditional behaviour.
+    for (i = 1; i < cyg_hal_sys_argc; i++) {
+        const char* tmp = cyg_hal_sys_argv[i];
+        if ('-' == *tmp) {
+            // Arguments beyond -- are reserved for use by the application,
+            // and should not be interpreted by the HAL itself or by ecosynth.
+            if (('-' == tmp[1]) && ('\0' == tmp[2])) {
+                break;
+            }
+            tmp++;
+            if ('-' == *tmp) {
+                // Do not distinguish between -io and --io
+                tmp++;
+            }
+            if (('i' == tmp[0]) && ('o' == tmp[1]) && ('\0' == tmp[2])) {
+                found = 1;
+                break;
+            }
+        }
+    }
+    if (!found) {
+        return;
+    }
+#else
+    // Check for a command line argument -ni or -nio. Always run the
+    // auxiliary unless this argument is given, i.e. default to full
+    // I/O support.
+    for (i = 1; i < cyg_hal_sys_argc; i++) {
+        const char* tmp = cyg_hal_sys_argv[i];
+        if ('-' == *tmp) {
+            if (('-' == tmp[1]) && ('\0' == tmp[2])) {
+                break;
+            }
+            tmp++;
+            if ('-' == *tmp) {
+                tmp++;
+            }
+            if ('n' == *tmp) {
+                tmp++;
+                if ('i' == *tmp) {
+                    tmp++;
+                    if ('\0' == *tmp) {
+                        found = 1;  // -ni or --ni
+                        break;
+                    }
+                    if (('o' == *tmp) && ('\0' == tmp[1])) {
+                        found = 1;  // -nio or --nio
+                        break;
+                    }
+                }
+            }
+        }
+    }
+    if (found) {
+        return;
+    }
+#endif
+    
+    // The auxiliary must be found relative to the current search path,
+    // so look for a PATH= environment variable.
+    for (i = 0; (0 == path) && (0 != cyg_hal_sys_environ[i]); i++) {
+        const char *var = cyg_hal_sys_environ[i];
+        if (('P' == var[0]) && ('A' == var[1]) && ('T' == var[2]) && ('H' == var[3]) && ('=' == var[4])) {
+            path = var + 5;
+        }
+    }
+    if (0 == path) {
+        // Very unlikely, but just in case.
+        path = ".:/bin:/usr/bin";
+    }
+
+    found = 0;
+    while (!found && ('\0' != *path)) {         // for every entry in the path
+        char *tmp = AUXILIARY;
+        
+        j = 0;
+
+        // As a special case, an empty string in the path corresponds to the
+        // current directory.
+        if (':' == *path) {
+            filename[j++] = '.';
+        } else {
+            while ((j < BUFSIZE) && ('\0' != *path) && (':' != *path)) {
+                filename[j++] = *path++;
+            }
+            // If not at the end of the search path, move on to the next entry.
+            if ('\0' != *path) {
+                while ((':' != *path) && ('\0' != *path)) {
+                    path++;
+                }
+                if (':' == *path) {
+                    path++;
+                }
+            }
+        }
+        // Now append a directory separator, and then the name of the executable.
+        if (j < BUFSIZE) {
+            filename[j++] = '/';
+        }
+        while ((j < BUFSIZE) && ('\0' != *tmp)) {
+            filename[j++] = *tmp++;
+        }
+        // If there has been a buffer overflow, skip this entry.
+        if (j == BUFSIZE) {
+            filename[BUFSIZE-1] = '\0';
+            diag_printf("Warning: buffer limit reached while searching PATH for the I/O auxiliary.\n");
+            diag_printf("       : skipping current entry.\n");
+        } else {
+            // filename now contains a possible match for the auxiliary.
+            filename[j++]    = '\0';
+            if (0 == cyg_hal_sys_access(filename, CYG_HAL_SYS_X_OK)) {
+                found = true;
+            }
+        }
+    }
+#undef BUFSIZE
+
+    if (!found) {
+        diag_printf("Error: unable to find the I/O auxiliary program on the current search PATH\n");
+        diag_printf("     : please install the appropriate host-side tools.\n");
+        cyg_hal_sys_exit(1);
+    }
+
+    // An apparently valid executable exists (or at the very least it existed...),
+    // so create the pipes that will be used for communication.
+    if ((0 != cyg_hal_sys_pipe(to_aux_pipe)) ||
+        (0 != cyg_hal_sys_pipe(from_aux_pipe))) {
+        diag_printf("Error: unable to set up pipes for communicating with the I/O auxiliary.\n");
+        cyg_hal_sys_exit(1);
+    }
+    
+    // Time to fork().
+    child = cyg_hal_sys_fork();
+    if (child < 0) {
+        diag_printf("Error: failed to fork() process for the I/O auxiliary.\n");
+        cyg_hal_sys_exit(1);
+    } else if (child == 0) {
+        cyg_bool    found_dotdot;
+        // There should not be any problems rearranging the file descriptors as desired...
+        cyg_bool    unexpected_error = 0;
+        
+        // In the child process. Close unwanted file descriptors, then some dup2'ing,
+        // and execve() the I/O auxiliary. The auxiliary will inherit stdin,
+        // stdout and stderr from the eCos application, so that functions like
+        // printf() work as expected. In addition fd 3 will be the pipe from
+        // the eCos application and fd 4 the pipe to the application. It is possible
+        // that the eCos application was run from some process other than a shell
+        // and hence that file descriptors 3 and 4 are already in use, but that is not
+        // supported. One possible workaround would be to close all file descriptors
+        // >= 3, another would be to munge the argument vector passing the file
+        // descriptors actually being used.
+        unexpected_error |= (0 != cyg_hal_sys_close(to_aux_pipe[1]));
+        unexpected_error |= (0 != cyg_hal_sys_close(from_aux_pipe[0]));
+        
+        if (3 != to_aux_pipe[0]) {
+            if (3 == from_aux_pipe[1]) {
+                // Because to_aux_pipe[] was set up first it should have received file descriptors 3 and 4.
+                diag_printf("Internal error: file descriptors have been allocated in an unusual order.\n");
+                cyg_hal_sys_exit(1);
+            } else {
+                unexpected_error |= (3 != cyg_hal_sys_dup2(to_aux_pipe[0], 3));
+                unexpected_error |= (0 != cyg_hal_sys_close(to_aux_pipe[0]));
+            }
+        }
+        if (4 != from_aux_pipe[1]) {
+            unexpected_error |= (4 != cyg_hal_sys_dup2(from_aux_pipe[1], 4));
+            unexpected_error |= (0 != cyg_hal_sys_close(from_aux_pipe[1]));
+        }
+        if (unexpected_error) {
+            diag_printf("Error: internal error in auxiliary process, failed to manipulate pipes.\n");
+            cyg_hal_sys_exit(1);
+        }
+        // The arguments passed to the auxiliary are mostly those for
+        // the synthetic target application, except for argv[0] which
+        // is replaced with the auxiliary's pathname. The latter
+        // currently holds at least one ../, and cleaning this up is
+        // useful.
+        //
+        // If the argument vector contains -- then that and subsequent
+        // arguments are not passed to the auxiliary. Instead such
+        // arguments are reserved for use by the application.
+        do {
+            int len;
+            for (len = 0; '\0' != filename[len]; len++)
+                ;
+            found_dotdot = false;
+            for (i = 0; i < (len - 4); i++) {
+                if (('/' == filename[i]) && ('.' == filename[i+1]) && ('.' == filename[i+2]) && ('/' == filename[i+3])) {
+                    j = i + 3;
+                    for ( --i; (i >= 0) && ('/' != filename[i]); i--) {
+                        CYG_EMPTY_STATEMENT;
+                    }
+                    if (i >= 0) {
+                        found_dotdot = true;
+                        do {
+                            i++; j++;
+                            filename[i] = filename[j];
+                        } while ('\0' != filename[i]);
+                    }
+                }
+            }
+        } while(found_dotdot);
+        
+        cyg_hal_sys_argv[0] = filename;
+
+        for (i = 1; i < cyg_hal_sys_argc; i++) {
+            const char* tmp = cyg_hal_sys_argv[i];
+            if (('-' == tmp[0]) && ('-' == tmp[1]) && ('\0' == tmp[2])) {
+                cyg_hal_sys_argv[i] = (const char*) 0;
+                break;
+            }
+        }
+        cyg_hal_sys_execve(filename, cyg_hal_sys_argv, cyg_hal_sys_environ);
+
+        // An execute error has occurred. Report this here, then exit. The
+        // parent will detect a close on the pipe without having received
+        // any data, and it will assume that a suitable diagnostic will have
+        // been displayed already.
+        diag_printf("Error: failed to execute the I/O auxiliary.\n");
+        cyg_hal_sys_exit(1);
+    } else {
+        int     rc;
+        char    buf[1];
+        
+        // Still executing the eCos application.
+        // Do some cleaning-up.
+        to_aux      = to_aux_pipe[1];
+        from_aux    = from_aux_pipe[0];
+        if ((0 != cyg_hal_sys_close(to_aux_pipe[0]))  ||
+            (0 != cyg_hal_sys_close(from_aux_pipe[1]))) {
+            diag_printf("Error: internal error in main process, failed to manipulate pipes.\n");
+            cyg_hal_sys_exit(1);
+        }
+
+        // It is now a good idea to block until the auxiliary is
+        // ready, i.e. give it a chance to read in its configuration
+        // files, load appropriate scripts, pop up windows, ... This
+        // may take a couple of seconds or so. Once the auxiliary is
+        // ready it will write a single byte down the pipe. This is
+        // the only time that the auxiliary will write other than when
+        // responding to a request.
+        do {
+            rc = cyg_hal_sys_read(from_aux, buf, 1);
+        } while (-CYG_HAL_SYS_EINTR == rc);
+
+        if (1 != rc) {
+            // The auxiliary has not started up successfully, so exit
+            // immediately. It should have generated appropriate
+            // diagnostics.
+            cyg_hal_sys_exit(1);
+        }
+    }
+
+    // At this point the auxiliary is up and running. It should not
+    // generate any interrupts just yet since none of the devices have
+    // been initialized. Remember that the auxiliary is now running,
+    // so that the initialization routines for those devices can
+    // figure out that they should interact with the auxiliary rather
+    // than attempt anything manually.
+    synth_auxiliary_running   = true;
+
+    // Make sure that the auxiliary is the right version.
+    synth_auxiliary_xchgmsg(SYNTH_DEV_AUXILIARY, SYNTH_AUXREQ_GET_VERSION, 0, 0,
+                            (const unsigned char*) 0, 0,
+                            &aux_version, (unsigned char*) 0, (int*) 0, 0);
+    if (SYNTH_AUXILIARY_PROTOCOL_VERSION != aux_version) {
+        synth_auxiliary_running = false;
+        diag_printf("Error: an incorrect version of the I/O auxiliary is installed\n"
+                    "    Expected version %d, actual version %d\n"
+                    "    Installed binary is %s\n",
+                    SYNTH_AUXILIARY_PROTOCOL_VERSION, aux_version, filename);
+        cyg_hal_sys_exit(1);
+    }
+}
+
+// Write a request to the I/O auxiliary, and optionally get back a
+// reply. The dev_id is 0 for messages intended for the auxiliary
+// itself, for example a device instantiation or a request for the
+// current interrupt sate. Otherwise it identifies a specific device.
+// The request code is specific to the device, and the two optional
+// arguments are specific to the request.
+void
+synth_auxiliary_xchgmsg(int devid, int reqcode, int arg1, int arg2,
+                        const unsigned char* txdata, int txlen,
+                        int* result, 
+                        unsigned char* rxdata, int* actual_rxlen, int rxlen)
+{
+    unsigned char   request[SYNTH_REQUEST_LENGTH];
+    unsigned char   reply[SYNTH_REPLY_LENGTH];
+    int             rc;
+    int             reply_rxlen;
+    cyg_bool_t      old_isrstate;
+
+    CYG_ASSERT(devid >= 0, "A valid device id should be supplied");
+    CYG_ASSERT((0 == txlen) || ((const unsigned char*)0 != txdata), "Data transmits require a transmit buffer");
+    CYG_ASSERT((0 == rxlen) || ((unsigned char*)0 != rxdata), "Data receives require a receive buffer");
+    CYG_ASSERT((0 == rxlen) || ((int*)0 != result), "If a reply is expected then space must be allocated");
+
+    // I/O interactions with the auxiliary must be atomic: a context switch in
+    // between sending the header and the actual data would be bad.
+    HAL_DISABLE_INTERRUPTS(old_isrstate);
+
+    // The auxiliary should be running for the duration of this
+    // exchange. However the auxiliary can disappear asynchronously,
+    // so it is not possible for higher-level code to be sure that the
+    // auxiliary is still running.
+    //
+    // If the auxiliary disappears during this call then usually this
+    // will cause a SIGCHILD or SIGPIPE, both of which result in
+    // termination. The exception is when the auxiliary decides to
+    // shut down stdout for some reason without exiting - that has to
+    // be detected in the read loop.
+    if (synth_auxiliary_running) {
+        request[SYNTH_REQUEST_DEVID_OFFSET + 0]     = (devid >>  0) & 0x0FF;
+        request[SYNTH_REQUEST_DEVID_OFFSET + 1]     = (devid >>  8) & 0x0FF;
+        request[SYNTH_REQUEST_DEVID_OFFSET + 2]     = (devid >> 16) & 0x0FF;
+        request[SYNTH_REQUEST_DEVID_OFFSET + 3]     = (devid >> 24) & 0x0FF;
+        request[SYNTH_REQUEST_REQUEST_OFFSET + 0]   = (reqcode >>  0) & 0x0FF;
+        request[SYNTH_REQUEST_REQUEST_OFFSET + 1]   = (reqcode >>  8) & 0x0FF;
+        request[SYNTH_REQUEST_REQUEST_OFFSET + 2]   = (reqcode >> 16) & 0x0FF;
+        request[SYNTH_REQUEST_REQUEST_OFFSET + 3]   = (reqcode >> 24) & 0x0FF;
+        request[SYNTH_REQUEST_ARG1_OFFSET + 0]      = (arg1 >>  0) & 0x0FF;
+        request[SYNTH_REQUEST_ARG1_OFFSET + 1]      = (arg1 >>  8) & 0x0FF;
+        request[SYNTH_REQUEST_ARG1_OFFSET + 2]      = (arg1 >> 16) & 0x0FF;
+        request[SYNTH_REQUEST_ARG1_OFFSET + 3]      = (arg1 >> 24) & 0x0FF;
+        request[SYNTH_REQUEST_ARG2_OFFSET + 0]      = (arg1 >>  0) & 0x0FF;
+        request[SYNTH_REQUEST_ARG2_OFFSET + 1]      = (arg1 >>  8) & 0x0FF;
+        request[SYNTH_REQUEST_ARG2_OFFSET + 2]      = (arg1 >> 16) & 0x0FF;
+        request[SYNTH_REQUEST_ARG2_OFFSET + 3]      = (arg1 >> 24) & 0x0FF;
+        request[SYNTH_REQUEST_TXLEN_OFFSET + 0]     = (txlen >>  0) & 0x0FF;
+        request[SYNTH_REQUEST_TXLEN_OFFSET + 1]     = (txlen >>  8) & 0x0FF;
+        request[SYNTH_REQUEST_TXLEN_OFFSET + 2]     = (txlen >> 16) & 0x0FF;
+        request[SYNTH_REQUEST_TXLEN_OFFSET + 3]     = (txlen >> 24) & 0x0FF;
+        request[SYNTH_REQUEST_RXLEN_OFFSET + 0]     = (rxlen >>  0) & 0x0FF;
+        request[SYNTH_REQUEST_RXLEN_OFFSET + 1]     = (rxlen >>  8) & 0x0FF;
+        request[SYNTH_REQUEST_RXLEN_OFFSET + 2]     = (rxlen >> 16) & 0x0FF;
+        request[SYNTH_REQUEST_RXLEN_OFFSET + 3]     = ((rxlen >> 24) & 0x0FF) | (((int*)0 != result) ? 0x080 : 0);
+
+        // sizeof(synth_auxiliary_request) < PIPE_BUF (4096) so a single write should be atomic,
+        // subject only to incoming clock or SIGIO or child-related signals.
+        do {
+            rc = cyg_hal_sys_write(to_aux, (const void*) &request, SYNTH_REQUEST_LENGTH);
+        } while (-CYG_HAL_SYS_EINTR == rc);
+
+        // Is there any more data to be sent?
+        if (0 < txlen) {
+            int sent    = 0;
+            CYG_LOOP_INVARIANT(synth_auxiliary_running, "The auxiliary cannot just disappear");
+        
+            while (sent < txlen) {
+                rc = cyg_hal_sys_write(to_aux, (const void*) &(txdata[sent]), txlen - sent);
+                if (-CYG_HAL_SYS_EINTR == rc) {
+                    continue;
+                } else if (rc < 0) {
+                    diag_printf("Internal error: unexpected result %d when sending buffer to auxiliary.\n", rc);
+                    diag_printf("              : this application is exiting immediately.\n");
+                    cyg_hal_sys_exit(1);
+                } else {
+                    sent += rc;
+                }
+            }
+            CYG_ASSERT(sent <= txlen, "Amount of data sent should not exceed requested size");
+        }
+
+        // The auxiliary can now process this entire request. Is a reply expected?
+        if ((int*)0 != result) {
+            // The basic reply is also only a small number of bytes, so should be atomic.
+            do {
+                rc = cyg_hal_sys_read(from_aux, (void*) &reply, SYNTH_REPLY_LENGTH);
+            } while (-CYG_HAL_SYS_EINTR == rc);
+            if (rc <= 0) {
+                if (rc < 0) {
+                    diag_printf("Internal error: unexpected result %d when receiving data from auxiliary.\n", rc);
+                } else {
+                    diag_printf("Internal error: EOF detected on pipe from auxiliary.\n");
+                }
+                diag_printf("              : this application is exiting immediately.\n");
+                cyg_hal_sys_exit(1);
+            }
+            CYG_ASSERT(SYNTH_REPLY_LENGTH == rc, "The correct amount of data should have been read");
+
+            // Replies are packed in Tcl and assumed to be two 32-bit
+            // little-endian integers.
+            *result   = (reply[SYNTH_REPLY_RESULT_OFFSET + 3] << 24) |
+                (reply[SYNTH_REPLY_RESULT_OFFSET + 2] << 16) |
+                (reply[SYNTH_REPLY_RESULT_OFFSET + 1] <<  8) |
+                (reply[SYNTH_REPLY_RESULT_OFFSET + 0] <<  0);
+            reply_rxlen = (reply[SYNTH_REPLY_RXLEN_OFFSET + 3] << 24) |
+                (reply[SYNTH_REPLY_RXLEN_OFFSET + 2] << 16) |
+                (reply[SYNTH_REPLY_RXLEN_OFFSET + 1] <<  8) |
+                (reply[SYNTH_REPLY_RXLEN_OFFSET + 0] <<  0);
+        
+            CYG_ASSERT(reply_rxlen <= rxlen, "The auxiliary should not be sending more data than was requested.");
+        
+            if ((int*)0 != actual_rxlen) {
+                *actual_rxlen  = reply_rxlen;
+            }
+            if (reply_rxlen) {
+                int received = 0;
+            
+                while (received < reply_rxlen) {
+                    rc = cyg_hal_sys_read(from_aux, (void*) &(rxdata[received]), reply_rxlen - received);
+                    if (-CYG_HAL_SYS_EINTR == rc) {
+                        continue;
+                    } else if (rc <= 0) {
+                        if (rc < 0) {
+                            diag_printf("Internal error: unexpected result %d when receiving data from auxiliary.\n", rc);
+                        } else {
+                            diag_printf("Internal error: EOF detected on pipe from auxiliary.\n");
+                        }
+                        diag_printf("              : this application is exiting immediately.\n");
+                    } else {
+                        received += rc;
+                    }
+                }
+                CYG_ASSERT(received == reply_rxlen, "Amount received should be exact");
+            }
+        }
+    }
+
+    HAL_RESTORE_INTERRUPTS(old_isrstate);
+}
+
+// Instantiate a device. This takes arguments such as
+// devs/eth/synth/ecosynth, current, ethernet, eth0, and 200x100 If
+// the package and version are NULL strings then the device being
+// initialized is application-specific and does not belong to any
+// particular package.
+int
+synth_auxiliary_instantiate(const char* pkg, const char* version, const char* devtype, const char* devinst, const char* devdata)
+{
+    int         result = -1;
+    char        buf[512 + 1];
+    const char* str;
+    int         index;
+
+    CYG_ASSERT((const char*)0 != devtype, "Device instantiations must specify a valid device type");
+    CYG_ASSERT((((const char*)0 != pkg) && ((const char*)0 != version)) || \
+               (((const char*)0 == pkg) && ((const char*)0 == version)), "If a package is specified then the version must be supplied as well");
+    
+    index = 0;
+    str = pkg;
+    if ((const char*)0 == str) {
+        str = "";
+    }
+    while ( (index < 512) && ('\0' != *str) ) {
+        buf[index++] = *str++;
+    }
+    if (index < 512) buf[index++] = '\0';
+    str = version;
+    if ((const char*)0 == str) {
+        str = "";
+    }
+    while ((index < 512) && ('\0' != *str) ) {
+        buf[index++] = *str++;
+    }
+    if (index < 512) buf[index++] = '\0';
+    for (str = devtype; (index < 512) && ('\0' != *str); ) {
+        buf[index++] = *str++;
+    }
+    if (index < 512) buf[index++] = '\0';
+    if ((const char*)0 != devinst) {
+        for (str = devinst; (index < 512) && ('\0' != *str); ) {
+            buf[index++] = *str++;
+        }
+    }
+    if (index < 512) buf[index++] = '\0';
+    if ((const char*)0 != devdata) {
+        for (str = devdata; (index < 512) && ('\0' != *str); ) {
+            buf[index++] = *str++;
+        }
+    }
+    if (index < 512) {
+        buf[index++] = '\0';
+    } else {
+        diag_printf("Internal error: buffer overflow constructing instantiate request for auxiliary.\n");
+        diag_printf("              : this application is exiting immediately.\n");
+        cyg_hal_sys_exit(1);
+    }
+
+    if (synth_auxiliary_running) {
+        synth_auxiliary_xchgmsg(SYNTH_DEV_AUXILIARY, SYNTH_AUXREQ_INSTANTIATE, 0, 0,
+                                buf, index,
+                                &result, 
+                                (unsigned char*) 0, (int *) 0, 0);
+    }
+    return result;
+}
+
+// ----------------------------------------------------------------------------
+// SIGPIPE and SIGCHLD are special, related to the auxiliary process.
+//
+// A SIGPIPE can only happen when the application is writing to the
+// auxiliary, which only happens inside synth_auxiliary_xchgmsg() (this
+// assumes that no other code is writing down a pipe, e.g. to interact
+// with a process other than the standard I/O auxiliary). Either the
+// auxiliary has explicitly closed the pipe, which it is not supposed
+// to do, or more likely it has exited. Either way, there is little
+// point in continuing - unless we already know that the system is
+// shutting down.
+static void
+synth_pipe_sighandler(int sig)
+{
+    CYG_ASSERT(CYG_HAL_SYS_SIGPIPE == sig, "The right signal handler should be invoked");
+    if (synth_auxiliary_running) {
+        synth_auxiliary_running   = false;
+        diag_printf("Internal error: communication with the I/O auxiliary has been lost.\n");
+        diag_printf("              : this application is exiting immediately.\n");
+        cyg_hal_sys_exit(1);
+    }
+}
+
+// Similarly it is assumed that there will be no child processes other than
+// the auxiliary. Therefore a SIGCHLD indicates that the auxiliary has
+// terminated unexpectedly. This is bad: normal termination involves
+// the application exiting and the auxiliary terminating in response,
+// not the other way around.
+//
+// As a special case, if it is known that the auxiliary is not currently
+// usable then the signal is ignored. This copes with the situation where
+// the auxiliary has just been fork()'d but has failed to initialize, or
+// alternatively where the whole system is in the process of shutting down
+// cleanly and it happens that the auxiliary got there first.
+static void
+synth_chld_sighandler(int sig)
+{
+    CYG_ASSERT(CYG_HAL_SYS_SIGCHLD == sig, "The right signal handler should be invoked");
+    if (synth_auxiliary_running) {
+        synth_auxiliary_running   = false;
+        diag_printf("Internal error: the I/O auxiliary has terminated unexpectedly.\n");
+        diag_printf("              : this application is exiting immediately.\n");
+        cyg_hal_sys_exit(1);
+    }
+}
+
 // ----------------------------------------------------------------------------
 // Initialization
 
 void
-hal_synthetic_target_init(void)
+synth_hardware_init(void)
 {
     struct cyg_hal_sys_sigaction action;
     struct cyg_hal_sys_sigset_t  blocked;
@@ -676,8 +1287,8 @@ hal_synthetic_target_init(void)
         CYG_FAIL("Failed to install signal handler for SIGIO");
     }
 
-    // Now install handlers for the various exceptions. For now these
-    // also operate with unchanged sigprocmasks, allowing nested
+    // Install handlers for the various exceptions. For now these also
+    // operate with unchanged sigprocmasks, allowing nested
     // exceptions. It is not clear that this is entirely a good idea,
     // but in practice these exceptions will usually be handled by gdb
     // anyway.
@@ -704,9 +1315,13 @@ hal_synthetic_target_init(void)
         CYG_FAIL("Failed to install signal handler for SIGPIPE");
     }
     action.hal_handler = &synth_chld_sighandler;
+    action.hal_flags  |= CYG_HAL_SYS_SA_NOCLDSTOP | CYG_HAL_SYS_SA_NOCLDWAIT;
     if (0 != cyg_hal_sys_sigaction(CYG_HAL_SYS_SIGCHLD,  &action, (struct cyg_hal_sys_sigaction*) 0)) {
         CYG_FAIL("Failed to install signal handler for SIGCHLD");
     }
+
+    // Start up the auxiliary process.
+    synth_start_auxiliary();
     
     // All done. At this stage interrupts are still disabled, no ISRs
     // have been installed, and the clock is not yet ticking.
@@ -714,3 +1329,31 @@ hal_synthetic_target_init(void)
     // and SIGALRM could come in, but nothing has yet been done
     // to make that happen.
 }
+
+// Second-stage hardware init. This is called after all C++ static
+// constructors have been run, which should mean that all device
+// drivers have been initialized and will have performed appropriate
+// interactions with the I/O auxiliary. There should now be a
+// message exchange with the auxiliary to let it know that there will
+// not be any more devices, allowing it to remove unwanted frames,
+// run the user's mainrc.tcl script, and so on. Also this is the
+// time that the various toplevels get mapped on to the display.
+//
+// This request blocks until the auxiliary is ready. The return value
+// indicates whether or not any errors occurred on the auxiliary side,
+// and that those errors have not been suppressed using --keep-going
+
+void
+synth_hardware_init2(void)
+{
+    if (synth_auxiliary_running) {
+        int result;
+        synth_auxiliary_xchgmsg(SYNTH_DEV_AUXILIARY, SYNTH_AUXREQ_CONSTRUCTORS_DONE,
+                               0, 0, (const unsigned char*) 0, 0,
+                               &result,
+                               (unsigned char*) 0, (int*) 0, 0);
+        if ( !result ) {
+            cyg_hal_sys_exit(1);
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/packages/hal/synth/arch/current/src/synth_protocol.h
@@ -0,0 +1,124 @@
+#ifndef CYGONCE_HAL_SYNTH_PROTOCOL_H
+#define CYGONCE_HAL_SYNTH_PROTOCOL_H
+
+//=============================================================================
+//
+//      synth_protocol.h
+//
+//      Generic protocol between eCos and the I/O auxiliary.
+//
+//=============================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Bart Veer
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//=============================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):   bartv
+// Contributors:bartv
+// Date:        2002-08-05
+// Purpose:     Protocol definitions.
+// Description: This header file defines the protocol used between the
+//              synthetic target HAL and the I/O auxiliary. The relevant
+//              code in the latter is implemented in Tcl (making
+//              use of the "binary" command) so this header file is
+//              not actually used on the host-side. Instead the protocol
+//              is defined in terms of byte arrays.
+//
+//              The header file is not exported to any higher-level packages
+//              that wish to communicate with the auxiliary. Instead those
+//              packages are expected to use the functions synth_auxiliary_xchgmsg()
+//              and synth_auxiliary_instantiate().
+//
+// Usage:       #include "synth_protocol.h"
+//
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+// Messages from the eCos synthetic target application to the I/O
+// auxiliary are exactly 24 bytes long, consisting of six 32-bit
+// little-endian integers. Inside the auxiliary they will be decoded
+// using the Tcl binary scan command and the format i6. The top bit
+// of RXLEN is overloaded to indicate whether or not a reply is expected
+// at all.
+#define SYNTH_REQUEST_LENGTH            24
+#define SYNTH_REQUEST_DEVID_OFFSET       0
+#define SYNTH_REQUEST_REQUEST_OFFSET     4
+#define SYNTH_REQUEST_ARG1_OFFSET        8
+#define SYNTH_REQUEST_ARG2_OFFSET       12
+#define SYNTH_REQUEST_TXLEN_OFFSET      16
+#define SYNTH_REQUEST_RXLEN_OFFSET      20
+
+// And the response. This consists of two 32-bit little-endian integers,
+// a result code and an actual rx_len field.
+#define SYNTH_REPLY_LENGTH               8
+#define SYNTH_REPLY_RESULT_OFFSET        0
+#define SYNTH_REPLY_RXLEN_OFFSET         4
+
+// Device 0 is special, it is for control messages with the auxiliary
+// itself - for example, to instantiate a device.
+#define SYNTH_DEV_AUXILIARY     0
+
+// Requests intended directly for the auxiliary.
+
+// Instantiate a device. arg1 and arg2 are ignored. The tx buffer
+// holds a string for the given device. The rx buffer will be for a
+// single integer, the device id or -1.
+#define SYNTH_AUXREQ_INSTANTIATE                0x01
+
+// Second-stage initialization, once all eCos device drivers have been
+// activated.
+#define SYNTH_AUXREQ_CONSTRUCTORS_DONE          0x02
+
+// Get the current mask of pending interrupts. arg1 and arg2 are
+// ignored, and there is no tx buffer. The reply code holds the irq
+// pending mask. Normally there is no additional reply data, but if
+// rx_len is non-zero then that indicates that the auxiliary has been
+// asked to exit.
+#define SYNTH_AUXREQ_GET_IRQPENDING             0x03
+
+// Versioning. The core protocol cannot be changed without breaking
+// lots of code. However it is still a good idea to allow the eCos
+// application to verify that the host-side is the right version, in
+// case new requests are added. arg1 and arg2 are ignored, there is no
+// tx buffer or reply data, and the reply code holds the version.
+#define SYNTH_AUXREQ_GET_VERSION                0x04
+
+// The version has to be kept in synch with ecosynth.tcl
+#define SYNTH_AUXILIARY_PROTOCOL_VERSION        0x01
+
+// The console device is also provided by the architectural package,
+// but only implements one function (write some output) so there is no
+// need for any function codes.
+
+#endif  // CYGONCE_HAL_SYNTH_PROTOCOL.H
--- a/packages/hal/synth/i386linux/current/ChangeLog
+++ b/packages/hal/synth/i386linux/current/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-15  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/syscall-i386-linux-1.0.S:
+	Add access system call
+
 2002-08-04  Bart Veer  <bartv@tymora.demon.co.uk>
 
 	* src/vectors.S (_start):
--- a/packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S
+++ b/packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S
@@ -435,3 +435,4 @@ SYSCALL3(readv)
 SYSCALL3(writev)
 SYSCALL1(fdatasync)
 SYSCALL2(getcwd)
+SYSCALL2(access)