Subject: port-i386/10042: pnpbios reboots mid-probe on Vaio Z505HE?
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 05/03/2000 20:45:22
>Number:         10042
>Category:       port-i386
>Synopsis:       pnpbios reboots mid-probe on Vaio Z505HE?
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 03 20:46:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        Wed May  3 12:47 EDT
>Organization:
MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.4X NetBSD 1.4X (ZORKMID) #39: Wed May 3 23:14:23 EDT 2000 jhawk@zorkmid.mit.edu:/usr/local/current-src/sys/arch/i386/compile/ZORKMID i386


>Description:
	After enabling "pnpbios0 at mainbus", my Sony VAIO PCG-Z505HE
reboots midway through the pnpbios code.

	It appears that a call to pnpbios_getnode() for the very last
index number (index number 20, it so happens) is what kills it.
We call pnpbioscall() and never return.

>How-To-Repeat:
	Uncomment pnpbios0. Boot.

Here's my kernel config as a diff from GENERIC:
---cut
--- GENERIC	Wed May  3 12:44:44 2000
+++ ZORKMID	Wed May  3 21:07:46 2000
@@ -1,11 +1,11 @@
-#	$NetBSD: GENERIC,v 1.332 2000/05/02 11:00:56 augustss Exp $
+#	$NetBSD: GENERIC,v 1.332 2000/04/28 17:23:52 uch Exp $
 #
-#	GENERIC -- everything that's currently supported
+#	from GENERIC -- everything that's currently supported
 #
 
 include "arch/i386/conf/std.i386"
 
-#ident 		"GENERIC-$Revision: 1.332 $"
+#ident 		"ZORKMID-$Revision: 1.3 $"
 
 maxusers	32		# estimated number of users
 
@@ -27,7 +27,7 @@
 
 # Misc. i386-specific options
 options 	XSERVER		# X server support in console drivers
-#options 	XSERVER_DDB	# PF12 gets you into DDB when X is running
+options 	XSERVER_DDB	# PF12 gets you into DDB when X is running
 
 # This option allows you to force a serial console at the specified
 # I/O address.   see console(4) for details.
@@ -49,7 +49,7 @@
 options 	UCONSOLE	# users can use TIOCCONS (for xconsole)
 options 	INSECURE	# disable kernel security levels
 
-options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+options 	RTC_OFFSET=300	# hardware clock is this many mins. west of GMT
 options 	NTP		# NTP phase/frequency locked loop
 
 options 	KTRACE		# system call tracing via ktrace(1)
@@ -66,10 +66,11 @@
 #options 	DEBUG		# expensive debugging checks/support
 #options 	KMEMSTATS	# kernel memory statistics (vmstat -m)
 options 	DDB		# in-kernel debugger
-#options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
+options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
 #options 	KGDB		# remote debugger
 #options 	"KGDB_DEVNAME=\"com\"",KGDBADDR=0x3f8,KGDBRATE=9600
 #makeoptions	DEBUG="-g"	# compile full symbol table
+#options		APMDEBUG
 
 # Compatibility options
 options 	COMPAT_NOMID	# compatibility with 386BSD, BSDI, NetBSD 0.8,
@@ -160,7 +161,8 @@
 #options 	PCMCIAVERBOSE	# verbose PCMCIA configuration messages
 options 	SCSIVERBOSE	# human readable SCSI error messages
 options 	USBVERBOSE	# verbose USB device autoconfig messages
-#options 	PNPBIOSVERBOSE	# verbose PnP BIOS messages
+options 	PNPBIOSVERBOSE	# verbose PnP BIOS messages
+options 	PNPBIOSDEBUG
 
 options 	NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM
 
@@ -196,7 +198,7 @@
 
 mainbus0 at root
 
-#apm0	at mainbus0			# Advanced power management
+apm0	at mainbus0			# Advanced power management
 
 # Tuning for power management, see apm(4) for more details.
 #options 	APM_NO_IDLE		# Don't call BIOS CPU idle function
@@ -214,13 +216,13 @@
 pci*	at ppb? bus ?
 
 # Configure PCI using BIOS information
