| Summary: | nexus without initialization causes booting failed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Motomichi Matsuzaki <mzaki> | ||||
| Component: | i386 | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Unspecified | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->closed Fixed in i386/i386/nexus.c rev 1.36 |
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.