- Switch to wscons(4) with MI vga(4), pckbc(4) and pms(4).

- Reorganize console initialization code like i386 rather than cninit().
Note old pccons/opms and ofcons support still works.

XXX Xserver is not tested because XF86_4 doesn't have support
XXX for IGS CyberPro2010 on shark. (yet?)
This commit is contained in:
tsutsui 2005-01-09 15:39:59 +00:00
parent 7da0e84338
commit 8d65a2e17f
7 changed files with 226 additions and 244 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.37 2005/01/05 09:06:33 tsutsui Exp $
# $NetBSD: GENERIC,v 1.38 2005/01/09 15:39:59 tsutsui Exp $
#
# Generic Shark configuration.
#
@ -7,7 +7,7 @@ include "arch/shark/conf/std.shark"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "GENERIC-$Revision: 1.37 $"
#ident "GENERIC-$Revision: 1.38 $"
# estimated number of users
maxusers 32
@ -167,6 +167,48 @@ options SYMTAB_SPACE=390000 # reserve symbol space for DDB
#options KERNEL_DEBUG # compile in kernel debugging capability
#makeoptions DEBUG="-g" # compile full symbol table
#
# wscons options
#
# builtin terminal emulations
#options WSEMUL_SUN # sun terminal emulation
options WSEMUL_VT100 # VT100 / VT220 emulation
# customization of console and kernel output - see dev/wscons/wsdisplayvar.h
#options WSDISPLAY_CUSTOM_OUTPUT # color customization from wsconsctl(8)
#options WS_DEFAULT_FG=WSCOL_WHITE
#options WS_DEFAULT_BG=WSCOL_BLACK
#options WS_DEFAULT_COLATTR="(0)"
#options WS_DEFAULT_MONOATTR="(0)"
options WS_KERNEL_FG=WSCOL_GREEN
#options WS_KERNEL_BG=WSCOL_BLACK
#options WS_KERNEL_COLATTR=""
#options WS_KERNEL_MONOATTR=""
# customization of console border color
#options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8)
#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color
# 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)"
#options PCKBD_LAYOUT="(KB_US | KB_SWAPCTRLCAPS)"
# 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\""
# 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
# console scrolling support.
#options WSDISPLAY_SCROLLSUPPORT
# enable VGA raster mode capable of displaying multilingual text on console
#options VGA_RASTERCONSOLE
config netbsd root on ? type ?
# The main bus device
@ -197,15 +239,24 @@ cd* at atapibus? drive?
sd* at atapibus? drive?
# PCCONS@OFW
ofisapc* at ofbus?
pc* at ofisapc?
#ofisapc* at ofbus?
#pc* at ofisapc?
#options FRENCH_KBD
#options FINNISH_KBD
#options GERMAN_KBD
#options NORWEGIAN_KBD
# PS/2 Mouse
opms0 at spckbd? irq 12
#opms0 at spckbd? irq 12
# wscons
pckbc* at ofisa?
pckbd* at pckbc?
pms* at pckbc?
vga* at ofbus?
wsdisplay* at vga?
wskbd* at pckbd? console ?
wsmouse* at pms? mux 0
# CS8900 Ethernet@OFW
cs* at ofisa?
@ -252,6 +303,8 @@ pseudo-device sequencer 1 # MIDI sequencer
pseudo-device openfirm # /dev/openfirm
#pseudo-device vcoda 4 # coda kernel <-> cachemanager
pseudo-device clockctl # user control of clock subsystem
pseudo-device wsmux # mouse & keyboard multiplexor
pseudo-device wsfont
pseudo-device ksyms # /dev/ksyms
#pseudo-device pf # PF packet filter
#pseudo-device pflog # PF log if

View File

