[ECOS] Help: How to get Keyboard input in synthetic environmet?

Zhangzheng zzhang@acornsoftcorp.com
Thu Mar 20 11:51:00 GMT 2003


    Thanks for your answers!
    I have tried this way, and my application can read characters from stdin
in Linux terminal not in the synthetic console. And it doesn't like a normal
CLI cause the input and output is seperated in two consoles.
    As there are no interrupt associated with the stdin, it seems that other
threads in my application will be blocked by the waiting of stdin.
   If I asign a much lower priority to the CLI session, do the other threads
can work properly?

  Thanks a lot!


>> 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.
>*simple* is important here and probably not want he wants in a
>CLI. The unix stdin will still be in cooked mode which may cause
>          Andrew

= = = = = = = = = = = = = = = = = = = =

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list