.\" $NetBSD: console.4,v 1.1 2021/06/03 07:41:26 wiz Exp $
.\"
.Dd September 6, 2006
.Dt CONS 4 x86
.Os
.Sh NAME
.Nm console
.Nd x86 console interface
.Sh SYNOPSIS
.Cd options CONSDEVNAME=string
.Cd options CONADDR=integer
.Cd options CONSPEED=integer
.Cd options CONS_OVERRIDE
.Cd options CONMODE=integer
.Sh DESCRIPTION
The
.Dq console
device is used for
.Em kernel printf
messages and accesses to the
.Pa /dev/console
character special device in user mode.
It is attached to a hardware interface at boot time controlled by options
in the kernel configuration file, or information passed by the boot loader.
.Pp
Bootblocks from
.Nx 1.4
or newer select their console device from a compiled-in list,
and then pass their choice of console device and console parameters to
the kernel.
.Pp
As of
.Nx 1.5 ,
the
.Ic consdev
bootblock command allows changing the console device on-the-fly.
.Pp
The kernel will use the same console device as the
bootblock; no special kernel configuration is required.
.Pp
To override
the bootblock's choice of console, or to use a serial kernel console
with older bootblocks, you must specify kernel config-file options to
override the information passed by the bootblock.
The current option choices are:
.Bl -tag -width aaa
.It - the standard PC keyboard and display
(with either the
.Dq pc
or the
.Xr wscons 4
driver)
.It - standard PC serial ports
(with
.Xr com 4
driver)
.El
.Pp
The available
.Em kernel configuration
options are:
.Bl -ohang
.It Cd options CONSDEVNAME=string
specifies the name of the console device.
Valid values are
.Dq pc
for the pc keyboard / display (default)
and
.Dq com
for a serial port.
.It Cd options CONADDR=integer
sets the base address for the serial console port (default: 0x3f8).
.It Cd options CONSPEED=integer
sets the baudrate for the serial console (default: 9600).
.It Cd options CONS_OVERRIDE
causes console information passed by the bootloader to be ignored and
the settings specified by the three options above (or the defaults) to be
used.
Default behaviour is to use the settings from the bootloader if
present, and to use option / default values only if no information was
passed.
.It Cd options CONMODE=integer
allows to specify terminal control flags.
The argument is a
.Dq cflag
value, see
.Xr termios 4
for details.
Default is
.Li ( CREAD | CS8 | HUPCL )
(8N1).
This option takes always effect, because mode settings are not passed
by the bootloader.
.El
.Sh FILES
.Bl -tag -width /dev/console
.It Pa /dev/console
.El
.Sh EXAMPLES
.Cd options CONSDEVNAME=\&"\e"com\e"\&",CONADDR=0x2f8,CONSPEED=57600
.Sh SEE ALSO
.Xr config 1 ,
.Xr tty 4 ,
.Xr boot 8
.Sh BUGS
The console device is chosen early in system startup regardless
if the specified driver / device is present in the system configuration file.
If the driver asked for by the bootloader or
.Dq Cd options CONSDEVNAME
is not configured into the system, a panic is caused.
Because there is
no console device, no explaining message will be printed.
If the driver is present, but the specific device instance not, kernel
printf will work, but
.Pa /dev/console
becomes a dummy.