CONS(9) | Kernel Developer's Manual | CONS(9) |
cnbell
, cnflush
,
cngetc
, cngetsn
,
cnhalt
, cnpollc
,
cnputc
—
#include <dev/cons.h>
void
cnbell
(u_int
pitch, u_int
period, u_int
volume);
void
cnflush
(void);
int
cngetc
(void);
int
cngetsn
(char
*cp, int size);
void
cnhalt
(void);
void
cnpollc
(int
on);
void
cnputc
(int
c);
Console input polling functions cngetc
(),
cngetsn
() and cnpollc
() are
only to be used during initial system boot, e.g., when asking for root and
dump device or to get necessary user input within mountroothooks. Once the
system boots, user input is read via standard
tty(4) facilities.
The following is a brief description of each function:
cnbell
()cnflush
()cngetc
()cnpollc
()
must be called before cngetc
()
could be used. cngetc
() should be used during
kernel startup only.cngetsn
()cnpollc
() and
cngetc
(). Number of read characters is
size at maximum, user is notified by console bell
when the end of input buffer is reached. <Backspace> key works as
expected. <@> or <CTRL>-u make
cngetsn
() discard input read so far, print newline
and wait for next input. cngetsn
() returns number
of characters actually read, excluding the final newline.
cp is not zero-ended before
return. cngetsn
() should be used during kernel
startup only.cnhalt
()cnpollc
()cnpollc
() should be used during kernel
startup only.cnputc
()int c; cnpollc(1); for(;;) { c = cngetc(); if ((c == '\r' || (c == '\n')) { printf("\n"); break; } } cnpollc(0);
June 8, 2010 | NetBSD 9.0 |