From nobody@FreeBSD.ORG  Fri Sep 29 22:41:54 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 23B7137B503; Fri, 29 Sep 2000 22:41:54 -0700 (PDT)
Message-Id: <20000930054154.23B7137B503@hub.freebsd.org>
Date: Fri, 29 Sep 2000 22:41:54 -0700 (PDT)
From: mzaki@e-mail.ne.jp
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: nexus without initialization causes booting failed
X-Send-Pr-Version: www-1.0

>Number:         21657
>Category:       i386
>Synopsis:       nexus without initialization causes booting failed
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 29 22:50:01 PDT 2000
>Closed-Date:    Sun Oct 1 03:28:06 PDT 2000
>Last-Modified:  Sun Oct 01 03:29:36 PDT 2000
>Originator:     Motomichi Matsuzaki
>Release:        FreeBSD-current (Sep 29 2000)
>Organization:
>Environment:
FreeBSD localhost 5.0-CURRENT FreeBSD 5.0-CURRENT #7: Sat Sep 30 14:01:29 JST 2000
root@localhost:/usr/src/sys/compile/LIBRETTO i386
>Description:
I've updated my laptop (TOSHIBA Libretto) to -current (21:00 29 Sep
GMT) from of 28 Aug, then it wouldn't boot because trap 12 happened.

The boottime messages were shown that:
 :
 :
npx0: INT 16 interface
isa0: <ISA bus>
               ^
               normally is succeeded "on motherboard" but isn't


And the trap 12 (page fault) occured at: 

(sys/i386/i386/nexus.c)
static int
nexus_print_all_resources(device_t dev)
{
        struct  nexus_device *ndev = DEVTONX(dev);
        struct resource_list *rl = &ndev->nx_resources;
                                   ~~~~~~~
                                   This dereference (ndev was NULL!!)

This 'struct nexus_device *ndev' is IVAR of nexus,
and initialized in nexus_add_child(),
but never called this function in my laptop.

>How-To-Repeat:

>Fix:
In nexus_attach(), ISA bus directly binded to nexus is
connected via calling device_add_child(),
but this is probably WRONG. This causes uninitialized IVAR of nexus
because of skipping nexus_add_child().

I changed this to calling nexus_add_child() directly,
and my laptop successfully booted.

--- /usr/src/sys/i386/i386/nexus.c	Fri Sep 29 06:02:31 2000
+++ nexus.c	Sat Sep 30 14:41:11 2000
@@ -259,7 +259,7 @@
 	}
 #endif
 	if (!devclass_get_device(devclass_find("isa"), 0)) {
-		child = device_add_child(dev, "isa", 0);
+		child = nexus_add_child(dev, 0, "isa", 0);
 		if (child == NULL)
 			panic("nexus_attach isa");
 		device_probe_and_attach(child);



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Sun Oct 1 03:28:06 PDT 2000 
State-Changed-Why:  
Fixed in i386/i386/nexus.c rev 1.36 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21657 
>Unformatted:
