get one character of input during debug
function is used when debugging a driver
to temporarily halt execution of the kernel,
and get one character of input from a user.
getchar returns the character typed at the keyboard.
returns a single character from the keyboard.
The character is automatically echoed.
The only other processing done on this character is to map
<Return> to <Return>/<Line feed> on output.
When you have many lines of
output, inserting getchar
statements into your driver is one of the better ways to regulate
the output flow of messages.
A second use of getchar is to set the level of debugging.
For example, you could place
two lines of code at the beginning of the
entry point routine
to set the current
value of mydebugflg to anywhere between 0 and 9.
mydebugflg = getchar();
mydebugflg -= '0';
Context and synchronization
Non-blockable, user or blockable
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
SVR5 DDI compatibility
This function is not supported for DDI drivers.
The following example gets a character (assumed to be numeric) and
converts it to the corresponding integer:
debug = getchar();
debug -= '0';
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005