<!-- Copyright (C) 2002 Red Hat, Inc. -->
|
<!-- Copyright (C) 2002 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>The Console Device</TITLE
|
>The Console Device</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos Synthetic Target"
|
TITLE="eCos Synthetic Target"
|
HREF="hal-synth-arch.html"><LINK
|
HREF="hal-synth-arch.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="The I/O Auxiliary's User Interface"
|
TITLE="The I/O Auxiliary's User Interface"
|
HREF="synth-gui.html"><LINK
|
HREF="synth-gui.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="System Calls"
|
TITLE="System Calls"
|
HREF="synth-syscalls.html"></HEAD
|
HREF="synth-syscalls.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="REFENTRY"
|
CLASS="REFENTRY"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos Synthetic Target</TH
|
>eCos Synthetic Target</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="synth-gui.html"
|
HREF="synth-gui.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="synth-syscalls.html"
|
HREF="synth-syscalls.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><H1
|
><H1
|
><A
|
><A
|
NAME="SYNTH-CONSOLE">The Console Device</H1
|
NAME="SYNTH-CONSOLE">The Console Device</H1
|
><DIV
|
><DIV
|
CLASS="REFNAMEDIV"
|
CLASS="REFNAMEDIV"
|
><A
|
><A
|
NAME="AEN435"
|
NAME="AEN435"
|
></A
|
></A
|
><H2
|
><H2
|
>Name</H2
|
>Name</H2
|
>The console device -- Show output from the eCos application</DIV
|
>The console device -- Show output from the eCos application</DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="SYNTH-CONSOLE-DESCRIPTION"
|
NAME="SYNTH-CONSOLE-DESCRIPTION"
|
></A
|
></A
|
><H2
|
><H2
|
>Description</H2
|
>Description</H2
|
><P
|
><P
|
>The eCos application can generate text output in a variety of ways,
|
>The eCos application can generate text output in a variety of ways,
|
including calling <TT
|
including calling <TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>printf</TT
|
>printf</TT
|
> or
|
> or
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>diag_printf</TT
|
>diag_printf</TT
|
>. When the I/O auxiliary is enabled
|
>. When the I/O auxiliary is enabled
|
the eCos startup code will instantiate a console device to process all
|
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
|
such output. If operating in text mode the output will simply go to
|
standard output, or to a logfile if the <TT
|
standard output, or to a logfile if the <TT
|
CLASS="OPTION"
|
CLASS="OPTION"
|
>-l</TT
|
>-l</TT
|
> command
|
> command
|
line option is specified. If operating in graphical mode the output
|
line option is specified. If operating in graphical mode the output
|
will go to the central text window, and optionally to a logfile as
|
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
|
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
|
text via the target definition file, and to install extra filters for
|
certain types of text.
|
certain types of text.
|
</P
|
</P
|
><P
|
><P
|
>It should be noted that the console device is line-oriented, not
|
>It should be noted that the console device is line-oriented, not
|
character-oriented. This means that outputting partial lines is not
|
character-oriented. This means that outputting partial lines is not
|
supported, and some functions such as <TT
|
supported, and some functions such as <TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>fflush</TT
|
>fflush</TT
|
> and
|
> and
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>setvbuf</TT
|
>setvbuf</TT
|
> will not operate as expected. This
|
> will not operate as expected. This
|
limitation prevents much possible confusion when using filters to
|
limitation prevents much possible confusion when using filters to
|
control the appearance of the text window, and has some performance
|
control the appearance of the text window, and has some performance
|
benefits - especially when the eCos application generates a great deal
|
benefits - especially when the eCos application generates a great deal
|
of output such as when tracing is enabled. For most applications this
|
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
|
is not a problem, but it is something that developers should be aware
|
of.
|
of.
|
</P
|
</P
|
><P
|
><P
|
>The console device is output-only, it does not provide any support for
|
>The console device is output-only, it does not provide any support for
|
keyboard input. If the application requires keyboard input then that
|
keyboard input. If the application requires keyboard input then that
|
should be handled by a separate eCos device package and matching
|
should be handled by a separate eCos device package and matching
|
host-side code.
|
host-side code.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="SYNTH-CONSOLE-INSTALL"
|
NAME="SYNTH-CONSOLE-INSTALL"
|
></A
|
></A
|
><H2
|
><H2
|
>Installation</H2
|
>Installation</H2
|
><P
|
><P
|
>The eCos side of the console device is implemented by the
|
>The eCos side of the console device is implemented by the
|
architectural HAL itself, in the source file
|
architectural HAL itself, in the source file
|
<TT
|
<TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>synth_diag.c</TT
|
>synth_diag.c</TT
|
>, rather than in a separate device
|
>, rather than in a separate device
|
package. Similarly the host-side implementation,
|
package. Similarly the host-side implementation,
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>console.tcl</TT
|
>console.tcl</TT
|
>, is part of the architectural HAL's
|
>, is part of the architectural HAL's
|
host-side support. It gets installed automatically alongside the I/O
|
host-side support. It gets installed automatically alongside the I/O
|
auxiliary itself, so no separate installation procedure is required.
|
auxiliary itself, so no separate installation procedure is required.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="SYNTH-CONSOLE-TDF"
|
NAME="SYNTH-CONSOLE-TDF"
|
></A
|
></A
|
><H2
|
><H2
|
>Target Definition File</H2
|
>Target Definition File</H2
|
><P
|
><P
|
>The <A
|
>The <A
|
HREF="synth-running.html#SYNTH-RUNNING-TDF"
|
HREF="synth-running.html#SYNTH-RUNNING-TDF"
|
>target definition file</A
|
>target definition file</A
|
>
|
>
|
can contain a number of entries related to the console device. These
|
can contain a number of entries related to the console device. These
|
are all optional, they only control the appearance of text output. If
|
are all optional, they only control the appearance of text output. If
|
such control is desired then the relevant options should appear in the
|
such control is desired then the relevant options should appear in the
|
body of a <B
|
body of a <B
|
CLASS="COMMAND"
|
CLASS="COMMAND"
|
>synth_device</B
|
>synth_device</B
|
> entry:
|
> entry:
|
</P
|
</P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>synth_device console {
|
>synth_device console {
|
…
|
…
|
}</PRE
|
}</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>The first option is <B
|
>The first option is <B
|
CLASS="COMMAND"
|
CLASS="COMMAND"
|
>appearance</B
|
>appearance</B
|
>, used to control the
|
>, used to control the
|
appearance of any text generated by the eCos application that does not
|
appearance of any text generated by the eCos application that does not
|
match one of the installed filters. This option takes the same
|
match one of the installed filters. This option takes the same
|
argument as any other filter, for example:
|
argument as any other filter, for example:
|
</P
|
</P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>synth_device console {
|
>synth_device console {
|
appearance -foreground white -background black
|
appearance -foreground white -background black
|
…
|
…
|
}</PRE
|
}</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>Any number of additional filters can be created with a
|
>Any number of additional filters can be created with a
|
<B
|
<B
|
CLASS="COMMAND"
|
CLASS="COMMAND"
|
>filter</B
|
>filter</B
|
> option, for example:
|
> option, for example:
|
</P
|
</P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>synth_device console {
|
>synth_device console {
|
…
|
…
|
filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
|
filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
|
…
|
…
|
}</PRE
|
}</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>The first argument gives the new filter a name which will be used in
|
>The first argument gives the new filter a name which will be used in
|
the <A
|
the <A
|
HREF="synth-gui.html#SYNTH-GUI-TEXT"
|
HREF="synth-gui.html#SYNTH-GUI-TEXT"
|
>filters dialog</A
|
>filters dialog</A
|
>. Filter names
|
>. Filter names
|
should be unique. The second argument is a Tcl regular expression. The
|
should be unique. The second argument is a Tcl regular expression. The
|
console support will match each line of eCos output against this
|
console support will match each line of eCos output against this
|
regular expression, and if a match is found then the filter will be
|
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
|
used for this line of text. The above example matches any line of
|
output that begins with <TT
|
output that begins with <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>TRACE:</TT
|
>TRACE:</TT
|
>, which corresponds
|
>, which corresponds
|
to the eCos infrastructure's tracing facilities. The remaining options
|
to the eCos infrastructure's tracing facilities. The remaining options
|
control the desired appearance for matched text. If some eCos output
|
control the desired appearance for matched text. If some eCos output
|
matches the regular expressions for several different filters then
|
matches the regular expressions for several different filters then
|
only the first match will be used.
|
only the first match will be used.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="SYNTH-CONSOLE-TARGET-CONFIG"
|
NAME="SYNTH-CONSOLE-TARGET-CONFIG"
|
></A
|
></A
|
><H2
|
><H2
|
>Target-side
|
>Target-side
|
Configuration Options</H2
|
Configuration Options</H2
|
><P
|
><P
|
>There are no target-side configuration options related to the console
|
>There are no target-side configuration options related to the console
|
device.
|
device.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="SYNTH-CONSOLE-ARGUMENTS"
|
NAME="SYNTH-CONSOLE-ARGUMENTS"
|
></A
|
></A
|
><H2
|
><H2
|
>Command Line Arguments</H2
|
>Command Line Arguments</H2
|
><P
|
><P
|
>The console device does not use any command-line arguments.
|
>The console device does not use any command-line arguments.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="SYNTH-CONSOLE-HOOKS"
|
NAME="SYNTH-CONSOLE-HOOKS"
|
></A
|
></A
|
><H2
|
><H2
|
>Hooks</H2
|
>Hooks</H2
|
><P
|
><P
|
>The console device does not provide any hooks.
|
>The console device does not provide any hooks.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN477"
|
NAME="AEN477"
|
></A
|
></A
|
><H2
|
><H2
|
>Additional Tcl Procedures</H2
|
>Additional Tcl Procedures</H2
|
><P
|
><P
|
>The console device does not provide any additional Tcl procedures that
|
>The console device does not provide any additional Tcl procedures that
|
can be used by other scripts.
|
can be used by other scripts.
|
</P
|
</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="synth-gui.html"
|
HREF="synth-gui.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="hal-synth-arch.html"
|
HREF="hal-synth-arch.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="synth-syscalls.html"
|
HREF="synth-syscalls.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>The I/O Auxiliary's User Interface</TD
|
>The I/O Auxiliary's User Interface</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
> </TD
|
> </TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>System Calls</TD
|
>System Calls</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|