The console device, Name, Description – Comtrol eCos User Manual
Page 765: Installation, Target definition file

The Console Device
Name
The console device
— Show output from the eCos application
Description
The eCos application can generate text output in a variety of ways, including calling
printf
or
diag_printf
.
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
-l
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.
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
fflush
and
setvbuf
will not operate as expected. This limi-
tation 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.
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.
Installation
The eCos side of the console device is implemented by the architectural HAL itself, in the source file
synth_diag.c
, rather than in a separate device package. Similarly the host-side implementation,
console.tcl
,
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.
Target Definition File
The
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 synth_device entry:
synth_device console {
...
}
The first option is appearance, 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:
synth_device console {
appearance -foreground white -background black
...
}
661