1.\" Copyright (c) 1997, 1998 2.\" Nick Hibma <hibma@skylink.it>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by Bill Paul. 15.\" 4. Neither the name of the author nor the names of any co-contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY NICK HIBMA AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL NICK HIBMA OR THE VOICES IN HIS HEAD 23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 29.\" THE POSSIBILITY OF SUCH DAMAGE. 30.\" 31.\" $FreeBSD$ 32.\" $FreeBSD$ 33.\" 34.Dd April 11, 1999 35.Dt UKBD 4 i386 36.Os FreeBSD 37.Sh NAME 38.Nm ukbd 39.Nd USB keyboard driver 40.Sh SYNOPSIS 41.Cd "device ukbd0" 42.Sh DESCRIPTION 43The 44.Nm 45driver provides support for keyboards that attach to the USB port. 46.Nm usb 47and one of 48.Nm uhci 49or 50.Nm ohci 51must be configured in the kernel as well. 52.Sh CONFIGURATION 53By default the keyboard subsystem does not create the appropriate devices yet. 54Make sure you configure compile the kernel with the following option in the 55kernel config file: 56.Bd -literal -offset indent 57options "KBD_INSTALL_CDEV" 58.Ed 59.Pp 60Go to /dev and make device nodes kbd*: 61.Bd -literal -offset indent 62sh MAKEDEV kbd0 kbd1 63.Ed 64.Pp 65If both an AT keyboard as well as USB keyboards are used at the same time, the 66AT keyboard will appear as kbd0 in /dev. The USB keyboards will be kbd1, kbd2, 67etc. You can see some information about the keyboard with the following command: 68.Bd -literal -offset indent 69kbdcontrol -i < /dev/kbd1 70.Ed 71.Pp 72or load a keymap with 73.Bd -literal -offset indent 74kbdcontrol -l keymaps/pt.iso < /dev/kbd1 75.Ed 76.Pp 77See 78.Nm kbcontrol 79for more possible options. 80.Pp 81You can swap console keyboards by using the command 82.Bd -literal -offset indent 83kbdcontrol -k /dev/kbd1 84.Ed 85.Pp 86From this point on onwards the first USB keyboard will be the keyboard 87to be used as the console. 88.Pp 89If you want to use a USB keyboard as your default and not use an AT keyboard at 90all, you will have to remove the 91.Nm atkbd0 92from the kernel configuration file. Because of the order of the device 93initialisation, the USB keyboard will be detected AFTER the console driver 94initialises itself and you have to explicitly tellthe console 95driver to use the existence of the USB keyboard. This can be done in 96one of the following two ways. 97.Pp 98Run the following command as a part of system initialization: 99.Bd -literal -offset indent 100kbdcontrol -k /dev/kbd0 < /dev/ttyv0 > /dev/null 101.Ed 102.Pp 103(Note that as the USB keyboard is the only keyboard, it is accessed as 104/dev/kbd0) or otherwise tell the console driver to periodically look for a 105keyboard by setting a flag in the kernel configuration file: 106.Bd -literal -offset indent 107device sc0 at isa? flags 0x100 108.Ed 109.Pp 110With the above flag, the console driver will try to detect any 111keyboard in the system if it didn't detect one while it was 112initialized at boot time. 113.Sh DRIVER CONFIGURATION 114.Bd -literal -offset indent 115options "KBD_INSTALL_CDEV" 116.Ed 117.Pp 118Make the keyboards available through a character device in /dev 119.Bd -literal -offset indent 120options "UKBD_DFLT_KEYMAP" 121makeoptions "UKBD_DFLT_KEYMAP=fr.iso" 122.Ed 123.Pp 124The above lines will put the French ISO keymap in the ukbd driver. 125You can specify any keymap in /usr/share/syscons/keymaps with this 126option. 127.Bd -literal -offset indent 128options "KBD_DISABLE_KEYMAP_LOADING" 129.Ed 130.Pp 131Don't allow the user to change the keymap. Note that this options 132also has effect on the AT keyboard driver `atkbd'. 133.Sh FILES 134.Bl -tag -width /dev/kbd0 -compact 135.It Pa /dev/kbd* 136blocking device nodes 137.Sh EXAMPLE 138.Bd -literal -offset indent 139device ukbd0 140.Ed 141.Pp 142Add the 143.Nm ukbd 144driver to the kernel. 145.Sh SEE ALSO 146.Xr kbdcontrol 1 , 147.Xr ohci 4 , 148.Xr syscons 4 , 149.Xr uhci 4 , 150.Xr usb 4 , 151.Xr config 8 152.\".Sh HISTORY 153.Sh AUTHORS 154The 155.Nm ukbd 156driver was written by 157.An Lennart Augustsson Aq augustss@cs.chalmers.se 158for 159.Nx 160and was substantially rewritten for 161.Fx 162by 163.An Kazutaka YOKOTA Aq yokota@zodiac.mech.utsunomiya-u.ac.jp . 164.Pp 165This manual page was written by 166.An Nick Hibma Aq hibma@skylink.it 167with a large amount of input from 168.An Kazutaka YOKOTA Aq yokota@zodiac.mech.utsunomiya-u.ac.jp . 169