cvs commit: src/sys/dev/kbdmux kbdmux.c

Ruslan Ermilov ru at
Wed Sep 20 09:22:42 PDT 2006

Here's another demo that indicates that sparc64 doesn't work
properly.  In this case it's a CONS_SETKBD ioctl which is used
by kbdcontrol(8).  I "kldload vkbd" and make sure two vkbd
instances exist, /dev/vkbdctl0 and /dev/vkbdctl1.

Now, I open the first like this:

sleep 1200 < /dev/vkbdctl0

and attempt to program /dev/vkbdctl1 as a keyboard for
virtual terminals.  On amd64, I get:

# kbdcontrol -K < /dev/ttyv0 > /dev/null ; kbdcontrol -k /dev/vkbdctl1 -i < /dev/ttyv0
kbd2 at vkbd1
    vkbd1, type:generic (0)
    vkbd1, type:generic (0)

It's fine; the "-i" returns the same console as as was programmed.

On sparc64, I get:

# kbdcontrol -K < /dev/ttyv0 > /dev/null ; kbdcontrol -k /dev/vkbdctl1 -i < /dev/ttyv0
    vkbd1, type:generic (0)
    vkbd0, type:generic (0)

Surprise!  It assigned already open (by sleep(1)) vkbd0 while I
asked for vkbd1.

Oh yes, if you ever want to repeat this, make sure to temporary
apply this patch to kbdcontrol.c, because vkbd is only valid
when it's open:

Index: kbdcontrol.c
RCS file: /home/ncvs/src/usr.sbin/kbdcontrol/kbdcontrol.c,v
retrieving revision 1.50
diff -u -p -r1.50 kbdcontrol.c
--- kbdcontrol.c	15 Sep 2006 18:41:12 -0000	1.50
+++ kbdcontrol.c	20 Sep 2006 16:18:48 -0000
@@ -1046,7 +1046,9 @@ set_keyboard(char *device)
 	 * is closed.  So, we don't check error here.
 	ioctl(fd, CONS_RELKBD, 0);
+#if 0
 #if 1
 	printf("kbd%d\n", info.kb_index);
 	printf("    %.*s%d, type:%s (%d)\n",

What this means practically is that currently, on sparc64, you
can only have a /dev/kbd0 keyboard attached to a syscons console.

A fix is in the works...

Ruslan Ermilov
ru at
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the cvs-src mailing list