.\" Contributed to 386bsd 0.1 and later versions
.\" Copyright 1992,1993 by Holger Veit
.\" May be freely used with Bill Jolitz's port of
.\" 386bsd and may be included in a 386bsd collection
.\" as long as binary and source are available and reproduce the above
.\" You may freely modify this code and contribute improvements based
.\" on this code as long as you don't claim to be the original author.
.\" Commercial use of this source requires permittance of the copyright
.\" holder. A general license for 386bsd will override this restriction.
.\" Use at your own risk. The copyright holder or any person who makes
.\" this code available for the public (administrators of public archives
.\" for instance) are not responsible for any harm to hardware or software
.\" that might happen due to wrong application or program faults.
.\" You must have the codriver driver in the same package generated
.\" into the 386bsd kernel, otherwise this program does not work.
.\" @(#)co.4 1.1 (contributed to 386bsd) 06/05/92
.Cd device co0 at isa? port 0x60 tty "irq 1 vector cointr"
.Fd #include <sys/ioctl.h>
.Fd #include <sys/ioctl_pc.h>
console driver (also called
replaces the old outdated
console driver. Several features and improvements have been built in:
IBM AT key numbering scheme, not the incompatible and complex
XFree86 1.2 and greater support
National language keyboard support (see
including overloadable keys (any key, not only function keys)
Programmable keyboard repetition rate ("typematic")
Programmable keyboard LEDs
Programmable Beep (pitch and duration)
Recognition of several SVGA cards, recognition of MDA/CGA/EGA/VGA
Programmable cursor shape
Standard ISO-Latin 1 character set
Loadable national font (in addition to standard Latin 1)
Programmable screen blanking
Multiple virtual tty support
The console driver is a single interrupt driver which is divided into a
number of logical and physical devices:
.Bl -tag -width /dev/console -compact
The console interface. This device behaves like a tty device, and delivers
7/8 bit ASCII characters on request.
Switchable virtual terminals (vty's, often also called
virtual consoles). Up to 12 may be generated in the
kernel. Any of them may be monitored by
The console redirector. This is the console switcher in the closer sense.
When the keyboard/video is present, it redirects console requests to the
device, otherwise to the first available serial interface. The
devices should not be confused, the first is a physically existing unit, the
second one is a logical redirecting device. When accessing the console,
.Pa /dev/tty00 to a getty (e.g. in /etc/ttys).
The raw keynum device. This device is noramlly opened by the XServer (see
only; this device is exclusive and suppresses input from
The video device. In the current version of
are basically the same device, however,
is not exclusive, but does not allow reading keystrokes from the keyboard.
All devices share the same set of ioctl functions as described below, but
this may change in the future. For compatibility,
related ioctls (e.g. TIOC*, CONS*) should be applied to
related ioctls (KBD*, CONS*) to
related ones (VGA*, CONS*) to
The following set of ioctls is understood. For the exact calling convention
.Pa /usr/include/sys/ioctl_pc.h .
are not recommended for general use and lead to unexpected effects.
.Bl -tag -width #CONSOLE_X_MODE_OFF -compact
Get console capabilities flags
Reset the keyboard (default keymap, default repeat rate)
Reset the keyboard controller only (not general use)
Get current key repetition rate information
Set new key repetition rate
Get current key repetition flag (allows entirely disabling repetition)
Set new key repetition flag (allows entirely disabling repetition)
Get keyboard LED status (NumLock, CapsLock, ScrollLock)
Set keyboard LED status (NumLock, CapsLock, ScrollLock)
Get keyboard lock key status (NumLock, CapsLock, ScrollLock,
Set keyboard lock key status (NumLock, CapsLock, ScrollLock,
Get the current beep pitch and duration (for actual or any vty)
Set the current beep pitch and duration (for actual or any vty)
Play a tone of given pitch and duration
Get current keymap for a single key
Set new keymap for a single key
Get original (default) keymap for a single key
Remove a single key assignment
Remove all key assignments
Get the behaviour of the CAPSLOCK LED.
Set the behaviour of the CAPSLOCK LED to follow the CapsLock,
ShiftLock or AltGrLock state.
Get the behaviour of a "hot key" (a key processed before the
normal ASCII interpretation)
Set the behaviour of a "hot key"
Set XServer mode (priviledged and not for general use)
Set XServer mode (priviledged, compatibility, may disappear in future)
Set XServer mode (priviledged, compatibility, may disappear in future)
Get display blanking timeout
Set display blanking timeout
Get a rectangular area of text screen
Set a rectangular area of text screen
Load a font into video memory (EGA or better only)
Read a font from video memory (EGA or better only)
Signal to the kernel that process wants exclusive access to the video
Signal to the kernel that process releases video resource
.Bl -tag -width /sys/i386/isa/codrv/co_codrv1.c -compact
.It Pa /sys/i386/isa/codrv/co_cons.c
Console tty support kernel routines
.It Pa /sys/i386/isa/codrv/co_kbd.c
.It Pa /sys/i386/isa/codrv/co_vga.c
.It Pa /sys/i386/isa/codrv/co_codrv1.c
.It Pa /sys/i386/isa/codrv/co_pc3.c
.It Pa /sys/i386/isa/codrv/co_vty.c
.It Pa /usr/share/misc/keycap
standard keyboard capability data base
driver was derived from the
driver and was heavily modified since then.
The terminal emulation is still "pc3", for compatibility issues, and
may be changed in future.
The naming convention VGA* is misleading, although VGA cards have become
cheap enough to be standard even in low cost systems.
Much is still under construction.