summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2001-01-30 00:00:35 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2001-01-30 00:00:35 +0000
commit0fcf6044f0a074f64508c0d71efd3d647550aa31 (patch)
tree4bdd07108bfee7e2d46c5ef1538012ffc4656e2b /sys
parentbc11062938d970b18c2a7bd8e8fcb49873d875a2 (diff)
Support for the wscons machine-independent console driver on the i386. To
become default in a few moments once deraadt commits new kernel config files. IMPORTANT NOTE: A few important pieces are still required to be worked out over the next few days. Users (and developers) relying on X should probably stay away from -current until further notice. This should not take long, but here is your first heads up. If you decide to upgrade your kernel anyway, be sure to update your /etc/ttys file to use vt100 instead of vt220. The rest of the fallout from this should be minor.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/conf/files.i38626
-rw-r--r--sys/arch/i386/i386/conf.c19
-rw-r--r--sys/arch/i386/i386/machdep.c82
-rw-r--r--sys/arch/i386/include/pccons.h11
-rw-r--r--sys/arch/i386/include/types.h4
-rw-r--r--sys/dev/isa/files.isa18
6 files changed, 139 insertions, 21 deletions
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index 69141251db9..a8ced2ef537 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: files.i386,v 1.73 2001/01/24 09:38:00 hugh Exp $
+# $OpenBSD: files.i386,v 1.74 2001/01/30 00:00:29 aaron Exp $
# $NetBSD: files.i386,v 1.73 1996/05/07 00:58:36 thorpej Exp $
#
# new style config file for i386 architecture
@@ -126,7 +126,7 @@ include "../../../gnu/arch/i386/fpemul/files.fpemul"
# attribute used to represent the "keyboard controller"
# XXX should be a real device
-define pckbd { [irq = -1], [port = -1] }
+define pckbcport { [irq = -1], [port = -1] }
# 8250/16[45]50-based "com" ports, optimized for the i386 interrupt system
device pccom: tty
@@ -135,12 +135,14 @@ attach pccom at commulti with pccom_commulti
file arch/i386/isa/pccom.c pccom & (pccom_isa | pccom_isapnp | pccom_commulti | pccom_pcmcia | pccom_cardbus | pccom_puc) needs-flag
# PC console support a la "pccons"
-device pc: tty, pckbd
+device pc: tty, pckbcport
attach pc at isa
-file arch/i386/isa/pccons.c pc needs-flag
+device pcconskbd
+attach pcconskbd at pckbc
+file arch/i386/isa/pccons.c pc | pcconskbd needs-flag
# PC console support a la "pcvt"
-device vt: tty, pckbd
+device vt: tty, pckbcport
attach vt at isa
file arch/i386/isa/pcvt/pcvt_drv.c vt needs-flag
file arch/i386/isa/pcvt/pcvt_ext.c vt needs-flag
@@ -151,15 +153,19 @@ file arch/i386/isa/pcvt/pcvt_sup.c vt needs-flag
file arch/i386/isa/pcvt/pcvt_vtf.c vt needs-flag
# PC Mice; Logitech-style, Microsoft-style, and PS/2-style
-device lms
+device lms: wsmousedev
attach lms at isa
file arch/i386/isa/lms.c lms needs-flag
-device mms
+device mms: wsmousedev
attach mms at isa
file arch/i386/isa/mms.c mms needs-flag
-device pms
-attach pms at pckbd
-file arch/i386/isa/pms.c pms needs-flag
+device opms
+attach opms at pckbcport with opms_hack
+attach opms at pckbc with opms_pckbc
+file arch/i386/isa/pms.c opms | opms_hack | opms_pckbc needs-flag
+
+include "dev/wscons/files.wscons"
+include "dev/pckbc/files.pckbc"
device sysbeep
attach sysbeep at pcppi
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index 2e36d246dab..73ba65edcca 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.62 2000/09/26 14:03:53 art Exp $ */
+/* $OpenBSD: conf.c,v 1.63 2001/01/30 00:00:31 aaron Exp $ */
/* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */
/*
@@ -167,7 +167,7 @@ cdev_decl(spkr);
cdev_decl(mms);
#include "lms.h"
cdev_decl(lms);
-#include "pms.h"
+#include "opms.h"
cdev_decl(pms);
#include "cy.h"
cdev_decl(cy);
@@ -221,6 +221,11 @@ cdev_decl(ucom);
#error vt and pc are mutually exclusive. Sorry.
#endif
+#include "wsdisplay.h"
+#include "wskbd.h"
+#include "wsmouse.h"
+#include "wsmux.h"
+cdev_decl(wsmux);
struct cdevsw cdevsw[] =
{
@@ -240,7 +245,11 @@ struct cdevsw cdevsw[] =
cdev_disk_init(NFD,fd), /* 9: floppy disk */
cdev_tape_init(NWT,wt), /* 10: QIC-02/QIC-36 tape */
cdev_disk_init(NSCD,scd), /* 11: Sony CD-ROM */
+#if 0
cdev_pc_init(NPC + NVT,pc), /* 12: PC console */
+#endif
+ cdev_wsdisplay_init(NWSDISPLAY, /* 12: frame buffers, etc. */
+ wsdisplay),
cdev_disk_init(NSD,sd), /* 13: SCSI disk */
cdev_tape_init(NST,st), /* 14: SCSI tape */
cdev_disk_init(NCD,cd), /* 15: SCSI CD-ROM */
@@ -269,7 +278,7 @@ struct cdevsw cdevsw[] =
cdev_lkm_dummy(), /* 34 */
cdev_mouse_init(NMMS,mms), /* 35: Microsoft mouse */
cdev_mouse_init(NLMS,lms), /* 36: Logitech mouse */
- cdev_mousewr_init(NPMS,pms), /* 37: Extended PS/2 mouse */
+ cdev_mousewr_init(NOPMS,pms), /* 37: Extended PS/2 mouse */
cdev_tty_init(NCY,cy), /* 38: Cyclom serial port */
cdev_disk_init(NMCD,mcd), /* 39: Mitsumi CD-ROM */
cdev_bpftun_init(NTUN,tun), /* 40: network tunnel */
@@ -309,6 +318,10 @@ struct cdevsw cdevsw[] =
cdev_ulpt_init(NULPT,ulpt), /* 64: USB printers */
cdev_usbdev_init(NURIO,urio), /* 65: USB Diamond Rio 500 */
cdev_tty_init(NUCOM,ucom), /* 66: USB tty */
+ cdev_mouse_init(NWSKBD, wskbd), /* 67: keyboards */
+ cdev_mouse_init(NWSMOUSE, /* 68: mice */
+ wsmouse),
+ cdev_mouse_init(NWSMUX, wsmux), /* 69: ws multiplexor */
};
int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index f2beaff611e..4848eec8e58 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.146 2001/01/25 18:49:33 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.147 2001/01/30 00:00:31 aaron Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -172,6 +172,37 @@
extern struct proc *npxproc;
#endif
+#include "vga.h"
+#include "ega.h"
+#include "pcdisplay.h"
+#if (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
+#include <dev/ic/mc6845reg.h>
+#include <dev/ic/pcdisplayvar.h>
+#if (NVGA > 0)
+#include <dev/ic/vgareg.h>
+#include <dev/ic/vgavar.h>
+#endif
+#if (NEGA > 0)
+#include <dev/isa/egavar.h>
+#endif
+#if (NPCDISPLAY > 0)
+#include <dev/isa/pcdisplayvar.h>
+#endif
+#endif
+
+#include "pckbc.h"
+#if (NPCKBC > 0)
+#include <dev/isa/isareg.h>
+#include <dev/ic/i8042reg.h>
+#include <dev/ic/pckbcvar.h>
+#endif
+#include "pckbd.h" /* for pckbc_machdep_cnattach */
+
+#include "pc.h"
+#if (NPC > 0)
+#include <machine/pccons.h>
+#endif
+
#include "bios.h"
#include "com.h"
#include "pccom.h"
@@ -2067,9 +2098,6 @@ init386(first_avail)
(caddr_t)iomem_ex_storage, sizeof(iomem_ex_storage),
EX_NOCOALESCE|EX_NOWAIT);
- consinit(); /* XXX SHOULD NOT BE DONE HERE */
- /* XXX here, until we can use bios for printfs */
-
/* make gdt gates and memory segments */
setsegment(&gdt[GCODE_SEL].sd, 0, 0xfffff, SDT_MEMERA, SEL_KPL, 1, 1);
setsegment(&gdt[GICODE_SEL].sd, 0, 0xfffff, SDT_MEMERA, SEL_KPL, 1, 1);
@@ -2121,6 +2149,9 @@ init386(first_avail)
isa_defaultirq();
#endif
+ consinit(); /* XXX SHOULD NOT BE DONE HERE */
+ /* XXX here, until we can use bios for printfs */
+
/* call pmap initialization to make new kernel address space */
pmap_bootstrap((vm_offset_t)atdevbase + IOM_SIZE);
@@ -2359,9 +2390,52 @@ consinit()
if (initted)
return;
initted = 1;
+#if 0
cninit();
+#endif
+
+#if (NPC > 0) || (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
+#if (NVGA > 0)
+ if (!vga_cnattach(I386_BUS_SPACE_IO, I386_BUS_SPACE_MEM, -1, 1))
+ goto dokbd;
+#endif
+#if (NEGA > 0)
+ if (!ega_cnattach(I386_BUS_SPACE_IO, I386_BUS_SPACE_MEM))
+ goto dokbd;
+#endif
+#if (NPCDISPLAY > 0)
+ if (!pcdisplay_cnattach(I386_BUS_SPACE_IO, I386_BUS_SPACE_MEM))
+ goto dokbd;
+#endif
+#if (NPC > 0)
+ pccnattach();
+#endif
+ if (0) goto dokbd; /* XXX stupid gcc */
+dokbd:
+#if (NPCKBC > 0)
+ pckbc_cnattach(I386_BUS_SPACE_IO, IO_KBD, KBCMDP, PCKBC_KBD_SLOT);
+#endif /* PC | VT | VGA | PCDISPLAY */
}
+#if (NPCKBC > 0) && (NPCKBD == 0)
+/*
+ * glue code to support old console code with the
+ * mi keyboard controller driver
+ */
+int
+pckbc_machdep_cnattach(kbctag, kbcslot)
+ pckbc_tag_t kbctag;
+ pckbc_slot_t kbcslot;
+{
+#if (NPC > 0) && (NPCCONSKBD > 0)
+ return (pcconskbd_cnattach(kbctag, kbcslot));
+#else
+ return (ENXIO);
+#endif
+}
+#endif
+#endif
+
#ifdef KGDB
void
kgdb_port_init()
diff --git a/sys/arch/i386/include/pccons.h b/sys/arch/i386/include/pccons.h
index c20385c4831..372f9ab331c 100644
--- a/sys/arch/i386/include/pccons.h
+++ b/sys/arch/i386/include/pccons.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccons.h,v 1.5 1997/03/03 12:01:17 downsj Exp $ */
+/* $OpenBSD: pccons.h,v 1.6 2001/01/30 00:00:32 aaron Exp $ */
/* $NetBSD: pccons.h,v 1.4 1996/02/02 18:06:06 mycroft Exp $ */
/*
@@ -43,4 +43,13 @@ typedef struct {
#define CONSOLE_SET_KEYMAP _IOW('t',129,pccons_keymap_t[KB_NUM_KEYS])
#define CONSOLE_SET_BLANK _IOW('t',130,int)
+#ifdef _KERNEL
+int pccnattach __P((void));
+
+#if (NPCCONSKBD > 0)
+int pcconskbd_cnattach _P((pckbc_tag_t, pckbc_slot_t));
+#endif
+
+#endif /* _KERNEL */
+
#endif /* _PCCONS_H_ */
diff --git a/sys/arch/i386/include/types.h b/sys/arch/i386/include/types.h
index 9a2548558f8..e634cc7ceaf 100644
--- a/sys/arch/i386/include/types.h
+++ b/sys/arch/i386/include/types.h
@@ -1,5 +1,5 @@
/* $NetBSD: types.h,v 1.12 1995/12/24 01:08:03 mycroft Exp $ */
-/* $OpenBSD: types.h,v 1.7 1999/07/07 23:16:40 art Exp $ */
+/* $OpenBSD: types.h,v 1.8 2001/01/30 00:00:32 aaron Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -82,4 +82,6 @@ typedef unsigned long long uint64_t;
typedef int32_t register_t;
+#define __HAVE_NWSCONS
+
#endif /* _MACHTYPES_H_ */
diff --git a/sys/dev/isa/files.isa b/sys/dev/isa/files.isa
index 7843c922c40..9c7e5b2b533 100644
--- a/sys/dev/isa/files.isa
+++ b/sys/dev/isa/files.isa
@@ -1,4 +1,4 @@
-# $OpenBSD: files.isa,v 1.64 1999/12/27 21:42:40 fgsch Exp $
+# $OpenBSD: files.isa,v 1.65 2001/01/30 00:00:33 aaron Exp $
# $NetBSD: files.isa,v 1.21 1996/05/16 03:45:55 mycroft Exp $
#
# Config file and device description for machine-independent ISA code.
@@ -62,10 +62,24 @@ attach com at commulti with com_commulti
attach cy at isa with cy_isa
file dev/isa/cy_isa.c cy_isa
-# Generic VGA
+# ISA PC keyboard controller
+attach pckbc at isa with pckbc_isa
+file dev/isa/pckbc_isa.c pckbc needs-flag
+
+# Generic ISA VGA
attach vga at isa with vga_isa
file dev/isa/vga_isa.c vga_isa needs-flag
+# Generic EGA
+device ega: wsemuldisplaydev, pcdisplayops
+attach ega at isa
+file dev/isa/ega.c ega needs-flag
+
+# Generic PC graphics adapter (MGA, CGA, ...)
+device pcdisplay: wsemuldisplaydev, pcdisplayops
+attach pcdisplay at isa
+file dev/isa/pcdisplay.c pcdisplay needs-flag
+
#
# SCSI host adapters
#