Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen Add keyboard support and wscons config options.



details:   https://anonhg.NetBSD.org/src/rev/398d51316f7f
branches:  trunk
changeset: 565980:398d51316f7f
user:      cl <cl%NetBSD.org@localhost>
date:      Sat Apr 24 21:33:32 2004 +0000

description:
Add keyboard support and wscons config options.

diffstat:

 sys/arch/xen/conf/GENERIC        |   41 +++++-
 sys/arch/xen/conf/XEN            |   17 ++-
 sys/arch/xen/conf/files.compat   |    3 +-
 sys/arch/xen/conf/files.xen      |    8 +-
 sys/arch/xen/include/xenkbcvar.h |   49 +++++++
 sys/arch/xen/xen/hypervisor.c    |   18 ++-
 sys/arch/xen/xen/xenkbc.c        |  272 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 400 insertions(+), 8 deletions(-)

diffs (truncated from 554 to 300 lines):

diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/conf/GENERIC
--- a/sys/arch/xen/conf/GENERIC Sat Apr 24 21:01:37 2004 +0000
+++ b/sys/arch/xen/conf/GENERIC Sat Apr 24 21:33:32 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.6 2004/04/24 20:58:59 cl Exp $
+# $NetBSD: GENERIC,v 1.7 2004/04/24 21:33:32 cl Exp $
 # NetBSD: GENERIC,v 1.596 2004/04/07 13:13:59 augustss Exp 
 #
 # GENERIC machine description file
@@ -23,7 +23,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.6 $"
+#ident                 "GENERIC-$Revision: 1.7 $"
 
 maxusers       32              # estimated number of users
 
@@ -185,6 +185,37 @@
 #options       NFS_BOOTSTATIC_SERVADDR="\"169.254.1.1\""
 #options       NFS_BOOTSTATIC_SERVER="\"server:/path/to/root\""
 
+#
+# wscons options
+#
+# builtin terminal emulations
+#options       WSEMUL_SUN              # sun terminal emulation
+options        WSEMUL_VT100            # VT100 / VT220 emulation
+# different kernel output - see dev/wscons/wsdisplayvar.h
+options        WS_KERNEL_FG=WSCOL_GREEN
+#options       WS_KERNEL_BG=WSCOL_BLACK
+# compatibility to other console drivers
+options        WSDISPLAY_COMPAT_PCVT           # emulate some ioctls
+options        WSDISPLAY_COMPAT_SYSCONS        # emulate some ioctls
+options        WSDISPLAY_COMPAT_USL            # VT handling
+options        WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
+# see dev/pckbc/wskbdmap_mfii.c for implemented layouts
+#options       PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
+# allocate a number of virtual screens at autoconfiguration time
+#options       WSDISPLAY_DEFAULTSCREENS=4
+# use a large software cursor that doesn't blink
+options        PCDISPLAY_SOFTCURSOR
+# modify the screen type of the console; defaults to "80x25"
+#options       VGA_CONSOLE_SCREENTYPE="\"80x24\""
+# work around a hardware bug that loaded fonts don't work; found on ATI cards
+#options       VGA_CONSOLE_ATI_BROKEN_FONTSEL
+# the following enables some functions to get mouse console support.
+# if you want a really secure system, it may be better not to enable them,
+# see wsmoused(8), section SECURITY CONSIDERATIONS for more info.
+#options       WSDISPLAY_CHARFUNCS             # mouse console support
+# enable VGA raster mode capable of displaying multilingual text on console
+#options       VGA_RASTERCONSOLE
+
 # Kernel root file system and dump configuration.
 config         netbsd  root on ? type ?
 #config                netbsd  root on wd0a type ffs
@@ -210,7 +241,11 @@
 sd*            at hypervisor?          # Xen vbd (sd identity)
 cd*            at hypervisor?          # Xen vbd (cd identity)
 
+xenkbc*        at hypervisor?          # Xen keyboard/mouse interface
+pckbd*         at xenkbc?              # Keyboard
 vga*           at hypervisor?          # Xen VGA display