@ -1,4 +1,4 @@
# $NetBSD: files.shark,v 1.8 2005/01/05 09:13:29 tsutsui Exp $
# $NetBSD: files.shark,v 1.9 2005/01/09 15:39:59 tsutsui Exp $
#
# First try for arm-specific configuration info
#
@ -30,6 +30,9 @@ include "dev/wscons/files.wscons"
include "dev/rasops/files.rasops"
include "dev/wsfont/files.wsfont"
# Include pckbport stuff
include "dev/pckbport/files.pckbport"
#
# Machine-independent ATA drivers
#
@ -42,9 +45,8 @@ attach ofbus at root with ofbus_root
file arch/shark/ofw/ofw.c
file arch/shark/ofw/oftodclock.c
# OFW console initialization
file arch/shark/ofw/consinit.c
file dev/cninit.c
# console initialization
file arch/shark/shark/consinit.c
# ISA DMA glue
file arch/shark/isa/isadma_machdep.c isadma
@ -53,7 +55,6 @@ file arch/shark/isa/isadma_machdep.c isadma
include "dev/ofisa/files.ofisa"
file arch/shark/ofw/ofisa_machdep.c ofisa
file arch/shark/ofw/com_ofisa_machdep.c com_ofisa
file arch/shark/ofw/com_ofisa_consolehack.c com_ofisa # XXX
file arch/shark/ofw/if_cs_ofisa_machdep.c cs_ofisa
file arch/shark/ofw/lpt_ofisa_machdep.c lpt_ofisa | atppc_ofisa
file arch/shark/ofw/wdc_ofisa_machdep.c wdc_ofisa
@ -95,7 +96,6 @@ include "dev/scsipi/files.scsipi"
# Generic MD files
file arch/shark/shark/autoconf.c
file arch/shark/shark/conf.c
file arch/arm/arm/disksubr.c disk
file arch/arm/arm/disksubr_acorn.c disk
@ -132,6 +132,10 @@ device pc: tty, spckbd, i8042
attach pc at ofisapc
file arch/shark/shark/pccons.c pc needs-flag
# ofbus VGA
attach vga at ofbus with vga_ofbus
file arch/shark/ofw/vga_ofbus.c vga_ofbus needs-flag
# Smart Card Reader
device scr: tty
file arch/shark/shark/scr.c scr needs-flag

View File

@ -1,4 +1,4 @@
# $NetBSD: majors.shark,v 1.13 2005/01/05 09:15:19 tsutsui Exp $
# $NetBSD: majors.shark,v 1.14 2005/01/09 15:39:59 tsutsui Exp $
#
# Device majors for shark
#
@ -47,9 +47,14 @@ device-major joy char 56 joy
device-major midi char 57 midi
device-major sequencer char 58 sequencer
device-major vcoda char 59 vcoda
device-major wsdisplay char 60 wsdisplay
device-major wskbd char 61 wskbd
device-major wsmouse char 62 wsmouse
device-major raid char 71 block 71 raid
device-major wsmux char 73 wsmux
device-major openfirm char 77 ofwgencfg
device-major clockctl char 84 clockctl

View File

@ -1,87 +0,0 @@
/* $NetBSD: com_ofisa_consolehack.c,v 1.4 2003/07/15 03:36:02 lukem Exp $ */
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
* OFW Attachment for 'com' serial driver
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com_ofisa_consolehack.c,v 1.4 2003/07/15 03:36:02 lukem Exp $");
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <sys/tty.h>
#include <machine/intr.h>
#include <machine/bus.h>
#include <dev/ofw/openfirm.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#include <machine/isa_machdep.h> /* XXX for space tags */
#include <dev/cons.h>
void comcnprobe(struct consdev *);
void comcninit(struct consdev *);
void
comcnprobe(cp)
struct consdev *cp;
{
#ifdef COMCONSOLE
cp->cn_pri = CN_REMOTE; /* Force a serial port console */
#else
cp->cn_pri = CN_NORMAL;
#endif
}
void
comcninit(cp)
struct consdev *cp;
{
#ifndef CONMODE
#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
#endif
if (comcnattach(&isa_io_bs_tag, 0x3f8, 9600, COM_FREQ, COM_TYPE_NORMAL,
CONMODE))
panic("can't init serial console @%x", 0x3f8);
}

View File

@ -1,63 +0,0 @@
/* $NetBSD: consinit.c,v 1.2 2003/07/15 03:36:02 lukem Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
* Copyright (c) 1994 Brini.
* All rights reserved.
*
* This code is derived from software written for Brini by Mark Brinicombe
*
* 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 Mark Brinicombe
* for the NetBSD Project.
* 4. The name of the company nor the name of the author may 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 OR CONTRIBUTORS 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.
*
* Initialize OFW console.
*
* Created : 17/09/94
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.2 2003/07/15 03:36:02 lukem Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <dev/cons.h>
void
consinit(void)
{
static int consinit_called = 0;
if (consinit_called != 0)
return;
consinit_called = 1;
/* No serial console for now ? hmm... should be in constab */
cninit();
}

View File

