[ELDK] Problems in kernel init while using busybox on ELDK 4.2

Wolfgang Denk wd at denx.de
Mon Jun 1 23:54:51 CEST 2009


Dear Diptopal Basu,

In message <bd97640b0905300619w377c8eacs43cfc16cc2cb65e1 at mail.gmail.com> you wrote:
>
> 1. A simple root-fs like that does not work with ELDK 4.2
> init is just an infinite loop :
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> int main (int ac, char **av)
> {
>        while (1) {
>                printf ("coucou coucou coucou\n");
>                sleep (1);
>        }
>        return (0);
> }
> CPIO file is attached.

OK.

> Works fine if init program is compiled with 4.1:
> 
> input: AT Raw Set 2 keyboard as /class/input/input0
> input: ImExPS/2 Generic Explorer Mouse as /class/input/input1
> coucou coucou coucou
> coucou coucou coucou
> ..
> Crash if init is compiled with 4.2:
> 
> Freeing init memory: 320K
> Kernel panic - not syncing: *** Attempted to kill init!
> 
> Same result if kernel is compiled with ELDK 4.1 or 4.2.
> May be it's because 4.2 is EABI et 4.1 is not...

I don't think so.

> 2. Also mklibs is an utility script we use to selectively copy only required
> libraries over for our binaries . So that on the embedded system we only

Did you ever suspect that this script might have some issues, for
example when dealing with more recent tool versions?

> have the set of libraries we need . We need to provide in the source
> location of the libraries and the binaries requiring the libraries to mklibs
> . Mklibs in turn populates the /lib folder in the file system archive with
> the libraries .

Well, for testing you should be able to check the operation of this
script, or even to do all this manually by just using ldd (or the
cross version of ldd which comes included with the ELDK).

You are all too willing to blame any problems you run into on ELDK,
but you never seem to doubt yourself or your own local tools. This is
unfair, and also unproductive.


So I tried the very binary you sent me on a real system, and this is
what I see:

=> tftp ${kernel_addr_r} ${bootfile}
Found PHY at address 1 PHYID (0007:c0c4)
dnet0: Starting autonegotiation...
dnet0: Autonegotiation complete
dnet0: link up, 100Mbps full-duplex (lpa: 0x45e1)
Using dnet0 device
TFTP from server 192.168.1.1; our IP address is 192.168.20.12
Filename '/tftpboot/qong/uImage-duts'.
Load address: 0x80800000
Loading: #################################################################
         ################################################
done
Bytes transferred = 1647532 (1923ac hex)
=> tftp 81000000 qong/uRamdisk.test
Found PHY at address 1 PHYID (0007:c0c4)
dnet0: link up, 100Mbps full-duplex (lpa: 0x45e1)
Using dnet0 device
TFTP from server 192.168.1.1; our IP address is 192.168.20.12
Filename 'qong/uRamdisk.test'.
Load address: 0x81000000
Loading: #################
done
Bytes transferred = 242749 (3b43d hex)
=> run ramargs addip addtty addmtd addmisc
=> bootm 80800000 81000000
## Booting kernel from Legacy Image at 80800000 ...
   Image Name:   Linux-2.6.29-rc3
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1647468 Bytes =  1.6 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 81000000 ...
   Image Name:   Test Ramdisk Image
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    242685 Bytes = 237 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux....................................................................................................... done, booting the kernel.
Linux version 2.6.29-rc3 (vitb at pollux.denx.de) (gcc version 4.2.2) #1 Sat May 2 22:51:47 CEST 2009
CPU: ARMv6-compatible processor [4107b364] revision 4 (ARMv6TEJ), cr=00c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Dave/DENX QongEVB-LITE
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: root=/dev/ram rw ramdisk_size=8192 ip=192.168.20.12:192.168.1.1::255.255.0.0:qong:eth0:off panic=1 console=ttymxc0,115200 mtdparts=physmap-flash.0:256k(U-Boot),128k(env1),128k(env2),2560k(kernel),13m(ramdisk),-(user)
MXC GPIO hardware
MXC IRQ initialized
PID hash table entries: 1024 (order: 10, 4096 bytes)
Clock input source is 26000000
Console: colour dummy device 80x30
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB = 256MB total
Memory: 256000KB available (2952K code, 311K data, 124K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 398.13 BogoMIPS (lpj=1990656)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 716 bytes
NET: Registered protocol family 16
Qong FPGA version 0.8.7
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 236K
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered (default)
Serial: IMX driver
imx-uart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a IMX
console [ttymxc0] enabled
brd: module loaded
loop: module loaded
dnet_mii_bus: probed
eth0: Dave DNET at 0xd0860000 (0xa9000000) irq 104 (7e:84:21:96:86:71)
eth0: has mdio, irq, no gigabit, no dma 
eth0: attached PHY driver [SMSC LAN8700] (mii_bus:phy_addr=0:01, irq=-1)
Driver 'sd' needs updating - please use bus_type methods
physmap platform flash device: 08000000 at a0000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.0: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
6 cmdlinepart partitions found on MTD device physmap-flash.0
Creating 6 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000040000 : "U-Boot"
0x000000040000-0x000000060000 : "env1"
0x000000060000-0x000000080000 : "env2"
0x000000080000-0x000000300000 : "kernel"
0x000000300000-0x000001000000 : "ramdisk"
0x000001000000-0x000008000000 : "user"
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 337 at 0x000002a20000
Bad eraseblock 471 at 0x000003ae0000
Bad eraseblock 537 at 0x000004320000
Bad eraseblock 812 at 0x000006580000
Bad eraseblock 969 at 0x000007920000
usbmon: debugfs is not available
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
mxc-ehci mxc-ehci.2: initializing i.MX USB Controller
mxc-ehci mxc-ehci.2: Freescale On-Chip EHCI Host Controller
mxc-ehci mxc-ehci.2: new USB bus registered, assigned bus number 1
mxc-ehci mxc-ehci.2: irq 36, io mem 0x43f88400
mxc-ehci mxc-ehci.2: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 2
IP-Config: Complete:
     device=eth0, addr=192.168.20.12, mask=255.255.0.0, gw=255.255.255.255,
     host=qong, domain=, nis-domain=(none),
     bootserver=192.168.1.1, rootserver=192.168.1.1, rootpath=
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 124K
coucou coucou coucou
eth0: link up (100/Full)
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
coucou coucou coucou
...


Seems to be working perfectly fine here.

Is there any chance that this is not a problem with ELDK at all, but
with your test setup, or test methods?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"My name is Linus Torvalds, you messed with my kernel, prepare to die"
                                                  - Linus Torvalds in
      <Pine.LNX.3.91.960426110644.24860I-100000 at linux.cs.Helsinki.FI>


More information about the eldk mailing list