Subject: wscons on shark
To: None <port-arm@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-arm
Date: 12/25/2004 03:52:09
It just works on my Funai's DNARD terminal with vga/pckbd, pccons,
and ofcons.

diff and dmesg are attached though there are some problems:
- shark/isa/isa_io_asm.S is mostly identical with
  arm/arm/bus_space_asm_generic.S, but why bus_space_generic is
  defined as attribute? 
- cats uses arm/conf/majors.arm32, but shark uses shark/conf/majors.shark.
  wsfont is 86 in majors.arm32, but 86 is already occupied by ksyms
  in majors.shark.
- Should we still use cninit() for consinit() or not?
- Xserver is not tested at all, but pccons should be removed anyway?

Comments?
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp

---
Index: conf/GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/conf/GENERIC,v
retrieving revision 1.35
diff -u -r1.35 GENERIC
--- conf/GENERIC	10 Nov 2004 17:54:07 -0000	1.35
+++ conf/GENERIC	24 Dec 2004 18:11:24 -0000
@@ -160,7 +160,7 @@
 #options 	PMAP_DEBUG	# Enable pmap_debug_level code
 #options 	IPKDB		# remote kernel debugging
 options 	DDB		# in-kernel debugger
-options		SYMTAB_SPACE=258000	# reserve symbol space for DDB
+options 	SYMTAB_SPACE=382000	# reserve symbol space for DDB
 				# (needed because we boot netbsd.aout)
 #options 	DDB_ONPANIC=0	# don't run DDB at panictime
 #options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
Index: conf/files.shark
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/conf/files.shark,v
retrieving revision 1.7
diff -u -r1.7 files.shark
--- conf/files.shark	8 Jul 2004 22:07:48 -0000	1.7
+++ conf/files.shark	24 Dec 2004 18:11:24 -0000
@@ -30,6 +30,9 @@
 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 @@
 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 @@
 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
@@ -61,7 +62,7 @@
 # Glue for OFW ISA device attachment
 device	ofisapc {}
 attach	ofisapc at ofbus
-file	arch/shark/ofw/ofisapc.c		pc
+file	arch/shark/ofw/ofisapc.c		ofisapc
 device	ofisascr {}
 attach	ofisascr at ofisa
 file	arch/shark/ofw/ofisascr.c		scr
@@ -95,7 +96,6 @@
 
 # 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
@@ -105,16 +105,16 @@
 file	arch/arm/arm32/spl.S
 
 # Shark specific files
-file	arch/shark/shark/shark_machdep.c	shark
-file	arch/shark/shark/sequoia.c		shark
-file	arch/shark/shark/shark_fiq.S		shark
-file	arch/shark/shark/hat.c			shark
-file	arch/shark/isa/isa_irqhandler.c		shark
-file	arch/shark/isa/clock.c			shark
-file	arch/shark/isa/isa_irq.S		shark
-file	arch/shark/isa/isa_shark_machdep.c	shark
-file	arch/shark/isa/isa_io.c			shark | isa
-file	arch/shark/isa/isa_io_asm.S		shark | isa
+file	arch/shark/shark/shark_machdep.c
+file	arch/shark/shark/sequoia.c
+file	arch/shark/shark/shark_fiq.S
+file	arch/shark/shark/hat.c
+file	arch/shark/isa/isa_irqhandler.c
+file	arch/shark/isa/clock.c
+file	arch/shark/isa/isa_irq.S
+file	arch/shark/isa/isa_shark_machdep.c
+file	arch/shark/isa/isa_io.c
+file	arch/shark/isa/isa_io_asm.S
 
 # National Semiconductor PC97307VUL SuperIO chip configuration routines
 define	nsio
@@ -132,6 +132,10 @@
 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
Index: conf/majors.shark
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/conf/majors.shark,v
retrieving revision 1.12
diff -u -r1.12 majors.shark
--- conf/majors.shark	10 Dec 2003 02:04:01 -0000	1.12
+++ conf/majors.shark	24 Dec 2004 18:11:24 -0000
@@ -8,7 +8,7 @@
 device-major	cons		char 2
 device-major	ctty		char 3
 device-major	pc		char 4			pc
-device-major	ofcons		char 4			!pc & ofwgencfg
+device-major	ofcons		char 4			!pc & ofcons
 device-major	log		char 5
 device-major	ptc		char 6			pty
 device-major	pts		char 7			pty
