12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CONS (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> CONS (9)<strong>NAME</strong>cnbell, cnflush, cngetc, cngetsn, cnhalt, cnpollc, cnputc —console access interfaceSYNOPSIS#include voidcnbell(u_int pitch , u_int period , u_int volume);voidcnflush(void);intcngetc(void);intcngetsn(char ∗cp , int size);voidcnhalt(void);voidcnpollc(int on);voidcnputc(int c);DESCRIPTIONThese functions operate over the current console device. The console must be initialized before these functionscan be used.Console input polling functions cngetc(), cngetsn() and cnpollc() are only to be used during initialsystem 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()cngetsn()cnhalt()cnpollc()Ring a bell at appropriate pitch, for duration of period milliseconds at given volume.Note that the volume value is ignored commonly.Waits for all pending output to finish.Poll (busy wait) for an input and return the input key. Returns 0 if there is no console inputdevice. cnpollc() must be called before cngetc() could be used. cngetc() should beused during kernel startup only.Read one line of user input, stop reading once the newline key is input. Input is echoed back.This uses cnpollc() and cngetc(). Number of read characters is size at maximum, useris notified by console bell when the end of input buffer is reached. key works asexpected. or -u make cngetsn() discard input read so far, print newline andwait for next input. cngetsn() returns number of characters actually read, excluding thefinal newline. cp is not zero-ended before return. cngetsn() should be used during kernelstartup only.Terminates the console device (i.e. cleanly shuts down the console hardware.)Switch the console driver topolling mode if on is nonzero, or back to interrupt driven mode ifon is zero. cnpollc() should be used during kernel startup only.<strong>NetBSD</strong> 3.0 April 1, 2003 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!