@ -1,82 +0,0 @@
/* $NetBSD: conf.c,v 1.8 2003/07/15 03:36:03 lukem Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
* 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 Mark Brinicombe
* for the NetBSD Project.
* 4. The name of the company nor the name of the author may 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 OR CONTRIBUTORS 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.
*
* RiscBSD kernel project
*
* conf.c
*
* Character and Block Device configuration
* Console configuration
*
* Defines the structures cdevsw and constab
*
* Created : 17/09/94
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.8 2003/07/15 03:36:03 lukem Exp $");
#include <sys/param.h>
#include <sys/conf.h>
#include "com.h"
#include "pc.h"
#include "ofcons.h"
/*
* This entire table could be autoconfig()ed but that would mean that
* the kernel's idea of the console would be out of sync with that of
* the standalone boot. I think it best that they both use the same
* known algorithm unless we see a pressing need otherwise.
*/
#include <dev/cons.h>
cons_decl(com);
cons_decl(ofcons_);
cons_decl(pc);
struct consdev constab[] = {
#if (NCOM > 0)
cons_init(com),
#endif
#if (NPC > 0)
cons_init(pc),
#elif (NOFCONS > 0) /* XXX should work together */
cons_init(ofcons_),
#endif
{ 0 },
};
/* End of conf.c */

View File

@ -0,0 +1,152 @@
/* $NetBSD: consinit.c,v 1.1 2005/01/09 15:39:59 tsutsui Exp $ */
/*
* Copyright (c) 1998
* Matthias Drochner. 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.
*
* 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.
*
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/cons.h>
#include <machine/bus.h>
#include <dev/isa/isavar.h>
#include "vga.h"
#if (NVGA > 0)
#include <dev/ic/mc6845reg.h>
#include <dev/ic/pcdisplayvar.h>
#include <dev/ic/vgareg.h>
#include <dev/ic/vgavar.h>
#endif
#include "vga_ofbus.h"
#if (NVGA_OFBUS > 0)
#include <shark/ofw/vga_ofbusvar.h>
#endif
#include "pckbc.h"
#if (NPCKBC > 0)
#include <dev/isa/isareg.h>
#include <dev/ic/i8042reg.h>
#include <dev/ic/pckbcvar.h>
#include <dev/pckbport/pckbportvar.h>
#endif
#include "pckbd.h" /* for pckbc_machdep_cnattach */
#include "pc.h"
#if (NPC > 0)
#include <machine/pccons.h>
cons_decl(pc)
static struct consdev pccons = cons_init(pc);
#endif
#include "com.h"
#if (NCOM > 0)
#include <sys/termios.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#endif
#include "ofcons.h"
#if (NOFCONS > 0)
cons_decl(ofcons_)
static struct consdev ofcons = cons_init(ofcons_);
#endif
#if (NCOM > 0)
#ifndef CONADDR
#define CONADDR 0x3f8
#endif
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
#ifndef CONMODE
#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
#endif
int comcnmode = CONMODE;
#endif /* NCOM */
#ifdef COMCONSOLE
int comconsole = 1;
#else
int comconsole = 0;
#endif
/*
* consinit:
* initialize the system console.
*/
void
consinit()
{
struct consdev *cp;
static int initted;
if (initted)
return;
initted = 1;
cp = NULL;
if (comconsole) {
#if (NCOM > 0)
if (comcnattach(&isa_io_bs_tag, CONADDR, CONSPEED, COM_FREQ,
COM_TYPE_NORMAL, comcnmode))
panic("can't init serial console");
return;
#endif
} else {
#if (NPC > 0) || (NVGA > 0)
#if (NVGA_OFBUS > 0)
if (!vga_ofbus_cnattach(&isa_io_bs_tag, &isa_mem_bs_tag)) {
#if (NPCKBC > 0)
pckbc_cnattach(&isa_io_bs_tag, IO_KBD, KBCMDP,
PCKBC_KBD_SLOT);
#endif /* NPCKBC */
return;
}
#endif /* NVGA_OFBUS */
#if (NPC > 0)
cp = &pccons;
pccnprobe(cp);
if (cp->cn_pri == CN_INTERNAL) {
pccninit(cp);
cn_tab = cp;
return;
}
#endif /* NPC */
#else /* NPC || NVGA */
#if (NOFCONS > 0)
cp = &ofcons;
ofcons_cnprobe(cp);
if (cp->cn_pri == CN_INTERNAL) {
ofcons_cninit(cp);
cn_tab = cp;
return;
}
#endif /* NOFCONS */
#endif /* NPC || NVGA */
}
}