-#options 	PCIBIOS			# PCI BIOS support
-#options 	PCIBIOSVERBOSE		# PCI BIOS verbose info
-#options 	PCIBIOS_INTR_FIXUP	# fixup PCI interrupt routing
-#options 	PCIBIOS_IRQS_HINT="0x0a00"	# PCI interrupts hint. IRQ 9 or 11
-#options 	PCIINTR_DEBUG		# super-verbose PCI interrupt fixup
-#options 	PCIBIOS_BUS_FIXUP	# fixup PCI bus numbering
-#options 	PCIBIOS_ADDR_FIXUP	# fixup PCI I/O address
+options 	PCIBIOS			# PCI BIOS support
+options 	PCIBIOSVERBOSE		# PCI BIOS verbose info
+options 	PCIBIOS_INTR_FIXUP	# fixup PCI interrupt routing
+options 	PCIBIOS_IRQS_HINT="0x0a00"	# PCI interrupts hint. IRQ 9 or 11
+##options 	PCIINTR_DEBUG		# super-verbose PCI interrupt fixup
+options 	PCIBIOS_BUS_FIXUP	# fixup PCI bus numbering
+options 	PCIBIOS_ADDR_FIXUP	# fixup PCI I/O address
 
 # PCI bridges
 pchb*	at pci? dev ? function ?	# PCI-Host bridges
@@ -240,6 +242,10 @@
 isa*	at pcib?
 
 # PCMCIA bus support
+
+options PCIC_ISA_ALLOC_IOBASE=0x400
+options PCIC_ISA_ALLOC_IOSIZE=0xbff
+
 pcmcia*	at pcic? controller ? socket ?
 pcmcia*	at tcic? controller ? socket ?
 
@@ -258,11 +264,11 @@
 pcic*	at isapnp?
 
 # CardBus bus support
-#cbb*		at pci? dev ? function ?
-#cardslot*	at cbb?	
+cbb*		at pci? dev ? function ?
+cardslot*	at cbb?	
 
-#cardbus*	at cardslot?
-#pcmcia* 	at cardslot?
+cardbus*	at cardslot?
+pcmcia* 	at cardslot?
 
 # Coprocessor Support
 
@@ -317,13 +323,13 @@
 com*	at pcmcom? slave ?		# ...and the slave devices
 
 # CardBus serial interfaces
-#com*	at cardbus? function ?		# Modems and serial cards
+com*	at cardbus? function ?		# Modems and serial cards
 
 # ISA serial interfaces
 #options 	COM_HAYESP		# adds Hayes ESP serial board support
-com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
-com1	at isa? port 0x2f8 irq 3
-com2	at isa? port 0x3e8 irq 5
+com*	at isa? port 0x3f8 irq 4	# Standard PC serial ports
+com*	at isa? port 0x2f8 irq 3
+com*	at isa? port 0x3e8 irq 5
 #com3	at isa? port 0x2e8 irq 9
 #ast0	at isa? port 0x1a0 irq 5	# AST 4-port serial cards
 #com*	at ast? slave ?
@@ -345,9 +351,9 @@
 lpt*	at puc? port ?			# || ports on "universal" comm boards
 
 # ISA parallel printer interfaces
-lpt0	at isa? port 0x378 irq 7	# standard PC parallel ports
-lpt1	at isa? port 0x278
-lpt2	at isa? port 0x3bc
+lpt*	at isa? port 0x378 irq 7	# standard PC parallel ports
+lpt*	at isa? port 0x278
+lpt*	at isa? port 0x3bc
 
 # LM7[89] and compatible hardware monitors
 #lm0	at isa?	port 0x290		# other common ports: 0x280, 0x310
@@ -398,7 +404,7 @@
 wds1	at isa? port 0x358 irq 11 drq 5
 
 # CardBus SCSI cards
-#ahc*	at cardbus? dev ? function ?	# Adaptec ADP-1480
+ahc*	at cardbus? dev ? function ?	# Adaptec ADP-1480
 
 # SCSI bus support
 scsibus* at adv?
