Synthetic target ethernet driver, Name, Overview – Comtrol eCos User Manual

Page 803: Installation

Advertising
background image

Synthetic Target Ethernet Driver

Name

Synthetic Target Ethernet Support

— Allow synthetic target applications to perform ethernet I/O

Overview

The synthetic target ethernet package can provide up to four network devices,

eth0

to

eth3

. 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

eth1

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.

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

ethernet.tcl

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

ethernet.tcl

will actually run a separate program

rawether to interact with the Linux network device.

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:

synth_device ethernet {

eth0 real eth1

eth1 ethertap tap3 00:01:02:03:FE:05

...

}

The ethernet package also comes with support for packet logging, and provides various facilities for use by user
Tcl scripts.

Installation

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

host

subdirectory of the synthetic target ethernet package, and building

it involves the standard configure, make and make install steps. The build involves a new executable rawether
which must be able to access a raw Linux network device. This is achieved by installing it suid root, so the make
install
step has to be run with superuser privileges.

699

Advertising