@@ -47,9 +47,14 @@
 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
Index: isa/isa_io.c
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/isa/isa_io.c,v
retrieving revision 1.3
diff -u -r1.3 isa_io.c
--- isa/isa_io.c	15 Jul 2003 03:36:01 -0000	1.3
+++ isa/isa_io.c	24 Dec 2004 18:11:25 -0000
@@ -133,7 +133,7 @@
 
 	/* copy */
 	bs_notimpl_bs_c_1,
-	bs_notimpl_bs_c_2,
+	isa_bs_c_2,
 	bs_notimpl_bs_c_4,
 	bs_notimpl_bs_c_8,
 };
@@ -214,7 +214,7 @@
 
 	/* copy */
 	bs_notimpl_bs_c_1,
-	bs_notimpl_bs_c_2,
+	isa_bs_c_2,
 	bs_notimpl_bs_c_4,
 	bs_notimpl_bs_c_8,
 };
@@ -223,8 +223,8 @@
 
 void
 isa_io_init(isa_io_addr, isa_mem_addr)
-	vm_offset_t isa_io_addr;
-	vm_offset_t isa_mem_addr;
+	vaddr_t isa_io_addr;
+	vaddr_t isa_mem_addr;
 {
 	isa_io_bs_tag.bs_cookie = (void *)isa_io_addr;
 	isa_mem_bs_tag.bs_cookie = (void *)isa_mem_addr;
@@ -235,16 +235,16 @@
  * (e.g. X servers) need to map ISA space directly.  use these
  * functions sparingly!
  */
-vm_offset_t
+vaddr_t
 isa_io_data_vaddr(void)
 {
-	return (vm_offset_t)isa_io_bs_tag.bs_cookie;
+	return (vaddr_t)isa_io_bs_tag.bs_cookie;
 }
 
-vm_offset_t
+vaddr_t
 isa_mem_data_vaddr(void)
 {
-	return (vm_offset_t)isa_mem_bs_tag.bs_cookie;
+	return (vaddr_t)isa_mem_bs_tag.bs_cookie;
 }
 
 int
Index: isa/isa_io_asm.S
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/isa/isa_io_asm.S,v
retrieving revision 1.1
diff -u -r1.1 isa_io_asm.S
--- isa/isa_io_asm.S	10 Feb 2002 01:57:53 -0000	1.1
+++ isa/isa_io_asm.S	24 Dec 2004 18:11:25 -0000
@@ -339,3 +339,37 @@
 	bne	Lisa_bs_sr_2_loop
 
 	mov	pc, lr
+
+/*
+ * Copy region
+ */
+
+ENTRY(isa_bs_c_2)
+	add	r0, r1, r2
+	ldr	r2, [sp, #0]
+	add	r1, r2, r3
+	ldr	r2, [sp, #4]
+	teq	r2, #0
+	moveq	pc, lr
+
+	cmp	r0, r1
+	blt	2f
+
+1:	ldrh	r3, [r0], #2
+	strh	r3, [r1], #2
+	subs	r2, r2, #1
+	bne	1b
+
+	mov	pc, lr
+
+2:	add	r0, r0, r2, lsl #1
+	add	r1, r1, r2, lsl #1
+	sub	r0, r0, #2
+	sub	r1, r1, #2
+
+3:	ldrh	r3, [r0], #-2
+	strh	r3, [r1], #-2
+	subs	r2, r2, #1
+	bne	3b
+
+	mov	pc, lr
Index: isa/isa_shark_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/isa/isa_shark_machdep.c,v
retrieving revision 1.4
diff -u -r1.4 isa_shark_machdep.c
--- isa/isa_shark_machdep.c	15 Jul 2003 03:36:01 -0000	1.4
+++ isa/isa_shark_machdep.c	24 Dec 2004 18:11:25 -0000
@@ -213,7 +213,7 @@
 
 /* isa_init() might eventually become the ISA attach routine */
 void
-isa_init(vm_offset_t isa_io_addr, vm_offset_t isa_mem_addr)
+isa_init(vaddr_t isa_io_addr, vaddr_t isa_mem_addr)
 {
   /* initialize the bus space functions */
   isa_io_init(isa_io_addr, isa_mem_addr);
Index: ofw/vga_ofbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/ofw/vga_ofbus.c,v
retrieving revision 1.5
diff -u -r1.5 vga_ofbus.c
--- ofw/vga_ofbus.c	15 Jul 2003 03:36:02 -0000	1.5
+++ ofw/vga_ofbus.c	24 Dec 2004 18:11:25 -0000
@@ -47,9 +47,8 @@
 #include <dev/wscons/wsdisplayvar.h>
 
 #include <dev/ofw/openfirm.h>
-#if 0
-#include <dnard/ofw/vga_ofisavar.h>
-#endif
+
+#include <shark/ofw/vga_ofbusvar.h>
 
 struct vga_ofbus_softc {
 	struct vga_softc sc_vga;
@@ -91,13 +90,40 @@
 	osc->sc_phandle = oba->oba_phandle;
 
 	vga_common_attach(sc, &isa_io_bs_tag, &isa_mem_bs_tag,
-	    WSDISPLAY_TYPE_ISAVGA, NULL);
+	    WSDISPLAY_TYPE_ISAVGA, 0, NULL);
 }
 
 int
-vga_ofbus_cnattach(int phandle, bus_space_tag_t iot, bus_space_tag_t memt)
+vga_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt)
 {
-	if (OF_call_method("text-mode3", phandle, 0, 0) != 0) {
+	int chosen_phandle;
+	int stdout_ihandle, stdout_phandle;
+	char buf[128];
+
+	stdout_phandle = 0;
+
+	/*
+	 * Find out whether the firmware's chosen stdout is
+	 * a display.  If so, use the existing ihandle so the firmware
+	 * doesn't become Unhappy.  If not, just open it.
+	 */
+	if ((chosen_phandle = OF_finddevice("/chosen")) == -1 ||
+	    OF_getprop(chosen_phandle, "stdout", &stdout_ihandle, 
+	    sizeof(stdout_ihandle)) != sizeof(stdout_ihandle)) {
+		return 0;
+	}
+	stdout_ihandle = of_decode_int((unsigned char *)&stdout_ihandle);
+	if ((stdout_phandle = OF_instance_to_package(stdout_ihandle)) == -1 ||
+	    OF_getprop(stdout_phandle, "device_type", buf, sizeof(buf)) <= 0) {
+		return 0;
+	}
+
+	if (strcmp(buf, "display") != 0) {
+		/* The display is not stdout device. */
+		return 0;
+	}
+		
+	if (OF_call_method("text-mode3", stdout_ihandle, 0, 0) != 0) {
 		printf("vga_ofbus_match: text-mode3 method invocation on VGA "
 		       "screen device failed\n");
 	}
Index: shark/pccons.c
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/shark/pccons.c,v
retrieving revision 1.18
diff -u -r1.18 pccons.c
--- shark/pccons.c	13 Feb 2004 11:36:17 -0000	1.18
+++ shark/pccons.c	24 Dec 2004 18:11:26 -0000
@@ -165,11 +165,7 @@
 #include <machine/pio.h>
 
 #include <machine/pccons.h>
-#ifdef i386
-#include <machine/pc/display.h>
-#else
-#include <shark/shark/display.h>
-#endif
+#include <dev/ic/pcdisplay.h>
 
 #include <dev/isa/isareg.h>
 #include <dev/isa/isavar.h>
--- /dev/null	2004-12-25 01:22:22.000000000 +0900
+++ conf/WSCONS	2004-12-25 03:10:48.000000000 +0900
@@ -0,0 +1,308 @@
+#	$NetBSD: GENERIC,v 1.35 2004/11/10 17:54:07 christos Exp $
+#
+# Generic Shark configuration.
+#
+
+include	"arch/shark/conf/std.shark"
+
+options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+#ident		"GENERIC-$Revision: 1.35 $"
+
+# estimated number of users
+maxusers	32
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+options 	HZ=64
+#options 	NTP		# NTP phase/frequency locked loop
+options 	NMBCLUSTERS=1024 # XXX, temporarily required
+#options 	BOOT_QUIETLY	# twiddle instead of normal boot msg output
+
+# CPU options
+
+options 	CPU_SA110	# Support the SA110 core
+
+# Architecture options
+
+options 	SHARK		# We are a Shark
+options 	NSIO		# We are using the National Semi SuperIO
+makeoptions	CPUFLAGS="-march=armv4 -mtune=strongarm"
+
+# compatibility with old version of OFW, which may have incorrect
+# properties and/or may set up devices incorrectly.
+options 	COMPAT_OLD_OFW
+
+# FPA options
+
+#options 	ARMFPE		# ARM Ltd FPE
+
+# File systems
+
+file-system	FFS		# UFS
+#file-system	LFS		# log-structured file system
+file-system	MFS		# memory file system
+file-system	NFS		# Network file system
+#file-system 	ADOSFS		# AmigaDOS-compatible file system
+#file-system 	EXT2FS		# second extended file system (linux)
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+file-system	FDESC		# /dev/fd
+#file-system	FILECORE	# Acorn filecore file system
+file-system	KERNFS		# /kern
+file-system	NULLFS		# loopback file system
+#file-system 	OVERLAY		# overlay filesystem
+#file-system	PORTAL		# portal filesystem (still experimental)
+file-system	PROCFS		# /proc
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+#file-system	UNION		# union file system
+#file-system	CODA		# Coda file system (needs vcoda below)
+
+# File system options
+#options 	QUOTA		# UFS quotas
+#options 	FFS_EI		# FFS Endian Independant support
+options 	SOFTDEP		# FFS soft updates support.
+options 	NFSSERVER
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+#options 	IPSEC		# IP security
+#options 	IPSEC_ESP	# IP security (encryption part; define w/IPSEC)
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	NS		# XNS
+#options 	NSIP		# XNS tunneling over IP
+#options 	ISO,TPIP	# OSI
+#options 	EON		# OSI tunneling over IP
+#options 	CCITT,LLC,HDLC	# X.25
+#options 	NETATALK	# AppleTalk networking
+#options 	PFIL_HOOKS	# pfil(9) packet filter hooks (Required
+				# if you enable the pseudo-device ipl).
+
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+options 	NFS_BOOT_DHCP	# use NetBSD standard DHCP/NFS boot code
+#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
+
+#options 	ALTQ		# Manipulate network interfaces' output queues
+#options 	ALTQ_BLUE	# Stochastic Fair Blue
+#options 	ALTQ_CBQ	# Class-Based Queueing
+#options 	ALTQ_CDNR	# Diffserv Traffic Conditioner
+#options 	ALTQ_FIFOQ	# First-In First-Out Queue
+#options 	ALTQ_FLOWVALVE	# RED/flow-valve (red-penalty-box)
+#options 	ALTQ_HFSC	# Hierarchical Fair Service Curve
+#options 	ALTQ_LOCALQ	# Local queueing discipline
+#options 	ALTQ_PRIQ	# Priority Queueing
+#options 	ALTQ_RED	# Random Early Detection
+#options 	ALTQ_RIO	# RED with IN/OUT
+#options 	ALTQ_WFQ	# Weighted Fair Queueing
+
+# Compatibility options
+
+#options 	COMPAT_09	# NetBSD 0.9 compatibility.
+#options 	COMPAT_10	# NetBSD 1.0 compatibility.
+#options 	COMPAT_11	# NetBSD 1.1 compatibility.
+options 	COMPAT_12	# NetBSD 1.2 compatibility.
+options 	COMPAT_13	# NetBSD 1.3 compatibility.
+options 	COMPAT_14	# NetBSD 1.4 compatibility.
+options 	COMPAT_15	# NetBSD 1.5 compatibility.
+options 	COMPAT_16	# NetBSD 1.6 compatibility.
+options 	COMPAT_20	# NetBSD 2.0 compatibility.
+options 	COMPAT_43	# 4.3BSD compatibility.
+options 	COMPAT_LINUX	# Linux compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+# Shared memory options
+
+options 	SYSVMSG		# System V-like message queues
+options 	SYSVSEM		# System V-like semaphores
+options 	SYSVSHM		# System V-like memory sharing
+#options 	SHMMAXPGS=1024	# 1024 pages is the default
+options 	P1003_1B_SEMAPHORE	# p1003.1b semaphore support
+
+# Device options
+
+options 	MEMORY_DISK_HOOKS	# boottime setup of ramdisk
+#options 	MEMORY_DISK_ROOT_SIZE=3400	# Size in blocks
+#options 	MEMORY_DISK_IS_ROOT	# use memory disk as root
+
+options 	XSERVER			# also need INSECURE for now
+options 	INSECURE		# disable kernel securelevel
+
+# Use the following to force the serial to always be the console
+# device.  19200 is what the serial gets set up as by the firmware
+# when it hasn't fallen back from PC.  If it has fallen back then
+# the speed will be set at 9600.
+#options 	COMCONSOLE,CONADDR=0x3f8,CONUNIT=0,CONSPEED=19200
+
+# Miscellaneous kernel options
+options 	KTRACE		# system call tracing, a la ktrace(1)
+options 	SYSTRACE	# system call vetting via systrace(1)
+options 	IRQSTATS	# manage IRQ statistics, XXX temp required
+#options 	LKM		# loadable kernel modules
+options 	KMEMSTATS	# kernel memory statistics, XXX temp required
+options 	USERCONF	# userconf(4) support
+#options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
+options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
+
+# Development and Debugging options
+
+#options 	ARM700BUGTRACK	# track the ARM700 swi bug
+#options 	PORTMASTER	# Enable PortMaster only options
+options 	DIAGNOSTIC	# internal consistency checks
+#options 	PMAP_DEBUG	# Enable pmap_debug_level code
+#options 	IPKDB		# remote kernel debugging
+options 	DDB		# in-kernel debugger
+options		SYMTAB_SPACE=382000	# reserve symbol space for DDB
+				# (needed because we boot netbsd.aout)
+#options 	DDB_ONPANIC=0	# don't run DDB at panictime
+#options 	DDB_HISTORY_SIZE=100	# Enable history editing in 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
+mainbus0 at root
+
+# The boot CPU
+cpu0 at mainbus?
+
+# Open Firmware devices
+ofbus*		at root
+ofbus*		at ofbus?
+#ofdisk* 	at ofbus?
+#ofnet*		at ofbus?	# don't use with cs0
+#ofcons* 	at ofbus?	# don't use with pc0
+ofrtc*		at ofisa?
+ofrom*		at ofbus?
+
+ofisa*		at ofbus?
+ofbus*		at ofisa?
+
+# IDE/ATA disk
+wdc*		at ofisa?
+atabus* 	at wdc? channel ?
+wd*		at atabus? drive ?
+
+atapibus*	at atabus?
+cd*		at atapibus? drive?
+sd*		at atapibus? drive?
+
+# PCCONS@OFW
+#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
+
+# 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?
+
+# Serial @OFW
+com*		at ofisa?
+
+# Parallel @OFW
+lpt*		at ofisa?
+
+# Smart Card
+ofisascr*	at ofisa?
+scr*		at ofisascr?
+
+# ESS Sound@OFW
+ess*		at ofisa?
+audio*		at ess?
+opl*		at ess?
+midi*		at opl?
+
+# Joystick @OFW
+joy*		at ofisa?
+
+pseudo-device	loop	1		# network loopback
+pseudo-device	bpfilter 8		# packet filter
+#pseudo-device	sl	2		# CSLIP
+#pseudo-device	ppp	2		# PPP
+#pseudo-device	tun	2		# network tunneling over tty
+#pseudo-device	ipfilter 1		# ip filter
+pseudo-device	gif	4		# IPv[46] over IPv[46] tunnel (RFC1933)
+#pseudo-device	faith	1		# IPv[46] tcp relay translation i/f
+#pseudo-device	stf	1		# 6to4 IPv6 over IPv4 encapsulation
+#pseudo-device	strip	4		# STarmode Radio IP (Metricon Ricochet)
+pseudo-device	pty			# pseudo-terminals
+#pseudo-device	tb	1		# tablet line discipline
+pseudo-device	vnd	4		# disk-like interface to files
+#pseudo-device	ccd	2		# concatenated disk devices
+#pseudo-device	cgd	4		# cryptographic disk devices
+pseudo-device	rnd			# /dev/random and /dev/urandom
+
+#pseudo-device	md	1		# Ramdisk driver
+#pseudo-device	profiler 1		# fiq based profiling device
+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	ksyms			# /dev/ksyms
+#pseudo-device	pf			# PF packet filter
+#pseudo-device	pflog			# PF log if
--- /dev/null	2004-12-25 01:22:22.000000000 +0900
+++ ofw/vga_ofbusvar.h	2004-12-23 17:41:22.000000000 +0900
@@ -0,0 +1,30 @@
+/* $NetBSD$ */
+
+/*
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ * 
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ * 
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ * 
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+int vga_ofbus_cnattach(bus_space_tag_t, bus_space_tag_t);
--- /dev/null	2004-12-25 01:22:22.000000000 +0900
+++ shark/consinit.c	2004-12-25 02:00:59.000000000 +0900
@@ -0,0 +1,152 @@
+/*	$NetBSD$	*/
+
+/*
+ * 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 */
+	}
+}

---
NetBSD 2.99.11 (DIAMANTE) #36: Sat Dec 25 03:04:12 JST 2004
	tsutsui@mirage:/usr/src/sys/arch/shark/compile/DIAMANTE
total memory = 32768 KB
avail memory = 27984 KB
mainbus0 (root)
cpu0 at mainbus0: SA-110 step S (SA-1 core)
cpu0: DC enabled IC enabled WB enabled EABT
cpu0: 16KB/32B 32-way Instruction cache
cpu0: 16KB/32B 32-way write-back Data cache
ofbus0 (root)
ofbus1 at ofbus0 (packages)
client-services at ofbus1 not configured
terminal-emulator at ofbus1 not configured
stringio at ofbus1 not configured
deblocker at ofbus1 not configured
obp-tftp at ofbus1 not configured
ufs-file-system at ofbus1 not configured
fat-file-system at ofbus1 not configured
iso9660-file-system at ofbus1 not configured
disk-label at ofbus1 not configured
dropin-file-system at ofbus1 not configured
sound.wav at ofbus1 not configured
chosen at ofbus0 not configured
openprom at ofbus0 not configured
options at ofbus0 not configured
aliases at ofbus0 not configured
memory@b000000 at ofbus0 not configured
mmu at ofbus0 not configured
ofbus2 at ofbus0 (vlbus)
ofisa0 at ofbus2 (isa)
dma-controller@i00 at ofisa0 not configured
interrupt-controller@i20 at ofisa0 not configured
timer@i40 at ofisa0 not configured
configuration@i15c at ofisa0 not configured
com0 at ofisa0 (serial@i3f8): ns16550a, working fifo
lpt0 at ofisa0 (parallel@i378)
pckbc0 at ofisa0 (8042@i60)
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0 (mux ignored): console keyboard
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 (mux ignored)
microtime bug: ticks = 10c22
power@i380 at ofisa0 not configured
ofbus3 at ofisa0 (gpio@i3e0)
eeprom at ofbus3 not configured
ofrtc0 at ofisa0 (rtc@i70): rtc
ofisascr0 at ofisa0 (scr@i24)
scr0 at ofisascr0
com1 at ofisa0 (ir@i2f8): ns16550a, working fifo
cs0 at ofisa0 (ethernet@i300): CS8900
cs0: CS8900 rev. F, address 00:e0:a9:10:00:ab, media UTP
microtime bug: ticks = 155c6
joy0 at ofisa0 (game@i201): ESST,game
joy0: joystick not connected
midi@i330 at ofisa0 not configured
ess0 at ofisa0 (sound@i220): ESST,es1887-codec
ess0: ESS Technology ES1887 [version 0x688b]
ess0: audio1 interrupting at irq 9
ess0: audio2 interrupting at irq 15
audio0 at ess0: full duplex, mmap, independent
opl0 at ess0: model OPL3
midi0 at opl0: ESS Yamaha OPL3
wdc0 at ofisa0 (ide@i1f0)
atabus0 at wdc0 channel 0
pci at ofbus2 not configured
vga0 at ofbus2 (display@it3b0)
wsdisplay0 at vga0 (kbdmux ignored): console (80x25, vt100 emulation), using wskbd0
wsdisplay0: screen 1-3 added (80x25, vt100 emulation)
ofrom0 at ofbus0 (flash@7000000): 0x7000000-0x707ffff
ofrom1 at ofbus0 (romcard@10000000): 0x10000000-0x10ffffff
ofbus4 at ofbus0 (cpus)
cpu@0 at ofbus4 not configured
ofbus5 at ofbus0 (udp)
nfs at ofbus5 not configured
ipl_bio=ffffbfff ipl_net=ffffbfdf ipl_tty=ffffaf5d ipl_vm=ffffaf5d
ipl_audio=ffff2d5d ipl_imp=ffff2d5d ipl_high=ffff2d5d ipl_serial=ffff2d45
clock: hz=64 stathz = 0 profhz = 0
boot device: cs0
root on cs0
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP next-server: 192.168.20.17
nfs_boot: my_domain=ceres.dti.ne.jp
nfs_boot: my_addr=192.168.20.8
nfs_boot: my_mask=255.255.255.0
nfs_boot: gateway=192.168.20.17
root on eclipse:/export/NetBSD/shark/root
root file system type: nfs