@@ -574,10 +580,10 @@
 we1	at isa? port 0x300 iomem 0xcc000 irq 10
 
 # CardBus network cards
-#ex*	at cardbus? dev ? function ?	# 3Com 3C575TX
-#fxp*	at cardbus? dev ? function ?	# Intel i8255x
-#tlp*	at cardbus? dev ? function ?	# DECchip 21143
-#rtk*	at cardbus? dev ? function ?	# Realtek 8129/8139
+ex*	at cardbus? dev ? function ?	# 3Com 3C575TX
+fxp*	at cardbus? dev ? function ?	# Intel i8255x
+tlp*	at cardbus? dev ? function ?	# DECchip 21143
+rtk*	at cardbus? dev ? function ?	# Realtek 8129/8139
 
 # MII/PHY support
 exphy*	at mii? phy ?			# 3Com internal PHYs
@@ -600,7 +606,7 @@
 ohci*	at pci?	dev ? function ?	# Open Host Controller
 
 # CardBus USB controllers
-#ohci*	at cardbus? dev ? function ?	# Open Host Controller
+ohci*	at cardbus? dev ? function ?	# Open Host Controller
 
 # USB bus support
 usb*	at uhci?
@@ -662,22 +668,22 @@
 
 # Plug-and-Play BIOS and attached devices
 
-#pnpbios0 at mainbus0
+pnpbios0 at mainbus0
 
 # mainboard audio chips
-#ess*	at pnpbios0 index ?	# ESS AudioDrive
-#sb*	at pnpbios0 index ?	# NeoMagic 256AV in sb mode
-#wss*	at pnpbios0 index ?	# NeoMagic 256AV in wss mode
-#ym*	at pnpbios0 index ?	# OPL3-SA3
+ess*	at pnpbios0 index ?	# ESS AudioDrive
+sb*	at pnpbios0 index ?	# NeoMagic 256AV in sb mode
+wss*	at pnpbios0 index ?	# NeoMagic 256AV in wss mode
+ym*	at pnpbios0 index ?	# OPL3-SA3
 
 # com port
-#com*	at pnpbios0 index ?
+com*	at pnpbios0 index ?
 
 # parallel port
-#lpt*	at pnpbios0 index ?
+lpt*	at pnpbios0 index ?
 
 # IDE controller on Toshiba Portege 3000 series (crippled PCI device)
-#pciide* at pnpbios0 index ?
+pciide* at pnpbios0 index ?
 
 
 # Audio Devices
@@ -811,7 +817,7 @@
 pseudo-device	vnd		4	# disk-like interface to files
 
 # network pseudo-devices
-pseudo-device	bpfilter	8	# Berkeley packet filter
+pseudo-device	bpfilter	32	# Berkeley packet filter
 pseudo-device	ipfilter		# IP filter (firewall) and NAT
 pseudo-device	loop			# network loopback
 pseudo-device	ppp		2	# Point-to-Point Protocol
---cut

Here's a log of the boot with my workaround (see below) applied:

---cut
[ netbsd ELF symbol table not valid ]
[ preserving 426416 bytes of netbsd a.out symbol table ]
Copyright (c) 1996, 1997, 1998, 1999, 2000
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.4X (ZORKMID) #39: Wed May  3 23:14:23 EDT 2000
    jhawk@zorkmid.mit.edu:/usr/local/current-src/sys/arch/i386/compile/ZORKMID
cpu0: family 6 model 8 step 1
cpu0: Intel Pentium III (E) (686-class)
total memory = 65088 KB
avail memory = 55748 KB
using 839 buffers containing 3356 KB of memory
BIOS32 rev. 0 found at 0xfd880
PCI BIOS rev. 2.1 found at 0xfd99e
pcibios: config mechanism [1][x], special cycles [x][x], last bus 1
PCI IRQ Routing Table rev. 1.0 found at 0xfdf40, size 160 bytes (8 entries)
PCI Interrupt Router at 000:07:0 (Intel 82371FB PCI-to-ISA Bridge (PIIX))
--------------------------------------------
  device vendor product pin PIRQ   IRQ stage
