Sunday, July 12, 2009, 10:18 PM -
Posted by Administrator
Me,mario-goulart(he tried a lot of things that didn’t work…that was really helpful),and otavio(giving good advises) have been working together to fix a problem:
At first when you booted you had init that was killed or something like this,after running strace I found that it was because it had a segmentation fault,every other binaries that used dynamic libraries had the same problem…I started investigating…at a point someone named mario-goulart shown in irc having the exact same problem…I found out that he wanted to do the exact same work than me but with a different router,so we searched the root of the problem together with the help of otavio.
with the help of gdb compiled statically I found the problematic functions.
Then pb_ told me that “if it’s crashing there, it sounds like gcc is failing to inline those functions for some reason.”
And that hint was true…those functions weren’t inlined…
Then looking on the web I found a post about the -Os optimization failing to inline things on the gcc version I used.
Then I removed the -Os switch in the uclibc configuration and it worked…
But then I had a bug that mario worked around(using boot scripts instead of init): init didn’t load the correct runlevel(the runlevel after S wasn’t ran)…so with the help of the openmoko,after some trying I spotted the difference and changed the /etc/init.d/rcS file overwriting it with that content:
exec /etc/init.d/rc S
and it worked…
so here’s the boot log(still using NFS):
CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: Thu Sep 22 15:03:49 CST 2005 (root@localhost.localdomain)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.
Initializing Arena
Initializing Devices.
No DPN
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 3.90.37.0
CPU type 0×29008: 200MHz
Total memory: 16384 KBytes
Total memory used by CFE: 0×80300000 – 0x803A3620 (669216)
Initialized Data: 0×80339530 – 0x8033BC40 (10000)
BSS Area: 0x8033BC40 – 0x8033D620 (6624)
Local Heap: 0x8033D620 – 0x803A1620 (409600)
Stack Area: 0x803A1620 – 0x803A3620 (8192)
Text (code) segment: 0×80300000 – 0×80339530 (234800)
Boot area (physical): 0x003A4000 – 0x003E4000
Relocation Factor: I:00000000 – D:00000000
Boot version: v3.6
The boot is CFE
mac_init(): Find mac [00:14:BF:E1:DA:DD] in location 1
Nothing…
eou_key_init(): Find key pair in location 0
The eou device id is same
The eou public key is same
The eou private key is same
Device eth0: hwaddr 00-14-BF-E1-DA-DD, ipaddr 192.168.1.1, mask 255.255.255.0
gateway not set, nameserver not set
Automatic startup canceled via Ctrl-C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ^C
CFE> ifconfig eth0 -auto
Device eth0: hwaddr 00-14-BF-E1-DA-DD, ipaddr 168.0.0.139, mask 255.255.255.0
gateway 168.0.0.2, nameserver 168.0.0.2, domain workgroup
*** command status = 0
CFE> boot -elf -tftp 168.0.0.2:init.sysvinit
Loader:elf Filesys:tftp Dev:eth0 File:168.0.0.2:init.sysvinit Options:(null)
Loading: 0×80001000/2863616 0x802bc200/144608 Entry at 0×80005490
Closing network.
Starting program at 0×80005490
Linux version 2.6.30 (embedded@port4) (gcc version 4.2.4) #1 Fri Jul 3 07:36:40 CEST 2009
CPU revision is: 00029008 (Broadcom BCM3302)
ssb: Core 0 found: ChipCommon (cc 0×800, rev 0x0E, vendor 0×4243)
ssb: Core 1 found: Fast Ethernet (cc 0×806, rev 0×09, vendor 0×4243)
ssb: Core 2 found: MIPS 3302 (cc 0×816, rev 0×06, vendor 0×4243)
ssb: Core 3 found: USB 1.1 Host (cc 0×817, rev 0×02, vendor 0×4243)
ssb: Core 4 found: MEMC SDRAM (cc 0x80F, rev 0×01, vendor 0×4243)
ssb: Core 5 found: IEEE 802.11 (cc 0×812, rev 0×09, vendor 0×4243)
ssb: Core 6 found: Roboswitch (cc 0x81C, rev 0×02, vendor 0×4243)
ssb: Initializing MIPS core…
ssb: core 0×0800, irq : 2(S) 3* 4 5 6 D I
ssb: core 0×0806, irq : 2(S) 3 4* 5 6 D I
ssb: core 0×0816, irq : 2(S) 3 4 5* 6 D I
ssb: core 0×0817, irq : 2(S) 3 4 5 6* D I
ssb: core 0x080f, irq : 2(S) 3 4 5 6 D I*
ssb: core 0×0812, irq : 2(S)* 3 4 5 6 D I
ssb: core 0x081c, irq : 2(S) 3 4 5 6 D I*
ssb: set_irq: core 0×0806, irq 4 => 4
ssb: set_irq: core 0×0816, irq 5 => 2
ssb: set_irq: core 0×0812, irq 2 => 5
ssb: after irq reconfiguration
ssb: core 0×0800, irq : 2(S) 3* 4 5 6 D I
ssb: core 0×0806, irq : 2(S) 3 4* 5 6 D I
ssb: core 0×0816, irq : 2(S)* 3 4 5 6 D I
ssb: core 0×0817, irq : 2(S) 3 4 5 6* D I
ssb: core 0x080f, irq : 2(S) 3 4 5 6 D I*
ssb: core 0×0812, irq : 2(S) 3 4 5* 6 D I
ssb: core 0x081c, irq : 2(S) 3 4 5 6 D I*
ssb: Sonics Silicon Backplane found at address 0×18000000
Serial init done.
Determined physical RAM map:
memory: 01000000 @ 00000000 (usable)
Initrd not found or empty – disabling initrd
Zone PFN ranges:
Normal 0×00000000 -> 0×00001000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0×00000000 -> 0×00001000
On node 0 totalpages: 4096
free_area_init_node: node 0, pgdat 802993d0, node_mem_map 802e1000
Normal zone: 32 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 4064 pages, LIFO batch:0
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064
Kernel command line: root=/dev/nfs rw ip=dhcp nfsroot=168.0.0.2:/embedded/NFS console=ttyS0,115200 init=/sbin/init.sysvinit debug
Primary instruction cache 16kB, VIPT, 2-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, VIPT, no aliases, linesize 16 bytes
NR_IRQS:128
PID hash table entries: 64 (order: 6, 256 bytes)
console [ttyS0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 13292k/16384k available (2242k kernel code, 3092k reserved, 418k data, 136k init, 0k highmem)
Calibrating delay loop… 199.16 BogoMIPS (lpj=398336)
Mount-cache hash table entries: 512
net_namespace: 528 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switched to high resolution mode on CPU 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
Registering mini_fo version $Id$
msgmni has been set to 25
alg: No test for lzma (lzma-generic)
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
serial8250: ttyS0 at MMIO 0xb8000300 (irq = 3) is a 16550A
serial8250: ttyS1 at MMIO 0xb8000400 (irq = 3) is a 16550A
serial8250.0: ttyS0 at MMIO 0xb8000300 (irq = 3) is a 16550A
serial8250.0: ttyS1 at MMIO 0xb8000400 (irq = 3) is a 16550A
b44.c:v2.0
eth0: Broadcom 44xx/47xx 10/100BaseT Ethernet 00:14:bf:e1:da:dd
BCM47xx Watchdog Timer enabled (30 seconds, nowayout)
TCP westwood registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 168.0.0.2, my address is 168.0.0.139
IP-Config: Complete:
device=eth0, addr=168.0.0.139, mask=255.255.255.0, gw=168.0.0.2,
host=168.0.0.139, domain=workgroup, nis-domain=(none),
bootserver=168.0.0.2, rootserver=168.0.0.2, rootpath=
Looking up port of RPC 100003/2 on 168.0.0.2
Looking up port of RPC 100005/1 on 168.0.0.2
VFS: Mounted root (nfs filesystem) on device 0:11.
Freeing unused kernel memory: 136k freed
INIT: version 2.86 booting
Algorithmics/MIPS FPU Emulator v1.5
mdev requires a mounted procfs, not started.
Setting up IP spoofing protection: FAILED.
Configuring network interfaces… ifup: interface lo already configured
ifup: interface vlan0 already configured
ifup: interface vlan1 already configured
INIT: Entering runlevel: 5
/etc/rc5.d/S10dropbear: line 29: can’t open /proc/mounts: no such file
Starting Dropbear SSH server: dropbear.
Starting syslogd/klogd: done
168.0.0.139 login: root
~ #