next up previous contents index
Next: 10.13.8 com_cons_init: initialize a Up: (X86 PC) Base Environment: Previous: 10.13.6 direct_cons_putchar: write a

10.13.7 direct_cons_trygetchar: read an available character from the keyboard

   

SYNOPSIS

#include <oskit/x86/pc/direct_console.h>

int direct_cons_trygetchar(void);

DESCRIPTION

Quick poll for an available input character. Returns a character or -1 if no character was available.

Due to the large delay between when a character is typed and when the scan code arrives at the keyboard controller (4-5 ms), there are a variety of situations in which this routine may return -1 even though a character has been typed:

In other words, this routine never delays in an attempt to wait for the next scan code to arrive when one is not currently available. Hence the utility of this routine is questionable.

RETURNS

Returns a character if available, -1 otherwise.

DEPENDENCIES

base_critical_enter
10.2.5
base_critical_leave
10.2.5
inb
10.3.7



University of Utah Flux Research Group