Subject: Re: ISA PnP boo-boo??
To: None <port-i386@NetBSD.ORG>
From: Christos Zoulas <christos@nyc.deshaw.com>
List: port-i386
Date: 01/28/1997 05:20:18
In article <199701280253.VAA00267@doppelganger.boni.com> rkboni@concentric.net (Rafal Boni) writes:
>Hello folks:
>	I just noticed a problem with a kernel of Sat afternoon vintage (sup
>	on 16:30 Eastern) and ISA Plug and Pray.
>
>	The problem: somewhere in the ISAPNP probe process my machine just 
>	reboots.  DDB is in the kernel, but doesn't catch it... My machine is
>	a P5/100 with no PnP devices (yet... the 3c509B will go in as soon as 
>	I can get a PnP'ized kernel to boot).  The machine has a few pre-PnP
>	ISA cards (an AIC-6x60 scsi card, a SoundBlaster/16 and a SMC Ultra),
>	in case that matters...
>
>	The only unusual piece is that I have patched my tree with the latest
>	rev of Charles' new com driver (thank you, thank you, it's great!).
>
>	(the machine gets to isapnp match but reboots sometime later as an
>	 insertion of a "Debugger();" proved)
>
>	I would debug this further but my monitor seems to be slipping into
>	life-lessness and about 80% of the time I reboot it just comes up
>	black, which makes it somewhat hard to debug autoconfig stuff...
>

Put the two files in sys/dev/isapnp and try running this from user space...

christos

---- Makefile ----

NOMAN=1
PROG=isapnp
MACH=${.CURDIR}/../../arch/i386/isa
SRCS=probe.c isapnp.c isapnpres.c isapnpdebug.c isapnp_machdep.c
.PATH.c: ${MACH}

LDADD+=-li386

.include <bsd.prog.mk>
CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -g -I../.. -I../../arch -O
CC=cc -DDEBUG_ISAPNP

---- probe.c ----

/*	$NetBSD$	*/

/*
 * Copyright (c) 1996 Christos Zoulas.  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 Christos Zoulas.
 * 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.
 */

#include <sys/types.h>
#include <sys/conf.h>
#include <sys/device.h>

#include <machine/bus.h>

#include <dev/isa/isavar.h>

#include <dev/isapnp/isapnpreg.h>
#include <dev/isapnp/isapnpvar.h>

#ifndef NULL
#define NULL 0
#endif

int
main()
{
	extern struct cfattach isapnp_ca;
	struct isa_attach_args ia;
	struct isapnp_softc sc;
	strcpy(sc.sc_dev.dv_xname, "isapnp0");

	i386_iopl(3);

	isapnp_ca.ca_match(NULL, NULL, &ia);
	isapnp_ca.ca_attach(NULL, &sc, &ia);
}