+
+wskbd*         at pckbd? console ?
 wsdisplay*     at vga? console ?
 
 
@@ -276,4 +311,6 @@
 # a pseudo device needed for SMBFS
 pseudo-device  nsmb                    # experimental - SMB requester
 
+pseudo-device  wsmux                   # mouse & keyboard multiplexor
+pseudo-device  wsfont
 pseudo-device  ksyms                   # /dev/ksyms
diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/conf/XEN
--- a/sys/arch/xen/conf/XEN     Sat Apr 24 21:01:37 2004 +0000
+++ b/sys/arch/xen/conf/XEN     Sat Apr 24 21:33:32 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: XEN,v 1.6 2004/04/24 20:58:59 cl Exp $
+# $NetBSD: XEN,v 1.7 2004/04/24 21:33:32 cl Exp $
 
 include        "arch/xen/conf/std.xen"
 
@@ -107,6 +107,15 @@
 #options       NFS_BOOTSTATIC_SERVADDR="\"169.254.1.1\""
 #options       NFS_BOOTSTATIC_SERVER="\"server:/path/to/root\""
 
+options        WSEMUL_VT100            # VT100 / VT220 emulation
+options        WS_KERNEL_FG=WSCOL_GREEN
+options        WSDISPLAY_COMPAT_PCVT           # emulate some ioctls
+options        WSDISPLAY_COMPAT_SYSCONS        # emulate some ioctls
+options        WSDISPLAY_COMPAT_USL            # VT handling
+options        WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
+options        WSDISPLAY_DEFAULTSCREENS=4
+options        PCDISPLAY_SOFTCURSOR
+
 config         netbsd  root on ? type ?
 #config                netbsd  root on wd0a type ffs
 #config                netbsd  root on xennet0 type nfs
@@ -127,7 +136,11 @@
 sd*            at hypervisor?          # Xen vbd (sd identity)
 cd*            at hypervisor?          # Xen vbd (cd identity)
 
+xenkbc*        at hypervisor?          # Xen keyboard/mouse interface
+pckbd*         at xenkbc?              # Keyboard
 vga*           at hypervisor?          # Xen VGA display
+
+wskbd*         at pckbd? console ?
 wsdisplay*     at vga? console ?
 
 
@@ -154,4 +167,6 @@
 pseudo-device  rnd                     # /dev/random and in-kernel generator
 pseudo-device  clockctl                # user control of clock subsystem
 
+pseudo-device  wsmux                   # mouse & keyboard multiplexor
+pseudo-device  wsfont
 pseudo-device  ksyms                   # /dev/ksyms
diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/conf/files.compat
--- a/sys/arch/xen/conf/files.compat    Sat Apr 24 21:01:37 2004 +0000
+++ b/sys/arch/xen/conf/files.compat    Sat Apr 24 21:33:32 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.compat,v 1.2 2004/04/24 20:58:59 cl Exp $
+#      $NetBSD: files.compat,v 1.3 2004/04/24 21:33:32 cl Exp $
 #      NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 
 # options for MP configuration through the MP spec
@@ -22,7 +22,6 @@
 defflag        mca.h                   XXXMCA
 defflag        ega.h                   XXXEGA
 defflag        pcdisplay.h             XXXPCDISPLAY
-defflag        pckbd.h                 XXXPCKBD
 defflag        pc.h                    XXXPC
 defflag        ukbd.h                  XXXUKBD
 defflag        bios32.h                XXXBIOS32
diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/conf/files.xen
--- a/sys/arch/xen/conf/files.xen       Sat Apr 24 21:01:37 2004 +0000
+++ b/sys/arch/xen/conf/files.xen       Sat Apr 24 21:33:32 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.xen,v 1.9 2004/04/24 20:58:59 cl Exp $
+#      $NetBSD: files.xen,v 1.10 2004/04/24 21:33:32 cl Exp $
 #      NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #      NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -123,6 +123,8 @@
 include        "dev/wscons/files.wscons"
 include        "dev/wsfont/files.wsfont"
 
