⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synth.sgml

📁 eCos操作系统源码
💻 SGML
📖 第 1 页 / 共 5 页
字号:
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 mainwindow, as per X conventions.         </para></listitem>      </varlistentry>    </variablelist>    <para>The I/O auxiliary loads support for the various devices dynamicallyand some devices may accept additional command line arguments. Detailsof these can be obtained using the <option>-h</option> option or byconsulting the device-specific documentation. If an unrecognisedcommand 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 tobe mapped on to Linux devices. For example some users may all trafficon the eCos <varname>/dev/ser0</varname> serial device to go via theLinux serial device <varname>/dev/ttyS1</varname>, while ethernet I/Ofor the eCos <varname>eth0</varname> device should be mapped to theLinux ethertap device <varname>tap3</varname>. Some devices may needadditional configuration information, for example to limit thenumber 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 canbe specified on the command line using <option>-t</option>, forexample:    </para>    <screen>$ bridge_app --io -t twineth</screen>    <para>A <filename>.tdf</filename> suffix will be appended automatically ifnecessary. If a relative pathname is used then the I/O auxiliary willsearch for the target definition file in the current directory, thenin <filename class="directory">~/.ecos/synth/</filename>, and finallyin 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 themain interpreter of the I/O auxiliary during initialization. Thisprovides a lot of flexibility if necessary. For example the scriptcould open a socket to a resource management server of some sort todetermine which hardware facilities are already in use and adaptaccordingly. Another possibility is to adapt based on <linklinkend="synth-new-host-args">command line arguments</link>. Users whoare not familiar with Tcl programming should still be able to edit asimple target definition file without too much difficulty, using amixture of cut'n'paste, commenting or uncommenting various lines, andmaking 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 definitionfile, taking the form:    </para>    <programlisting>synth_device &lt;device type&gt; {    &lt;options&gt;}</programlisting>    <para>The documentaton for each synthetic target device should providedetails of the options available for that device, and often a suitablefragment that can be pasted into a target definition file and edited.There is no specific set of options that a given device will alwaysprovide. However in practice many devices will use common codeexported by the main I/O auxiliary, or their implementation willinvolve some re-use of code for an existing device. Hence certaintypes of option are common to many devices.    </para>    <para>A good example of this is filters, which control the appearance oftext output. The above target definition file defines a filter<varname>trace</varname> for output from the eCos application. Theregular expression will match output from the infrastructure package'stracing 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>SystemFilters</guimenuitem>. If made visible the trace output will appear inan unusual colour, so users can easily distinguish the trace outputfrom 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 beinvisible by default or not. At run-time the visibility of each filtercan 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 thisfilter. 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 outabout 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 usinga symbolic name or an RGB value.         </para></listitem>      </varlistentry>    </variablelist>    <para>Some devices may create their own subwindows, for example to monitorethernet traffic or to provide additional I/O facilities such asemulated LED's or buttons. Usually the target definition file can beused to control the <link linkend="synth-gui-layout">layout</link> ofthese windows.    </para>    <para>The I/O auxiliary will not normally warn about<command>synth_device</command> entries in the target definition filefor devices that are not actually needed by the current eCosapplication. This makes it easier to use a single file for severaldifferent applications. However it can lead to confusion if an entryis spelled incorrectly and hence does not actually get used. The<option>-V</option> command line option can be used to get warningsabout unused device entries in the target definition file.    </para>    <para>If the body of a <command>synth_device</command> command contains anunrecognised option and the relevant device is in use, the I/Oauxiliary 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 userconfiguration files, <filename>initrc.tcl</filename> and<filename>mainrc.tcl</filename>. It will look for these files in thedirectory <filename class="directory">~/.ecos/synth/</filename>. Ifthat directory does not yet exist it will be created and populatedwith initial dummy files.    </para>    <para>Both of these configuration files are Tcl scripts and will be run inthe main interpreter used by the I/O auxiliary itself. This means thatthey have full access to the internals of the auxiliary including thevarious Tk widgets, and they can perform file or socket I/O ifdesired. The section <xref linkend="synth-new-host"> containsinformation about the facilities available on the host-side forwriting new device drivers, and these can also be used in theinitialization scripts.    </para>    <para>The <filename>initrc.tcl</filename> script is run before the auxiliaryhas processed any requests from the eCos application, and hence beforeany devices have been instantiated. At this point the genericcommand-line arguments has been processed, the target definition filehas been read in, and the hooks functionality has been initialized. Ifrunning in graphical mode the main window will have been created, buthas been withdrawn from the screen to allow new widgets to be addedwithout annoying screen flicker. A typical<filename>initrc.tcl</filename> script could add some menu or toolbaroptions, or install a hook function that will be run when theeCos application exits.    </para>    <para>The <filename>mainrc.tcl</filename> script is run after eCos hasperformed all its device initialization and after C++ staticconstructors have run, and just before the call to<function>cyg_start</function> which will end up transferring controlto the application itself. A typical <filename>mainrc.tcl</filename>script could look at what interrupt vectors have been allocated towhich devices and create a little monitor window that shows interruptactivity.     </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 sessioninformation. This file should not normally be edited manually, insteadit gets updated automatically when the auxiliary exits. The purpose ofthis file is to hold configuration options that are manipulated viathe graphical interface, for example which browser should be used todisplay 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 sometarget definition file options may be removed, to be replaced bygraphical editing via a suitable preferences dialog, with thecurrent 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 extensionsand user customization. Support for the desired devices is dynamicallyloaded, and each device can extend the user interface. For example itis possible for a device to add menu options, place new buttons on thetoolbar, create its own sub-window within the overall layout, or evencreate entire new toplevel windows. These subwindows or toplevelscould show graphs of activity such as interrupts or packets beingtransferred. They could also allow users to interact with the eCosapplication, for example by showing a number of buttons which will bemapped on to digital inputs in the eCos application. Differentapplications will have their own I/O requirements, changing thehost-side support files that get loaded and that may modify the userinterface. The I/O auxiliary also reads in user configuration scriptswhich can enhance the interface in the same way. Therefore the exactuser interface will depend on the user and on the eCos applicationbeing run. However the overall layout is likely to remain the same.    </para>    <informalfigure PgWide=1>      <mediaobject>        <imageobject>          <imagedata fileref="screen_main.png" Scalefit=1 Align="Center">        </imageobject>      </mediaobject>    </informalfigure>    <para>The title bar identifies the window as belonging to an eCos synthetictarget application and lists both the application name and its processid. The latter is especially useful if the application was starteddirectly from a shell prompt and the user now wants to attach a gdbsession. The window has a conventional menu bar with the usualentries, plus a toolbar with buttons for common operations such as cutand paste. Balloon help is supported.    </para>    <para>There is a central <link linkend="synth-gui-text">text window</link>,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -