URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [synth/] [arch/] [current/] [doc/] [synth-console.html] - Rev 838
Go to most recent revision | Compare with Previous | Blame | View Log
<!-- Copyright (C) 2002 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. --> <HTML ><HEAD ><TITLE >The Console Device</TITLE ><meta name="MSSmartTagsPreventParsing" content="TRUE"> <META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ "><LINK REL="HOME" TITLE="eCos Synthetic Target" HREF="hal-synth-arch.html"><LINK REL="PREVIOUS" TITLE="The I/O Auxiliary's User Interface" HREF="synth-gui.html"><LINK REL="NEXT" TITLE="System Calls" HREF="synth-syscalls.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 Synthetic Target</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="synth-gui.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="synth-syscalls.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="SYNTH-CONSOLE">The Console Device</H1 ><DIV CLASS="REFNAMEDIV" ><A NAME="AEN435" ></A ><H2 >Name</H2 >The console device -- Show output from the eCos application</DIV ><DIV CLASS="REFSECT1" ><A NAME="SYNTH-CONSOLE-DESCRIPTION" ></A ><H2 >Description</H2 ><P >The eCos application can generate text output in a variety of ways, including calling <TT CLASS="FUNCTION" >printf</TT > or <TT CLASS="FUNCTION" >diag_printf</TT >. When the I/O auxiliary is enabled 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 standard output, or to a logfile if the <TT CLASS="OPTION" >-l</TT > command line option is specified. If operating in graphical mode the output 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 text via the target definition file, and to install extra filters for certain types of text. </P ><P >It should be noted that the console device is line-oriented, not character-oriented. This means that outputting partial lines is not supported, and some functions such as <TT CLASS="FUNCTION" >fflush</TT > and <TT CLASS="FUNCTION" >setvbuf</TT > will not operate as expected. This limitation prevents much possible confusion when using filters to control the appearance of the text window, and has some performance benefits - especially when the eCos application generates a great deal 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 of. </P ><P >The console device is output-only, it does not provide any support for keyboard input. If the application requires keyboard input then that should be handled by a separate eCos device package and matching host-side code. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="SYNTH-CONSOLE-INSTALL" ></A ><H2 >Installation</H2 ><P >The eCos side of the console device is implemented by the architectural HAL itself, in the source file <TT CLASS="FILENAME" >synth_diag.c</TT >, rather than in a separate device package. Similarly the host-side implementation, <TT CLASS="FUNCTION" >console.tcl</TT >, is part of the architectural HAL's host-side support. It gets installed automatically alongside the I/O auxiliary itself, so no separate installation procedure is required. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="SYNTH-CONSOLE-TDF" ></A ><H2 >Target Definition File</H2 ><P >The <A HREF="synth-running.html#SYNTH-RUNNING-TDF" >target definition file</A > can contain a number of entries related to the console device. These are all optional, they only control the appearance of text output. If such control is desired then the relevant options should appear in the body of a <B CLASS="COMMAND" >synth_device</B > entry: </P ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >synth_device console { … }</PRE ></TD ></TR ></TABLE ><P >The first option is <B CLASS="COMMAND" >appearance</B >, used to control the appearance of any text generated by the eCos application that does not match one of the installed filters. This option takes the same argument as any other filter, for example: </P ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >synth_device console { appearance -foreground white -background black … }</PRE ></TD ></TR ></TABLE ><P >Any number of additional filters can be created with a <B CLASS="COMMAND" >filter</B > option, for example: </P ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >synth_device console { … filter trace {^TRACE:.*} -foreground HotPink1 -hide 1 … }</PRE ></TD ></TR ></TABLE ><P >The first argument gives the new filter a name which will be used in the <A HREF="synth-gui.html#SYNTH-GUI-TEXT" >filters dialog</A >. Filter names should be unique. The second argument is a Tcl regular expression. The console support will match each line of eCos output against this 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 output that begins with <TT CLASS="LITERAL" >TRACE:</TT >, which corresponds to the eCos infrastructure's tracing facilities. The remaining options control the desired appearance for matched text. If some eCos output matches the regular expressions for several different filters then only the first match will be used. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="SYNTH-CONSOLE-TARGET-CONFIG" ></A ><H2 >Target-side Configuration Options</H2 ><P >There are no target-side configuration options related to the console device. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="SYNTH-CONSOLE-ARGUMENTS" ></A ><H2 >Command Line Arguments</H2 ><P >The console device does not use any command-line arguments. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="SYNTH-CONSOLE-HOOKS" ></A ><H2 >Hooks</H2 ><P >The console device does not provide any hooks. </P ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN477" ></A ><H2 >Additional Tcl Procedures</H2 ><P >The console device does not provide any additional Tcl procedures that can be used by other scripts. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="synth-gui.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="hal-synth-arch.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="synth-syscalls.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >The I/O Auxiliary's User Interface</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >System Calls</TD ></TR ></TABLE ></DIV ></BODY ></HTML >
Go to most recent revision | Compare with Previous | Blame | View Log