+include        "dev/pckbport/files.pckbport"
+
 # CPUS
 
 define cpu { [apid = -1] }
@@ -211,6 +213,10 @@
 device cd: disk
 attach cd at hypervisor
 
+# Keyboard
+device xenkbc: pckbport
+attach xenkbc at hypervisor
+file   arch/xen/xen/xenkbc.c           xenkbc          needs-flag
 
 # Generic VGA
 attach vga at hypervisor with vga_xen
diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/include/xenkbcvar.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/xen/include/xenkbcvar.h  Sat Apr 24 21:33:32 2004 +0000
@@ -0,0 +1,49 @@
+/* $NetBSD: xenkbcvar.h,v 1.1 2004/04/24 21:33:32 cl Exp $ */
+
+/*
+ *
+ * Copyright (c) 2004 Christian Limpach.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christian Limpach.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef _XEN_XENKBCVAR_H_
+#define _XEN_XENKBCVAR_H_
+
+struct xenkbc_softc {
+       struct device           sc_dev;         /* base device glue */
+       struct xenkbc_internal  *sc_xi;
+};
+
+struct xenkbc_attach_args {
+       const char              *xa_device;
+};
+
+int xenkbc_cnattach(pckbport_slot_t);
+
+#endif /* _XEN_XENKBCVAR_H_ */
diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/xen/hypervisor.c
--- a/sys/arch/xen/xen/hypervisor.c     Sat Apr 24 21:01:37 2004 +0000
+++ b/sys/arch/xen/xen/hypervisor.c     Sat Apr 24 21:33:32 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.3 2004/04/24 20:58:59 cl Exp $ */
+/* $NetBSD: hypervisor.c,v 1.4 2004/04/24 21:33:32 cl Exp $ */
 
 /*
  *
@@ -33,7 +33,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.3 2004/04/24 20:58:59 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.4 2004/04/24 21:33:32 cl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -42,6 +42,7 @@
 #include "xencons.h"
 #include "xennet.h"
 #include "xbd.h"
+#include "xenkbc.h"
 #include "vga_xen.h"
 #include "npx.h"
 
@@ -64,6 +65,11 @@
 #include <machine/xbdvar.h>
 #endif
 
+#if NXENKBC > 0
+#include <dev/pckbport/pckbportvar.h>
+#include <machine/xenkbcvar.h>
+#endif
+
 #if NVGA_XEN > 0
 #include <machine/bus.h>
 #include <machine/vga_xenvar.h>
@@ -79,6 +85,9 @@
 
 union hypervisor_attach_cookie {
        const char *hac_device;         /* first elem of all */
+#if NXENKBC > 0
+       struct xenkbc_attach_args hac_xenkbc;
+#endif
 #if NVGA_XEN > 0
        struct xen_vga_attach_args hac_vga_xen;
 #endif
@@ -125,6 +134,11 @@
 
        printf("\n");
 
+#if NXENKBC > 0
+       hac.hac_xenkbc.xa_device = "xenkbc";
+       config_found(self, &hac.hac_xenkbc, hypervisor_print);
+#endif
+
 #if NVGA_XEN > 0
        hac.hac_vga_xen.xa_device = "vga_xen";
        hac.hac_vga_xen.xa_iot = X86_BUS_SPACE_IO;
diff -r 100b41d915b8 -r 398d51316f7f sys/arch/xen/xen/xenkbc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/xen/xen/xenkbc.c Sat Apr 24 21:33:32 2004 +0000
@@ -0,0 +1,272 @@
+/* $NetBSD: xenkbc.c,v 1.1 2004/04/24 21:33:32 cl Exp $ */
+
+/*
+ *
+ * Copyright (c) 2004 Christian Limpach.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christian Limpach.



Home | Main Index | Thread Index | Old Index