Bug 21657

Summary: nexus without initialization causes booting failed
Product: Base System Reporter: Motomichi Matsuzaki <mzaki>
Component: i386Assignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Motomichi Matsuzaki 2000-09-30 06:50:01 UTC
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.

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.
Comment 1 Peter Wemm freebsd_committer freebsd_triage 2000-10-01 11:28:06 UTC
State Changed
From-To: open->closed

Fixed in i386/i386/nexus.c rev 1.36