synth-running.html
来自「ecos3.0 beta 的官方文档,html格式」· HTML 代码 · 共 973 行 · 第 1/2 页
HTML
973 行
<!-- Copyright (C) 2009 Free Software Foundation, 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. -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Running a Synthetic Target Application</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><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"
></A
>Running a Synthetic Target Application</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN17833"
></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 <CODE
CLASS="OPTION"
>--io</CODE
> 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 <CODE
CLASS="OPTION"
>--nio</CODE
> 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 <CODE
CLASS="OPTION"
>--</CODE
> 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
<CODE
CLASS="VARNAME"
>cyg_hal_sys_argc</CODE
> and
<CODE
CLASS="VARNAME"
>cyg_hal_sys_argv</CODE
>.
</P
><P
>The following options are accepted as standard:
</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><CODE
CLASS="OPTION"
>--io</CODE
></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
><CODE
CLASS="OPTION"
>--nio</CODE
></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
><CODE
CLASS="OPTION"
>-nw</CODE
>, <CODE
CLASS="OPTION"
>--no-windows</CODE
></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 <CODE
CLASS="OPTION"
>-nw</CODE
>.
Emulation of some devices, for example buttons connected to digital
inputs, requires the graphical interface.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-w</CODE
>, <CODE
CLASS="OPTION"
>--windows</CODE
></DT
><DD
><P
>The <CODE
CLASS="OPTION"
>-w</CODE
> causes the I/O auxiliary to provide a
graphical user interface. This is the default.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-v</CODE
>, <CODE
CLASS="OPTION"
>--version</CODE
></DT
><DD
><P
>The <CODE
CLASS="OPTION"
>-v</CODE
> 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
><CODE
CLASS="OPTION"
>-h</CODE
>, <CODE
CLASS="OPTION"
>--help</CODE
></DT
><DD
><P
><CODE
CLASS="OPTION"
>-h</CODE
> 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
<CODE
CLASS="OPTION"
>-nw</CODE
>.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-k</CODE
>, <CODE
CLASS="OPTION"
>--keep-going</CODE
></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 <CODE
CLASS="OPTION"
>-k</CODE
>
option can be used to make the auxiliary continue in spite of errors,
although obviously it may not be fully functional.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-nr</CODE
>, <CODE
CLASS="OPTION"
>--no-rc</CODE
></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
<CODE
CLASS="OPTION"
>-nr</CODE
> option.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-x</CODE
>, <CODE
CLASS="OPTION"
>--exit</CODE
></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 <CODE
CLASS="OPTION"
>-x</CODE
> then
the auxiliary will exit as soon the application exits.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-nx</CODE
>, <CODE
CLASS="OPTION"
>--no-exit</CODE
></DT
><DD
><P
>When the graphical user interface is disabled with
<CODE
CLASS="OPTION"
>-nw</CODE
> 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
<CODE
CLASS="OPTION"
>-nx</CODE
> option causes the auxiliary to continue running
even after the application has exited.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-V</CODE
>, <CODE
CLASS="OPTION"
>--verbose</CODE
></DT
><DD
><P
>This option causes the I/O auxiliary to output some additional
information, especially during initialization.
</P
></DD
><DT
><CODE
CLASS="OPTION"
>-l <file></CODE
>, <CODE
CLASS="OPTION"
>--logfile <file></CODE
></DT
><DD
><P
>Much of the output of the eCos application and the I/O auxiliary is
simple text, for example resulting from eCos
<CODE
CLASS="FUNCTION"
>printf</CODE
> or <CODE
CLASS="FUNCTION"
>diag_printf</CODE
> 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
<CODE
CLASS="OPTION"
>-l</CODE
> 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 <CODE
CLASS="OPTION"
>-l</CODE
> 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
><CODE
CLASS="OPTION"
>-t <file></CODE
>, <CODE
CLASS="OPTION"
>--target <file></CODE
></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 <CODE
CLASS="OPTION"
>-t</CODE
>
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
><CODE
CLASS="OPTION"
>-geometry <geometry></CODE
></DT
><DD
><P
>This option can be used to control the size and position of the main
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?