This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help: How to get Keyboard input in synthetic environmet?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]