This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: getting a char from the keyboard
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: Re: [ECOS] getting a char from the keyboard
- From: Nick Garnett <nickg at cygnus dot co dot uk>
- Date: 22 Nov 2000 12:28:38 +0000
- Newsgroups: cygnus.sourceware.ecos.d
- Organization: Red Hat UK
- References: <8F1D166D08ACD41196EE00B0D020944B21A442@CTSINENTSXUB>
"Narayanan, Anita (CTS)" <Nanita@DBSS.COM> writes:
> Hi everybody,
>
> Again making a desperate attempt to get a solution for my problem which is
> "getting a character from the keyboard".
> I have tried using scanf, fgetc, gets but it simply wouldn't work.
>
> Iam using i386 as my target.
>
> Somebody, please help me out!!!!
>
>
eCos support is aimed mainly at embedded applications which do not
have screens or keyboards, so the only mechanism for using the PC
keyboard is in the diagnostic IO code.
If you enable CYGSEM_HAL_I386_PC_DIAG_SCREEN then you can use
hal_diag_read_char() to get characters from the keyboard. You might
even be able to use the "/dev/haldiag" device driver with the C
library primitives, but this has not been tested.
The keyboard input is polled, so you will only get characters when you
are actually waiting for them.
--
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK