This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Help: How to get Keyboard input in synthetic environmet?
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Cc: Zhangzheng <zzhang at acornsoftcorp dot com>,eCos_discuss <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 20 Mar 2003 11:06:26 +0000
- Subject: Re: [ECOS] Help: How to get Keyboard input in synthetic environmet?
- References: <200303192143125.SM00183@Longbow> <20030320080449.GP17373@biferten.ma.tech.ascom.ch>
Andrew Lunn wrote:
1On Thu, Mar 20, 2003 at 01:51:06PM +0800, Zhangzheng wrote:
Hi, everyone:
I need your helps on eCos synthtic console.
I am trying to port an application about Command Line Interface to the eCos synthetic
environment in RH8.0. Now I can drive the ethernet and output messages to the console.
But from the documentation I know that the console only support the output now, and I
didn't find any TCL files that support keyboard input.
Would you tell me how can I get the keyboard input from synthetic(except the telnet)?
What you need to do is write a synthetic serial driver. You can then
bind this to either a real serial port on your host, or to a pty. You
can then use a terminal emulator to give you a console.
That's useful, although right now if you want *simple* input and don't
mind things like busy waits, you should already be able to use the
existing libc functions as-is; because deep down in the HAL there is:
void hal_diag_read_char(char *c)
{
int rc;
do {
rc = cyg_hal_sys_read(0, c, 1);
} while ((-CYG_HAL_SYS_EINTR == rc) || (-CYG_HAL_SYS_EAGAIN == rc));
}
i.e. it does a read() of stdin.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss