Port-mips archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
MIPS Alchemy machine don't boot *again*
Hi! all,
My Alchemy machine was not able to boot though build the binary of
evbmips-el at current 20100120.
warning: no /dev/console
init path (default /sbin/init):
init: copying out path `/sbin/init' 11
pid 1(init): ABI set to O32 (e_flags=0x1007)
panic: init died (signal 0, exit 1)
Stopped in pid 1.1 (init) at netbsd:cpu_Debugger+0x4: jr ra
bdslot: nop
db> bt
cpu_Debugger+4 (87ffe000,803887bc,b2,803887d8) ra 8026e230 sz 0
panic+234 (87ffe000,0,1,7dfed8c4) ra 801d6a68 sz 48
exit1+808 (87ffe000,0,1,7dfed8c4) ra 801d6b34 sz 128
sys_exit+60 (87ffe000,0,1,7dfed8c4) ra 80282b38 sz 32
syscall+128 (87ffe000,0,1,7dfed8c4) ra 8020f240 sz 120
mips32_SystemCall+dc (87ffe000,0,1,7dfed8c4) ra 7dfed8c4 sz 0
PC 0x7dfed8c4: not in kernel space
0+7dfed8c4 (87ffe000,0,1,7dfed8c4) ra 0 sz 0
User-level: pid 1.1
Then, I linked init(1) statically and tried booting again. As a result,
the following message was seen in the place where init(1) tried the
execution of sh(1).
init path (default /sbin/init):
init: copying out path `/sbin/init' 11
pid 1(init): ABI set to O32 (e_flags=0x1007)
Shared object "" not found
It try to load the shared library with no name. X-<
sh(1) links the following libraries.
# ldd /bin/sh
/bin/sh:
-lc.12 => /lib/libc.so.12
-ltermcap.0 => /lib/libtermcap.so.0
-ledit.3 => /lib/libedit.so.3
Then, I did the patching attaching diff to ld.elf_so and tried debugging.
However, I saw the strange phenomenon further.
This correction taught to me, sh(1) loads libtermcap, libedit, and no-name
library.
pid 1(init): ABI set to O32 (e_flags=0x1007)
_rtld_digest_dynamic: execname=/libexec/ld.elf_so
STRTAB: strtab=0x7dfc23e8
STRSZ: strsize=4687
_rtld_digest_dynamic: execname=/bin/sh
NEEDED: name=4411
0x403f9b: (74 00) 6c 69 62 65 64 69 74 2e
NEEDED: name=4488
0x403fe8: (74 00) 6c 69 62 74 65 72 6d 63
NEEDED: name=4514
0x404002: (00 00) 00 00 00 00 00 00 00 00
STRTAB: strtab=0x402e60
STRSZ: strsize=4573
:
In addition, if I defined 'OK', libc was seen at this time.
Refer from just 0x403fff to this.
pid 1(init): ABI set to O32 (e_flags=0x1007)
_rtld_digest_dynamic: execname=/libexec/ld.elf_so
STRTAB: strtab=0x7dfc23e8
STRSZ: strsize=4687
_rtld_digest_dynamic: execname=/bin/sh
NEEDED: name=4411
0x403f9b: (65 74 00) 6c 69 62 65 64 69 74 2e
NEEDED: name=4488
0x403fe8: (78 74 00) 6c 69 62 74 65 72 6d 63
NEEDED: name=4514
0x404002: (61 62 00) 6c 69 62 63 2e 73 6f 2e
STRTAB: strtab=0x402e60
STRSZ: strsize=4573
:
Is my debugging wrong?
Or does anyone understand the cause? (paging? or cache?)
Please give your idea to me.
Thanks,
--
kiyohara
Index: headers.c
===================================================================
RCS file: /cvsroot/src/libexec/ld.elf_so/headers.c,v
retrieving revision 1.28
diff -u -r1.28 headers.c
--- headers.c 12 Apr 2009 13:29:29 -0000 1.28
+++ headers.c 25 Jan 2010 15:23:56 -0000
@@ -73,6 +73,7 @@
Elf_Addr pltrel = 0, pltrelsz = 0;
Elf_Addr init = 0, fini = 0;
+printf("%s: execname=%s\n", __func__, execname);
for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; ++dynp) {
switch (dynp->d_tag) {
@@ -127,10 +128,12 @@
case DT_STRTAB:
obj->strtab = (const char *)
(obj->relocbase + dynp->d_un.d_ptr);
+printf(" STRTAB: strtab=%p\n", obj->strtab);
break;
case DT_STRSZ:
obj->strsize = dynp->d_un.d_val;
+printf(" STRSZ: strsize=%ld\n", obj->strsize);
break;
case DT_HASH:
@@ -150,6 +153,30 @@
Needed_Entry *nep = NEW(Needed_Entry);
nep->name = dynp->d_un.d_val;
+printf(" NEEDED: name=%ld\n", nep->name);
+//#define OK
+if (!strcmp(execname, "/bin/sh"))
+printf(
+#ifdef OK
+ " 0x%lx: (%02x %02x %02x) %02x %02x %02x %02x %02x %02x %02x %02x\n",
+#else
+ " 0x%lx: (%02x %02x) %02x %02x %02x %02x %02x %02x %02x %02x\n",
+#endif
+ 0x402e60 + nep->name,
+#ifdef OK
+ *(uint8_t *)(0x402e60 + nep->name - 3),
+#endif
+ *(uint8_t *)(0x402e60 + nep->name - 2),
+ *(uint8_t *)(0x402e60 + nep->name - 1),
+ *(uint8_t *)(0x402e60 + nep->name + 0),
+ *(uint8_t *)(0x402e60 + nep->name + 1),
+ *(uint8_t *)(0x402e60 + nep->name + 2),
+ *(uint8_t *)(0x402e60 + nep->name + 3),
+ *(uint8_t *)(0x402e60 + nep->name + 4),
+ *(uint8_t *)(0x402e60 + nep->name + 5),
+ *(uint8_t *)(0x402e60 + nep->name + 6),
+ *(uint8_t *)(0x402e60 + nep->name + 7)
+ );
nep->obj = NULL;
nep->next = NULL;
Index: load.c
===================================================================
RCS file: /cvsroot/src/libexec/ld.elf_so/load.c,v
retrieving revision 1.36
diff -u -r1.36 load.c
--- load.c 19 May 2009 20:44:52 -0000 1.36
+++ load.c 25 Jan 2010 15:23:56 -0000
@@ -286,6 +286,7 @@
for (needed = obj->needed; needed != NULL;
needed = needed->next) {
const char *name = obj->strtab + needed->name;
+printf("%s: call _rtld_load_by_name(\"%s\"), strtab=%p, name=%ld\n", __func__,
name, obj->strtab, needed->name);
if (!_rtld_load_by_name(name, obj, &needed, mode))
status = -1; /* FIXME - cleanup */
#ifdef RTLD_LOADER
YAMON> boot
About to load tftp://192.168.1.1/evbmips/netbsd
Press Ctrl-C to breakLoading 80100000-8042f2cf
Clearing 8042f2d0-80135cdf
YAMON> go 80100000
MIPS32/64 params: cpu arch: 32
MIPS32/64 params: TLB entries: 32
MIPS32/64 params: Icache: line = 32, total = 16384, ways = 4
sets = 128
MIPS32/64 params: Dcache: line = 32, total = 16384, ways = 4
sets = 128
picache_stride = 4096
picache_loopcount = 4
pdcache_stride = 4096
pdcache_loopcount = 4
Dcache is coherent
Icache is coherent against Dcache
Memory size: 0x08000000
Loaded initial symtab at 0x803d0b20, strtab at 0x803f7e60, # entries 9933
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010
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 5.99.24 (DEVIL) #0: Fri Jan 22 06:24:04 JST 2010
lance%magician.fool@localhost:/usr/src/sys/arch/evbmips/compile/DEVIL
Plathome Open Micro Server AL400/AMD Alchemy Au1550
total memory = 128 MB
avail memory = 120 MB
mainbus0 (root)
cpu0 at mainbus0: 396.00MHz (hz cycles = 773438, delay divisor = 396)
cpu0: Alchemy Au1550 (Rev 2 core) (0x3030200) Rev. 0 with software emulated floa
ting point
cpu0: 32 TLB entries, 16MB max page size
cpu0: 16KB/32B 4-way set-associative L1 Instruction cache
cpu0: 16KB/32B 4-way set-associative write-back L1 Data cache
obio0 at mainbus0
aubus0 at mainbus0
com0 at aubus0 addr 0x11100000 irq 0: Au1X00 UART, working fifo
com0: console
com1 at aubus0 addr 0x11200000 irq 8: Au1X00 UART, working fifo
com2 at aubus0 addr 0x11400000 irq 9: Au1X00 UART, working fifo
aurtc at aubus0 not configured
aumac0 at aubus0 addr 0x10500000 irq 27: Au1X00 10/100 Ethernet
aumac0: Ethernet address 00:0a:85:02:00:67
lxtphy0 at aumac0 phy 0: LXT971/2 10/100 media interface, rev. 2
lxtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
aumac1 at aubus0 addr 0x10510000 irq 28: Au1X00 10/100 Ethernet
aumac1: Ethernet address 00:0a:85:02:10:67
ohci at aubus0 addr 0x14020000 irq 26 not configured
aupci0 at aubus0 addr 0x14005000: Alchemy Host-PCI Bridge, 66MHz
PCI bus 0: Warning: Total bandwidth exceeded!? (9466046)
pci0 at aupci0 bus 0
ohci0 at pci0 dev 2 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at irq 5
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
ohci1 at pci0 dev 2 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at irq 5
ohci1: OHCI version 1.0
usb1 at ohci1: USB revision 1.0
ehci0 at pci0 dev 2 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at irq 5
ehci0: companion controllers, 3 ports each: ohci0 ohci1
usb2 at ehci0: USB revision 2.0
wm0 at pci0 dev 3 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm0: interrupting at irq 2
wm0: Ethernet address 00:0a:85:02:50:e0
igphy0 at wm0 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX
, auto
wm1 at pci0 dev 4 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm1: interrupting at irq 1
wm1: Ethernet address 00:0a:85:02:51:6a
igphy1 at wm1 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX
, auto
augpio0 at aubus0 addr 0x11900100: Alchemy GPIO, primary block
gpio0 at augpio0: 27 pins
augpio1 at aubus0 addr 0x11700000: Alchemy GPIO, secondary block
gpio1 at augpio1: 16 pins
aupcmcia0 at aubus0: Alchemy PCMCIA, 1 slots
pcmcia0 at aupcmcia0 socket 0 irq 35, CF connector Type2 on Static BUS#3
aupsc0 at aubus0 addr 0x11a00000 irq 10: Alchemy PSC
ausmbus0 at aupsc0: Alchemy PSC SMBus protocol
iic0 at ausmbus0: I2C bus
seeprom0 at iic0 addr 0x50: AT24Cxx EEPROM
lmtemp0 at iic0 addr 0x48: LM77 Temperature Sensor
r2025rtc0 at iic0 addr 0x32: RICOH R2025S/D Real-time Clock
aupsc1 at aubus0 addr 0x11b00000 irq 11: Alchemy PSC
aupsc2 at aubus0 addr 0x10a00000 irq 12: Alchemy PSC
aupsc3 at aubus0 addr 0x10b00000 irq 13: Alchemy PSC
wdc0 at pcmcia0 function 0: <TRANSCEND, TS512MCF80>
wdc0: i/o mapped mode
uhub0 at usb0: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1 at usb1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2 at usb2: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0: <TRANSCEND>
wd0: 488 MB, 993 cyl, 16 head, 63 sec, 512 bytes/sect x 1000944 sectors
root on aumac0
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP next-server: 192.168.1.1
nfs_boot: my_domain=fool
nfs_boot: my_addr=192.168.1.15
nfs_boot: my_mask=255.255.255.0
nfs_boot: gateway=192.168.1.21
root on 192.168.1.1:/export/fool/evbmips
root time: 0x4b5dab09
init: copying out path `/sbin/init' 11
pid 1(init): ABI set to O32 (e_flags=0x1007)
_rtld_digest_dynamic: execname=/libexec/ld.elf_so
STRTAB: strtab=0x7dfc23e8
STRSZ: strsize=4687
_rtld_digest_dynamic: execname=/bin/sh
NEEDED: name=4411
0x403f9b: (74 00) 6c 69 62 65 64 69 74 2e
NEEDED: name=4488
0x403fe8: (74 00) 6c 69 62 74 65 72 6d 63
NEEDED: name=4514
0x404002: (00 00) 00 00 00 00 00 00 00 00
STRTAB: strtab=0x402e60
STRSZ: strsize=4573
_rtld_load_needed_objects: call _rtld_load_by_name("libedit.so.3"), strtab=0x402
e60, name=4411
_rtld_digest_dynamic: execname=/usr/lib/libedit.so.3
NEEDED: name=3701
NEEDED: name=3717
STRTAB: strtab=0x7df71d6c
STRSZ: strsize=3789
_rtld_load_needed_objects: call _rtld_load_by_name("libtermcap.so.0"), strtab=0x
402e60, name=4488
_rtld_digest_dynamic: execname=/usr/lib/libtermcap.so.0
NEEDED: name=477
STRTAB: strtab=0x7df50744
STRSZ: strsize=557
_rtld_load_needed_objects: call _rtld_load_by_name(""), strtab=0x402e60, name=45
14
Shared object "" not found
init: _getttyent: /etc/ttys, 11: unknown option `'
CPU
CACHE
ICACHE
DCACHE
BOARD
RAM
RAM_HILO
RAM_TEST
CLEAR
COPYTEXT
COPYTEXT
COPYDATA
COPYDATA
STACK
INFO
CINFO
FIRSTC
IO
EXCEP
RTC
FREQ
FREQCPU
FREQBUS
PCI
(Au1550)
PCI Enabled...
IIC
FLASHXY
SYSENV
ENV
SERIAL
AU1000MAC
NET
INITDONE
YAMON
YAMON ROM Monitor, Revision 02.27GOMS400.
Copyright (c) 1999-2004 MIPS Technologies, Inc. - All Rights Reserved.
Modified by PlatHome Co,LTD. for OMS-AL400/128
For a list of available commands, type 'help'.
Compilation time = Dec 2 2005 14:20:48
MAC address = 00.0a.85.02.00.67
Processor Company ID = 0x03
Processor ID/revision = 0x02 / 0x00
Endianness = Little
CPU = 396 MHz
Flash memory size = 16 MByte
SDRAM size = 128 MByte
First free SDRAM address = 0x800d5e50
YAMON> boot
About to load tftp://192.168.1.1/evbmips/netbsd
Press Ctrl-C to breakLoading 80100000-8042f2cf
Clearing 8042f2d0-80135cdf
YAMON> go 80100000
MIPS32/64 params: cpu arch: 32
MIPS32/64 params: TLB entries: 32
MIPS32/64 params: Icache: line = 32, total = 16384, ways = 4
sets = 128
MIPS32/64 params: Dcache: line = 32, total = 16384, ways = 4
sets = 128
picache_stride = 4096
picache_loopcount = 4
pdcache_stride = 4096
pdcache_loopcount = 4
Dcache is coherent
Icache is coherent against Dcache
Memory size: 0x08000000
Loaded initial symtab at 0x803d0b20, strtab at 0x803f7e60, # entries 9933
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010
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 5.99.24 (DEVIL) #0: Fri Jan 22 06:24:04 JST 2010
lance%magician.fool@localhost:/usr/src/sys/arch/evbmips/compile/DEVIL
Plathome Open Micro Server AL400/AMD Alchemy Au1550
total memory = 128 MB
avail memory = 120 MB
mainbus0 (root)
cpu0 at mainbus0: 396.00MHz (hz cycles = 773438, delay divisor = 396)
cpu0: Alchemy Au1550 (Rev 2 core) (0x3030200) Rev. 0 with software emulated floa
ting point
cpu0: 32 TLB entries, 16MB max page size
cpu0: 16KB/32B 4-way set-associative L1 Instruction cache
cpu0: 16KB/32B 4-way set-associative write-back L1 Data cache
obio0 at mainbus0
aubus0 at mainbus0
com0 at aubus0 addr 0x11100000 irq 0: Au1X00 UART, working fifo
com0: console
com1 at aubus0 addr 0x11200000 irq 8: Au1X00 UART, working fifo
com2 at aubus0 addr 0x11400000 irq 9: Au1X00 UART, working fifo
aurtc at aubus0 not configured
aumac0 at aubus0 addr 0x10500000 irq 27: Au1X00 10/100 Ethernet
aumac0: Ethernet address 00:0a:85:02:00:67
lxtphy0 at aumac0 phy 0: LXT971/2 10/100 media interface, rev. 2
lxtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
aumac1 at aubus0 addr 0x10510000 irq 28: Au1X00 10/100 Ethernet
aumac1: Ethernet address 00:0a:85:02:10:67
ohci at aubus0 addr 0x14020000 irq 26 not configured
aupci0 at aubus0 addr 0x14005000: Alchemy Host-PCI Bridge, 66MHz
PCI bus 0: Warning: Total bandwidth exceeded!? (9466046)
pci0 at aupci0 bus 0
ohci0 at pci0 dev 2 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at irq 5
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
ohci1 at pci0 dev 2 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at irq 5
ohci1: OHCI version 1.0
usb1 at ohci1: USB revision 1.0
ehci0 at pci0 dev 2 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at irq 5
ehci0: companion controllers, 3 ports each: ohci0 ohci1
usb2 at ehci0: USB revision 2.0
wm0 at pci0 dev 3 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm0: interrupting at irq 2
wm0: Ethernet address 00:0a:85:02:50:e0
igphy0 at wm0 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX
, auto
wm1 at pci0 dev 4 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm1: interrupting at irq 1
wm1: Ethernet address 00:0a:85:02:51:6a
igphy1 at wm1 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX
, auto
augpio0 at aubus0 addr 0x11900100: Alchemy GPIO, primary block
gpio0 at augpio0: 27 pins
augpio1 at aubus0 addr 0x11700000: Alchemy GPIO, secondary block
gpio1 at augpio1: 16 pins
aupcmcia0 at aubus0: Alchemy PCMCIA, 1 slots
pcmcia0 at aupcmcia0 socket 0 irq 35, CF connector Type2 on Static BUS#3
aupsc0 at aubus0 addr 0x11a00000 irq 10: Alchemy PSC
ausmbus0 at aupsc0: Alchemy PSC SMBus protocol
iic0 at ausmbus0: I2C bus
seeprom0 at iic0 addr 0x50: AT24Cxx EEPROM
lmtemp0 at iic0 addr 0x48: LM77 Temperature Sensor
r2025rtc0 at iic0 addr 0x32: RICOH R2025S/D Real-time Clock
aupsc1 at aubus0 addr 0x11b00000 irq 11: Alchemy PSC
aupsc2 at aubus0 addr 0x10a00000 irq 12: Alchemy PSC
aupsc3 at aubus0 addr 0x10b00000 irq 13: Alchemy PSC
wdc0 at pcmcia0 function 0: <TRANSCEND, TS512MCF80>
wdc0: i/o mapped mode
uhub0 at usb0: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1 at usb1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2 at usb2: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0: <TRANSCEND>
wd0: 488 MB, 993 cyl, 16 head, 63 sec, 512 bytes/sect x 1000944 sectors
root on aumac0
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP next-server: 192.168.1.1
nfs_boot: my_domain=fool
nfs_boot: my_addr=192.168.1.15
nfs_boot: my_mask=255.255.255.0
nfs_boot: gateway=192.168.1.21
root on 192.168.1.1:/export/fool/evbmips
root time: 0x4b5db305
init: copying out path `/sbin/init' 11
pid 1(init): ABI set to O32 (e_flags=0x1007)
_rtld_digest_dynamic: execname=/libexec/ld.elf_so
STRTAB: strtab=0x7dfc23e8
STRSZ: strsize=4687
_rtld_digest_dynamic: execname=/bin/sh
NEEDED: name=4411
0x403f9b: (65 74 00) 6c 69 62 65 64 69 74 2e
NEEDED: name=4488
0x403fe8: (78 74 00) 6c 69 62 74 65 72 6d 63
NEEDED: name=4514
0x404002: (61 62 00) 6c 69 62 63 2e 73 6f 2e
STRTAB: strtab=0x402e60
STRSZ: strsize=4573
_rtld_load_needed_objects: call _rtld_load_by_name("libedit.so.3"), strtab=0x402
e60, name=4411
_rtld_digest_dynamic: execname=/lib/libedit.so.3
NEEDED: name=3701
NEEDED: name=3717
STRTAB: strtab=0x7df71d6c
STRSZ: strsize=3789
_rtld_load_needed_objects: call _rtld_load_by_name("libtermcap.so.0"), strtab=0x
402e60, name=4488
_rtld_digest_dynamic: execname=/lib/libtermcap.so.0
NEEDED: name=477
STRTAB: strtab=0x7df50744
STRSZ: strsize=557
_rtld_load_needed_objects: call _rtld_load_by_name(""), strtab=0x402e60, name=45
14
Shared object "" not found
Home |
Main Index |
Thread Index |
Old Index