next up previous contents index
Next: 10.13.1 base_console.h: definitions for Up: 10 Kernel Support Library: Previous: 10.12.8 base_irq_softint_handler: handler for

(X86 PC) Base Environment: Console Support

   

The base console environment allows ``console'' input and output using either the display and keyboard or a serial line. Additionally it allows a remote kernel debugging with GDB over a serial line. Selection of the display or serial port as console and which serial ports to use for the console and GDB are controlled by command line options or environment variables as described in this section.

The base console environment uses a simple polled interface for serial port input and output as well as for keyboard input. The video display output interface is a simple, dumb text terminal. See the appropriate sections for details.

In the base interface, all input via stdin (e.g., getchar, scanf) and all output via stdout or stderr (e.g., putchar, printf) use the console.

For simplicity, a set of vanilla console functions is provided that direct input and output to/from the appropriate device. For example, console_putchar will invoke com_cons_putchar if the console device is a serial port, or direct_cons_putchar if the console device is a display. Other vanilla console I/O routines include console_getchar, console_puts, and console_putbytes (a raw block output function that does not append a newline). All behave as expected. These routines are provided to so that higher level I/O code does not need to be concerned with which type of device is currenty the console. Both the minimal C library (section 9) and the FreeBSD C library (section 13) take advantage of this redirection.





University of Utah Flux Research Group