📄 synth-running.html
字号:
<!-- Copyright (C) 2003 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 Reference Manual"
HREF="ecos-ref.html"><LINK
REL="UP"
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 Reference Manual</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="AEN17759"
></A
><H2
>Name</H2
>Execution -- 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 <options></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 <options>
(gdb) run
Starting program: ecos_hello <options></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"
>$ <ecos_app> [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 <file></TT
>, <TT
CLASS="OPTION"
>--logfile <file></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 <file></TT
>, <TT
CLASS="OPTION"
>--target <file></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 <geometry></TT
></DT
><DD
><P
>This option can be used to control the size and position of the main
window, as per X conventions.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -