xref: /freebsd/share/man/man4/ukbd.4 (revision 0fddbf874719b9bd50cf66ac26d1140bb3f2be69)
1.\" Copyright (c) 1997, 1998
2.\"	Nick Hibma <n_hibma@FreeBSD.org>. 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.\"
33.Dd April 11, 1999
34.Dt UKBD 4
35.Os
36.Sh NAME
37.Nm ukbd
38.Nd USB keyboard driver
39.Sh SYNOPSIS
40.Cd "device ukbd"
41.Sh DESCRIPTION
42The
43.Nm
44driver provides support for keyboards that attach to the USB port.
45.Nm usb
46and one of
47.Nm uhci
48or
49.Nm ohci
50must be configured in the kernel as well.
51.Sh CONFIGURATION
52By default the keyboard subsystem does not create the appropriate devices yet.
53Make sure you reconfigure your kernel with the following option in the kernel
54config file:
55.Bd -literal -offset indent
56options KBD_INSTALL_CDEV
57.Ed
58.Pp
59Go to /dev and make device nodes kbd*:
60.Bd -literal -offset indent
61sh MAKEDEV kbd0 kbd1
62.Ed
63.Pp
64If both an AT keyboard as well as USB keyboards are used at the same time, the
65AT keyboard will appear as kbd0 in /dev.
66The USB keyboards will be kbd1, kbd2,
67etc.
68You can see some information about the keyboard with the following command:
69.Bd -literal -offset indent
70kbdcontrol -i < /dev/kbd1
71.Ed
72.Pp
73or load a keymap with
74.Bd -literal -offset indent
75kbdcontrol -l keymaps/pt.iso < /dev/kbd1
76.Ed
77.Pp
78See
79.Nm kbcontrol
80for more possible options.
81.Pp
82You can swap console keyboards by using the command
83.Bd -literal -offset indent
84kbdcontrol -k /dev/kbd1
85.Ed
86.Pp
87From this point on onwards the first USB keyboard will be the keyboard
88to be used as the console.
89.Pp
90If you want to use a USB keyboard as your default and not use an AT keyboard at
91all, you will have to remove the
92.Nm atkbd
93from the kernel configuration file.
94Because of the order of the device
95initialisation, the USB keyboard will be detected AFTER the console driver
96initialises itself and you have to explicitly tellthe console
97driver to use the existence of the USB keyboard.  This can be done in
98one of the following two ways.
99.Pp
100Run the following command as a part of system initialization:
101.Bd -literal -offset indent
102kbdcontrol -k /dev/kbd0 < /dev/ttyv0 > /dev/null
103.Ed
104.Pp
105(Note that as the USB keyboard is the only keyboard, it is accessed as
106/dev/kbd0) or otherwise tell the console driver to periodically look for a
107keyboard by setting a flag in the kernel configuration file:
108.Bd -literal -offset indent
109device sc0 at isa? flags 0x100
110.Ed
111.Pp
112With the above flag, the console driver will try to detect any
113keyboard in the system if it didn't detect one while it was
114initialized at boot time.
115.Sh DRIVER CONFIGURATION
116.Bd -literal -offset indent
117options KBD_INSTALL_CDEV
118.Ed
119.Pp
120Make the keyboards available through a character device in /dev
121.Bd -literal -offset indent
122options UKBD_DFLT_KEYMAP
123makeoptions "UKBD_DFLT_KEYMAP=fr.iso"
124.Ed
125.Pp
126The above lines will put the French ISO keymap in the ukbd driver.
127You can specify any keymap in /usr/share/syscons/keymaps with this
128option.
129.Bd -literal -offset indent
130options KBD_DISABLE_KEYMAP_LOADING
131.Ed
132.Pp
133Don't allow the user to change the keymap.
134Note that these options also affect the AT keyboard driver
135.Xr atkbd 4 .
136.Sh FILES
137.Bl -tag -width /dev/kbd0 -compact
138.It Pa /dev/kbd*
139blocking device nodes
140.El
141.Sh EXAMPLES
142.Bd -literal -offset indent
143device ukbd
144.Ed
145.Pp
146Add the
147.Nm
148driver to the kernel.
149.Sh SEE ALSO
150.Xr kbdcontrol 1 ,
151.Xr ohci 4 ,
152.Xr syscons 4 ,
153.Xr uhci 4 ,
154.Xr usb 4 ,
155.Xr config 8
156.\".Sh HISTORY
157.Sh AUTHORS
158.An -nosplit
159The
160.Nm
161driver was written by
162.An Lennart Augustsson Aq augustss@cs.chalmers.se
163for
164.Nx
165and was substantially rewritten for
166.Fx
167by
168.An Kazutaka YOKOTA Aq yokota@zodiac.mech.utsunomiya-u.ac.jp .
169.Pp
170This manual page was written by
171.An Nick Hibma Aq n_hibma@FreeBSD.org
172with a large amount of input from
173.An Kazutaka YOKOTA Aq yokota@zodiac.mech.utsunomiya-u.ac.jp .
174