--------------------------------------------
000:07:2 0x8086 0x7112  D   0x03   09  1
000:08:0 0x104d 0x8039  A   0x03   09  1
000:09:0 0x1073 0x0010  A   0x02   09  1
000:10:0 0x14f1 0x2443  A   0x01   09  1
000:11:0 0x8086 0x1229  A   0x00   09  0
000:12:0 0x1180 0x0475  A   0x01   09  1
000:13:0 0x104d 0x808a  A   0x01   09  1
--------------------------------------------
PCI bridge 0: primary 0, secondary 1, subordinate 1
PCI bridge 1: primary 0, secondary 2, subordinate 2
PCI bus #2 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size       mask
--------------------------------------------
000:00:0 0x8086 0x7190 
	10h mem  0x40000000 0x01000000 8
		[OK]
000:01:0 0x8086 0x7191 
		[OK]
000:07:0 0x8086 0x7110 
		[OK]
000:07:1 0x8086 0x7111 
	20h port 0x0000fcb0 0x00000010 1
		[OK]
000:07:2 0x8086 0x7112 
	20h port 0x0000fc60 0x00000020 1
		[OK]
000:07:3 0x8086 0x7113 
		[OK]
000:08:0 0x104d 0x8039 
	10h mem  0xfecfe000 0x00000800 0
	14h mem  0xfecfec00 0x00000200 0
		[OK]
000:09:0 0x1073 0x0010 
	10h mem  0xfecf0000 0x00008000 0
	14h port 0x0000fc00 0x00000040 1
	18h port 0x0000fcac 0x00000004 1
		[OK]
000:10:0 0x14f1 0x2443 
	10h mem  0xfece0000 0x00010000 0
	14h port 0x0000fca0 0x00000008 1
		[OK]
000:11:0 0x8086 0x1229 
	10h mem  0xfecff000 0x00001000 0
	14h port 0x0000fcc0 0x00000040 1
	18h mem  0xfed00000 0x00100000 0
		[OK]
000:12:0 0x1180 0x0475 
	10h mem  0x00000000 0x00001000 0
		[NG]
000:13:0 0x104d 0x808a 
	10h mem  0xfecfe800 0x00000400 0
		[OK]
--------------------------[  1 devices bogus]
WARNING: can't reserve area for I/O APIC.
 Physical memory end: 0x03fed000
 PCI memory mapped I/O space start: 0x04000000
[PCIBIOS fixup stage]-----------------------
  device vendor product
  register space address    size       mask
--------------------------------------------
000:00:0 0x8086 0x7190 
	10h mem  0x40000000 0x01000000 8
		[OK]
000:01:0 0x8086 0x7191 
		[OK]
000:07:0 0x8086 0x7110 
		[OK]
000:07:1 0x8086 0x7111 
	20h port 0x0000fcb0 0x00000010 1
		[OK]
000:07:2 0x8086 0x7112 
	20h port 0x0000fc60 0x00000020 1
		[OK]
000:07:3 0x8086 0x7113 
		[OK]
000:08:0 0x104d 0x8039 
	10h mem  0xfecfe000 0x00000800 0
	14h mem  0xfecfec00 0x00000200 0
		[OK]
000:09:0 0x1073 0x0010 
	10h mem  0xfecf0000 0x00008000 0
	14h port 0x0000fc00 0x00000040 1
	18h port 0x0000fcac 0x00000004 1
		[OK]
000:10:0 0x14f1 0x2443 
	10h mem  0xfece0000 0x00010000 0
	14h port 0x0000fca0 0x00000008 1
		[OK]
000:11:0 0x8086 0x1229 
	10h mem  0xfecff000 0x00001000 0
	14h port 0x0000fcc0 0x00000040 1
	18h mem  0xfed00000 0x00100000 0
		[OK]
000:12:0 0x1180 0x0475 
	10h mem  0x04000000 0x00001000 0
		[OK]
000:13:0 0x104d 0x808a 
	10h mem  0xfecfe800 0x00000400 0
		[OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
pnpbios0 at mainbus0: code f0000, data 400, entry b33f, control 1 eventp 400
pnpbios0: nodes 17, max len 210
PNP0C02: type 0x06 subtype 0x01 dpi 0x00 attr 0x0003:
PNP0C02: allocated config scan:
	tag fixedmem32range flags 00 min fff80000 max fff80000 align 00000000 len 00080000
	tag fixedmem32range flags 00 min fff7f600 max fff7f600 align 00000000 len 00000a00
	tag io flags 01 min 0398 max 0398 align 0x01 len 0x02
	tag io flags 01 min 04d0 max 04d0 align 0x01 len 0x02
	tag io flags 01 min 8000 max 8000 align 0x01 len 0x50
	tag io flags 01 min 1040 max 1040 align 0x01 len 0x10
	tag io flags 01 min 0010 max 0010 align 0x01 len 0x09
	tag io flags 01 min 001f max 001f align 0x01 len 0x01
	tag io flags 01 min 0024 max 0024 align 0x01 len 0x02
	tag io flags 01 min 0028 max 0028 align 0x01 len 0x02
	tag io flags 01 min 002c max 002c align 0x01 len 0x02
	tag io flags 01 min 0030 max 0030 align 0x01 len 0x02
	tag io flags 01 min 0034 max 0034 align 0x01 len 0x02
	tag io flags 01 min 0038 max 0038 align 0x01 len 0x02
	tag io flags 01 min 003c max 003c align 0x01 len 0x02
	tag io flags 01 min 0050 max 0050 align 0x01 len 0x03
	tag io flags 01 min 0072 max 0072 align 0x01 len 0x06
	tag io flags 01 min 0080 max 0080 align 0x01 len 0x01
	tag io flags 01 min 0090 max 0090 align 0x01 len 0x10
	tag io flags 01 min 00a4 max 00a4 align 0x01 len 0x02
	tag io flags 01 min 00a8 max 00a8 align 0x01 len 0x02
	tag io flags 01 min 00ac max 00ac align 0x01 len 0x02
	tag io flags 01 min 00b0 max 00b0 align 0x01 len 0x0e
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0C02 (mem fff80000-ffffffff fff7f600-fff7ffff, io 398-399 4d0-4d1 8000-804f 1040-104f 10-18 1f 24-25 28-29 2c-2d 30-31 34-35 38-39 3c-3d 50-52 72-77 80 90-9f a4-a5 a8-a9 ac-ad b0-bd) at pnpbios0 index 0 ignored
PNP0C01: type 0x05 subtype 0x00 dpi 0x00 attr 0x0003:
PNP0C01: allocated config scan:
	tag fixedmem32range flags 01 min 00000000 max 00000000 align 00000000 len 000a0000
	tag fixedmem32range flags 60 min 000e8000 max 000e8000 align 00000000 len 00018000
	tag fixedmem32range flags 00 min 00100000 max 00100000 align 00000000 len 03f00000
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0C01 (mem 0-9ffff e8000-fffff 100000-3ffffff) at pnpbios0 index 1 ignored
PNP0200: type 0x08 subtype 0x01 dpi 0x01 attr 0x0003:
PNP0200: allocated config scan:
	tag io flags 01 min 0000 max 0000 align 0x01 len 0x10
	tag io flags 01 min 0081 max 0081 align 0x01 len 0x0f
	tag io flags 01 min 00c0 max 00c0 align 0x01 len 0x20
	tag dma flags 01 mask 10
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0200 (io 0-f 81-8f c0-df, dma 4) at pnpbios0 index 2 ignored
PNP0000: type 0x08 subtype 0x00 dpi 0x01 attr 0x0003:
PNP0000: allocated config scan:
	tag io flags 01 min 0020 max 0020 align 0x01 len 0x02
	tag io flags 01 min 00a0 max 00a0 align 0x01 len 0x02
	tag irq flags 01 mask 0004
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0000 (io 20-21 a0-a1, irq 2) at pnpbios0 index 3 ignored
PNP0100: type 0x08 subtype 0x02 dpi 0x01 attr 0x0003:
PNP0100: allocated config scan:
	tag io flags 01 min 0040 max 0040 align 0x01 len 0x04
	tag irq flags 01 mask 0001
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0100 (io 40-43, irq 0) at pnpbios0 index 4 ignored
PNP0B00: type 0x08 subtype 0x03 dpi 0x01 attr 0x0003:
PNP0B00: allocated config scan:
	tag io flags 01 min 0070 max 0070 align 0x01 len 0x02
	tag irq flags 01 mask 0100
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0B00 (io 70-71, irq 8) at pnpbios0 index 5 ignored
PNP0303: type 0x09 subtype 0x00 dpi 0x00 attr 0x0003:
PNP0303: allocated config scan:
	tag io flags 01 min 0060 max 0060 align 0x01 len 0x01
	tag io flags 01 min 0064 max 0064 align 0x01 len 0x01
	tag irq flags 01 mask 0002
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0303 (io 60 64, irq 1) at pnpbios0 index 6 ignored
PNP0C04: type 0x0b subtype 0x80 dpi 0x00 attr 0x0003:
PNP0C04: allocated config scan:
	tag io flags 01 min 00f0 max 00f0 align 0x01 len 0x10
	tag irq flags 01 mask 2000
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0C04 (io f0-ff, irq 13) at pnpbios0 index 7 ignored
PNP0800: type 0x04 subtype 0x01 dpi 0x00 attr 0x0003:
PNP0800: allocated config scan:
	tag io flags 01 min 0061 max 0061 align 0x01 len 0x01
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0800 (io 61) at pnpbios0 index 8 ignored
PNP0A03: type 0x06 subtype 0x04 dpi 0x00 attr 0x0003:
PNP0A03: allocated config scan:
	tag io flags 01 min 0cf8 max 0cf8 align 0x01 len 0x08
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0A03 (io cf8-cff) at pnpbios0 index 9 ignored
PNP0C02: type 0x05 subtype 0x00 dpi 0x00 attr 0x0003:
PNP0C02: allocated config scan:
	tag mem32range flags 01 min 000dc000 max 000dc000 align 00004000 len 00004000
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0C02 (mem dc000-dffff) at pnpbios0 index 10 ignored
PNP0C02: type 0x05 subtype 0x00 dpi 0x00 attr 0x0003:
PNP0C02: allocated config scan:
	tag fixedmem32range zeroed
	tag fixedmem32range zeroed
	tag fixedmem32range zeroed
	tag fixedmem32range zeroed
	tag fixedmem32range zeroed
	tag fixedmem32range zeroed
	tag end cksum 00
	possible config scan:
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0C02 at pnpbios0 index 11 disabled
PNP0E03: type 0x06 subtype 0x05 dpi 0x00 attr 0x0180:
PNP0E03: allocated config scan:
	tag io flags 01 min 03e0 max 03e0 align 0x01 len 0x02
	tag end cksum 00
	possible config scan:
	tag io flags 01 min 03e0 max 03e0 align 0x01 len 0x02
	tag end cksum 00
	compat id scan:
	tag compatid PNP0E00
	tag end cksum 00
PNP0E03, PNP0E00 (io 3e0-3e1) at pnpbios0 index 12 ignored
PNP0501: type 0x07 subtype 0x00 dpi 0x02 attr 0x0080:
PNP0501: allocated config scan:
	tag io flags 01 min 03f8 max 03f8 align 0x01 len 0x08
	tag irq flags 01 mask 0010
	tag end cksum 00
	possible config scan:
	tag startdep flags 01
	tag io flags 01 min 03f8 max 03f8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 02f8 max 02f8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 03e8 max 03e8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 02e8 max 02e8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 0238 max 0238 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 0338 max 0338 align 0x01 len 0x08
	tag enddep
	tag irq flags 01 mask 0c38
	tag end cksum 00
	compat id scan:
	tag end cksum 00
com0 at pnpbios0 index 14 (PNP0501)
com0: io 3f8-3ff, irq 4
com0: ns16550a, working fifo
com0: console
sNY7001: type 0x07 subtype 0x00 dpi 0x02 attr 0x0080:
sNY7001: allocated config scan:
	tag io flags 01 min 03e8 max 03e8 align 0x01 len 0x08
	tag irq flags 01 mask 0400
	tag dma flags 00 mask 01
	tag end cksum 00
	possible config scan:
	tag startdep flags 01
	tag io flags 01 min 03f8 max 03f8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 02f8 max 02f8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 03e8 max 03e8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 02e8 max 02e8 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 0238 max 0238 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 0338 max 0338 align 0x01 len 0x08
	tag enddep
	tag irq flags 01 mask 0c38
	tag dma flags 00 mask 0b
	tag end cksum 00
	compat id scan:
	tag compatid NSC6001
	tag end cksum 00
sNY7001, NSC6001 (io 3e8-3ef, irq 10, dma 0) at pnpbios0 index 15 ignored
PNP0401: type 0x07 subtype 0x01 dpi 0x02 attr 0x0080:
PNP0401: allocated config scan:
	tag io flags 01 min 0378 max 0378 align 0x01 len 0x08
	tag io flags 01 min 0778 max 0778 align 0x01 len 0x08
	tag irq flags 01 mask 0080
	tag dma flags 00 mask 08
	tag end cksum 00
	possible config scan:
	tag startdep flags 01
	tag io flags 01 min 0378 max 0378 align 0x01 len 0x08
	tag io flags 01 min 0778 max 0778 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 0278 max 0278 align 0x01 len 0x08
	tag io flags 01 min 0678 max 0678 align 0x01 len 0x08
	tag startdep flags 01
	tag io flags 01 min 03bc max 03bc align 0x01 len 0x03
	tag io flags 01 min 07bc max 07bc align 0x01 len 0x03
	tag enddep
	tag irq flags 01 mask 00a0
	tag dma flags 00 mask 0b
	tag end cksum 00
	compat id scan:
	tag end cksum 00
lpt0 at pnpbios0 index 18 (PNP0401)
lpt0: io 378-37f 778-77f, irq 7, dma 3
ZORKMID special handling
PNP0F13: type 0x09 subtype 0x02 dpi 0x00 attr 0x0088:
PNP0F13: allocated config scan:
	tag irq flags 01 mask 1000
	tag end cksum 00
	possible config scan:
	tag irq flags 01 mask 1000
	tag end cksum 00
	compat id scan:
	tag end cksum 00
PNP0F13 (irq 12) at pnpbios0 index 20 ignored
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82443BX Host Bridge/Controller (rev. 0x03)
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Neomagic MagicMedia 256AV VGA (rev. 0x20)
wsdisplay0 at vga1
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <TOSHIBA MK8113MAT>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 7815 MB, 16938 cyl, 15 head, 63 sec, 512 bytes/sect x 16006410 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: disabling secondary channel (no drives)
uhci0 at pci0 dev 7 function 2: Intel 82371AB USB Host Controller (PIIX4) (rev. 0x01)
uhci0: interrupting at irq 9
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revision 0x03) at pci0 dev 7 function 3 not configured
Sony CXD3222 OHCI i.LINK(IEEE 1394) PCI controller (Firewire serial bus, interface 0x10, revision 0x02) at pci0 dev 8 function 0 not configured
Yamaha product 0x0010 (audio multimedia, revision 0x02) at pci0 dev 9 function 0 not configured
Conexant Systems SoftK56 PCI Software Modem (miscellaneous communications, revision 0x01) at pci0 dev 10 function 0 not configured
fxp0 at pci0 dev 11 function 0: Intel i82557 Ethernet, rev 8
fxp0: interrupting at irq 9
fxp0: Ethernet address 08:00:46:06:00:6b, 10/100 Mb/s
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
cbb0 at pci0 dev 12 function 0: Ricoh 5C475 PCI-CardBus bridge (rev. 0x80)
Sony Memory Stick I/F Controller (flash memory, revision 0x01) at pci0 dev 13 function 0 not configured
isa0 at pcib0
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
sb0 at isa0 port 0x220-0x237 irq 5 drq 1: dsp v3.01
audio0 at sb0: half duplex, mmap, independent
midi0 at sb0: SB MIDI UART
opl0 at sb0: model OPL3
midi1 at opl0: SB Yamaha OPL3
pcppi0 at isa0 port 0x61
midi2 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0xd0000-0xdffff
pcic0: controller 0 (Intel 82365SL Revision 1) has socket A only
pcic0: controller 1 (Intel 82365SL Revision 1) has no sockets
pcmcia0 at pcic0 controller 0 socket 0
isapnp0: no ISA Plug 'n Play devices found
cbb0: interrupting at irq 9
cbb0: cacheline 0x0 lattimer 0x20
cbb0: bhlc 0x21000 lscp 0x20020200
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 2 device 0 cacheline 0x0, lattimer 0x20
pcmcia1 at cardslot0
apm0 at mainbus0: Power Management spec V1.2
biomask ef4d netmask ef4d ttymask ffcf
pcic0: controller 0 detecting irqs with mask 0xdeb8:
pcic0: no available irq; polling for socket events
wi0 at pcmcia1 function 0
wi0: address 00:60:1d:f6:34:ca
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
swapctl: adding /dev/wd0b as swap device at priority 0
Automatic boot in progress: starting file system checks.
---cut

Without the workaround, it just reboots immediately after the lpt
probe. Debugging printfs and ddb confirm this is pnpbioscall()
failing.

>Fix:
	
It appears that there's some problem calling "Get System Device Node"
on index 20 on this box. The flag word of pnpbios_getnode() ios passed
to "Get System Device Node", and indicates whether to get
information on the current state of the device, or the configuration
at next boot. Choosing the configuration at next boot doesn't cause
the machine to reboot, and presumably the information is the same
if the device has not been reconfigured.

So my workaround is to call pnpbios_getnode() with flags=2 instead
of flags=1 for this device only. It seems to "work", but the device
isn't recognized anyhow. Certainly the pnpbios probe no longer
reboots the machine in mid-boot.

This is obviously not a good workaround and can't be applied to the
tree. Possible (?) workarounds:

a)	Add a quirk table to select indices to exclude. Presumably
	detect this laptop via some mechanism. I don't know what
	that mechanism would be:
		i)	Checksum of the PNP data?
		ii)	oem_revision field from ACPI tables
		ii)	Some special BIOS-specific kludge?

b)	Add a kernel option to provide a list of indices to be
	excluded. This is a sorry choice since it requires
	manual configuration by anyone who has one of these
	problem children.

c)	Discover some special tag/feature of index 20 (or index 18,
	the previous index) that indicates that 20 should be avoided.

d)	Figure out why the BIOS is actually rebooting the machine?
	It's terribly difficult to debug this with ddb because
	ddb becomes unusable in 16-bit land. cf. kern/10016.

Anyhow, my non-portable workaround:

Index: pnpbios.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/pnpbios/pnpbios.c,v
retrieving revision 1.15
diff -c -r1.15 pnpbios.c
*** pnpbios.c	2000/04/27 16:41:59	1.15
--- pnpbios.c	2000/05/04 03:28:37
***************
*** 357,363 ****
--- 357,373 ----
  	idx = 0;
  	for (i = 0; i < num && idx != 0xff; i++) {
  		int node = idx;
+ #if 0
  		res = pnpbios_getnode(1, &idx, buf, size);
+ #else
+ 		if (idx == 20) {
+ 			printf("ZORKMID special handling\n");
+ 			res = pnpbios_getnode(2, &idx, buf, size);
+ 		} else
+ 			res = pnpbios_getnode(1, &idx, buf, size);
+ #endif
+ 
+ 
  		if (res) {
  			printf("pnpbios_getnode: error %d\n", res);
  			continue;


Incidently, the first arg to pnpbios_getnode() should probably
be specified by a macro.

>Release-Note:
>Audit-Trail:
>Unformatted: