This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00

Other Parts Discussed in Thread: TPS65217

使用buildroot-2016.02编译uboot,kernel和制作根文件系统,生成文件:MLO, rootfs.ext2.gz, u-boot.img, zImage

启动参数如下:

loadaddr=0x82000000

fdtaddr=0x88000000
rdaddr=0x88080000
set serverip 192.168.36.180
set ipaddr 192.168.36.157
set fdtfile am335x-boneblack.dtb
set ramroot /dev/ram0 rw ramdisk_size=32768 initrd=${rdaddr},32M
set ramrootfstype ext4

set loadkernel tftp ${loadaddr} zImage
set loaddtb tftp ${fdtaddr} ${fdtfile}
set loadrootfs tftp ${rdaddr} rootfs.ext2.gz
run ramargs;run loadkernel;run loaddtb;run loadrootfs;bootz ${loadaddr} - ${fdtaddr}

启动日志如下:

U-Boot SPL 2014.04-00014-g47880f5 (Apr 22 2014 - 13:23:54)
reading args
spl_load_image_fat_os: error reading image args, err - -1
reading u-boot.img
reading u-boot.img


U-Boot 2014.04-00014-g47880f5 (Apr 22 2014 - 13:23:54)

I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment

Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
U-Boot# loadaddr=0x82000000
U-Boot# fdtaddr=0x88000000
U-Boot# rdaddr=0x88080000
U-Boot# set serverip 192.168.36.180
U-Boot# set ipaddr 192.168.36.157
U-Boot# set fdtfile am335x-boneblack.dtb
U-Boot# set ramroot /dev/ram0 rw ramdisk_size=32768 initrd=${rdaddr},32M
U-Boot# set ramrootfstype ext4
U-Boot#
U-Boot# set loadkernel tftp ${loadaddr} zImage
U-Boot# set loaddtb tftp ${fdtaddr} ${fdtfile}
U-Boot# set loadrootfs tftp ${rdaddr} rootfs.ext2.gz
U-Boot# run ramargs;run loadkernel;run loaddtb;run loadrootfs;bootz ${loadaddr} - ${fdtaddr}
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.36.180; our IP address is 192.168.36.157
Filename 'zImage'.
Load address: 0x82000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
####
344.7 KiB/s
done
Bytes transferred = 3875360 (3b2220 hex)
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.36.180; our IP address is 192.168.36.157
Filename 'am335x-boneblack.dtb'.
Load address: 0x88000000
Loading: ###
169.9 KiB/s
done
Bytes transferred = 34196 (8594 hex)
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.36.180; our IP address is 192.168.36.157
Filename 'rootfs.ext2.gz'.
Load address: 0x88080000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#####################
430.7 KiB/s
done
Bytes transferred = 6974772 (6a6d34 hex)
Kernel image @ 0x82000000 [ 0x000000 - 0x3b2220 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Using Device Tree in place at 88000000, end 8800b593

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.1.18-gbbe8cfc (yong@ubuntu) (gcc version 4.9.3 20150413 (prerelease) (Linaro GCC 4.9-2015.05) ) #2 PREEMPT Fri May 27 16:14:09 CST 2016
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: TI AM335x BeagleBone Black
[ 0.000000] cma: Reserved 24 MiB at 0x9e800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon )
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129920
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/ram0 rw ramdisk_size=32768 initrd=0x88080000,32M rootfstype=ext4
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 453592K/524288K available (5495K kernel code, 241K rwdata, 1876K rodata, 248K init, 196K bss, 46120K reserved, 24576K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc073b02c (7373 kB)
[ 0.000000] .init : 0xc073c000 - 0xc077a000 ( 248 kB)
[ 0.000000] .data : 0xc077a000 - 0xc07b6720 ( 242 kB)
[ 0.000000] .bss : 0xc07b9000 - 0xc07ea2e0 ( 197 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[ 0.000015] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000035] clocksource timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000044] OMAP clocksource: timer1 at 24000000 Hz
[ 0.000206] Console: colour dummy device 80x30
[ 0.000228] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[ 0.000234] This ensures that you still see kernel messages. Please
[ 0.000239] update your kernel commandline.
[ 0.000257] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[ 0.089315] pid_max: default: 32768 minimum: 301
[ 0.089409] Security Framework initialized
[ 0.089454] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.089464] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090058] Initializing cgroup subsys blkio
[ 0.090082] Initializing cgroup subsys memory
[ 0.090121] Initializing cgroup subsys devices
[ 0.090136] Initializing cgroup subsys freezer
[ 0.090149] Initializing cgroup subsys perf_event
[ 0.090173] CPU: Testing write buffer coherency: ok
[ 0.090532] Setting up static identity map for 0x80008200 - 0x80008270
[ 0.091890] devtmpfs: initialized
[ 0.100303] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.111953] omap_hwmod: debugss: _wait_target_disable failed
[ 0.166345] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.168321] pinctrl core: initialized pinctrl subsystem
[ 0.169550] NET: Registered protocol family 16
[ 0.171530] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.199305] cpuidle: using governor ladder
[ 0.229295] cpuidle: using governor menu
[ 0.233019] OMAP GPIO hardware version 0.1
[ 0.241358] No ATAGs?
[ 0.241388] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.277358] edma 49000000.edma: TI EDMA DMA engine driver
[ 0.280330] vgaarb: loaded
[ 0.280844] SCSI subsystem initialized
[ 0.281287] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[ 0.281428] pps_core: LinuxPPS API ver. 1 registered
[ 0.281435] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.281470] PTP clock support registered
[ 0.282189] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[ 0.283015] Switched to clocksource timer1
[ 0.291993] NET: Registered protocol family 2
[ 0.292724] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.292769] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.292807] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.292872] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.292888] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.293101] NET: Registered protocol family 1
[ 0.293466] RPC: Registered named UNIX socket transport module.
[ 0.293479] RPC: Registered udp transport module.
[ 0.293485] RPC: Registered tcp transport module.
[ 0.293491] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.293993] Trying to unpack rootfs image as initramfs...
[ 0.294976] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.473875] Freeing initrd memory: 32768K (c8080000 - ca080000)
[ 0.474261] CPU PMU: Failed to parse /pmu/interrupt-affinity[0]
[ 0.474308] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[ 0.476169] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.482507] VFS: Disk quotas dquot_6.6.0
[ 0.482699] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.484288] NFS: Registering the id_resolver key type
[ 0.484360] Key type id_resolver registered
[ 0.484367] Key type id_legacy registered
[ 0.485472] NET: Registered protocol family 38
[ 0.485535] io scheduler noop registered
[ 0.485547] io scheduler deadline registered
[ 0.485591] io scheduler cfq registered (default)
[ 0.486495] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 0.487989] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 0.488944] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
[ 0.492058] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
[ 1.101522] console [ttyS0] enabled
[ 1.105934] [drm] Initialized drm 1.1.0 20060810
[ 1.110887] slave hdmi: could not get i2c
[ 1.124090] brd: module loaded
[ 1.131389] loop: module loaded
[ 1.135497] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.203067] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 1.209204] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[ 1.216304] libphy: 4a101000.mdio: probed
[ 1.220346] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[ 1.230207] cpsw 4a100000.ethernet: Detected MACID = 78:a5:04:c1:a4:54
[ 1.237980] i2c /dev entries driver
[ 1.242534] omap_hsmmc 48060000.mmc: Got CD GPIO
[ 1.323308] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.329814] remoteproc0: wkup_m3 is available
[ 1.334372] remoteproc0: Note: remoteproc is still under development and considered experimental.
[ 1.343442] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[ 1.355045] remoteproc0: Direct firmware load for am335x-pm-firmware.elf failed with error -2
[ 1.366537] oprofile: using arm/armv7
[ 1.370523] Initializing XFRM netlink socket
[ 1.374931] remoteproc0: Falling back to user helper
[ 1.380098] NET: Registered protocol family 17
[ 1.385071] NET: Registered protocol family 15
[ 1.389702] Key type dns_resolver registered
[ 1.394266] omap_voltage_late_init: Voltage driver support not added
[ 1.400999] cpu cpu0: of_pm_voltdm_notifier_register: Failed to get cpu0 regulator/voltdm: -517
[ 1.409852] cpu cpu0: cpu0 clock notifier not ready, retry
[ 1.416758] ThumbEE CPU extension supported.
[ 1.423110] Registering SWP/SWPB emulation handler
[ 1.450040] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[ 1.455496] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[ 1.461143] mmc1: MAN_BKOPS_EN bit is not set
[ 1.471451] mmc1: new high speed MMC card at address 0001
[ 1.477428] mmcblk0: mmc1:0001 MMC04G 3.60 GiB
[ 1.482112] mmcblk0boot0: mmc1:0001 MMC04G partition 1 2.00 MiB
[ 1.488238] mmcblk0boot1: mmc1:0001 MMC04G partition 2 2.00 MiB
[ 1.495297] mmcblk0: p1 p2
[ 1.585252] tda998x 0-0070: found TDA19988
[ 1.590292] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.597022] [drm] No driver support for vblank timestamp query.
[ 1.603337] tilcdc 4830e000.lcdc: No connectors reported connected with modes
[ 1.610519] [drm] Cannot find any crtc or sizes - going 1024x768
[ 1.624956] Console: switching to colour frame buffer device 128x48
[ 1.636510] tilcdc 4830e000.lcdc: fb0: frame buffer device
[ 1.642107] tilcdc 4830e000.lcdc: registered panic notifier
[ 1.673041] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
[ 1.679413] cpu cpu0: of_pm_voltdm_notifier_register: Fail calculating voltage latency[950000<->1325000]:-22
[ 1.689701] cpu cpu0: of_pm_voltdm_notifier_register: Fail calculating voltage latency[950000<->1325000]:-22
[ 1.700168] hctosys: unable to open rtc device (rtc0)
[ 1.709394] RAMDISK: gzip image found at block 0
[ 2.365265] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)
[ 2.373274] VFS: Mounted root (ext4 filesystem) on device 1:0.
[ 2.379647] devtmpfs: mounted
[ 2.382946] Freeing unused kernel memory: 248K (c073c000 - c077a000)
/sbin/init: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
[ 2.413290] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 2.413290]
[ 2.422476] drm_kms_helper: panic occurred, switching back to text console
[ 2.429406] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 2.429406]
[ 79.783020] random: nonblocking pool is initialized

错误可能的原因有几个:

1.给RAMDISK的空间不够,这里根文件系统解压后又24M,刚开始给16M启动日志里可以看出错误,现在给32M已经不存在这个问题

2.Kernel和busybox的API不兼容

yong@ubuntu:~/buildroot-2016.02$ readelf -h ./output/build/busybox-1.24.1/busybox |grep Flags
Flags: 0x5000402, has entry point, Version5 EABI, hard-float ABI
yong@ubuntu:~/buildroot-2016.02$ readelf -h ./output/build/linux-custom/vmlinux |grep Flags
Flags: 0x5000202, has entry point, Version5 EABI, soft-float ABI
yong@ubuntu:~/buildroot-2016.02$ readelf -h ./output/target/lib/libc.so.6 |grep Flags
Flags: 0x5000402, has entry point, Version5 EABI, hard-float ABI

可以看出libc.so.6和busybox都是hard-float,可是Kernel是soft-float,会是这原因吗?怎么编译出hard-float的内核?libc.so.6是sdk中预编译好的。

  • 关于API不兼容的问题,排除了,使用TFTP加载我自己编译生成的zImage和dtb,NFS启动使用sdk中的targetNFS可以加载成功,应该是我使用buildroot生成的根文件系统不对。关于buildroot生成根文件系统有什么要注意的吗?

  • 交叉编译器用的是sdk里面带的吗?

    你用的是哪个版本的sdk?

  • buildroot配置成外部本地交叉编译工具,指向了我的安装目录,Kernel编译能使用。应该是我制作的rootfs有问题。

    SDK版本:ti-processor-sdk-linux-am335x-evm-02.00.02.11-Linux-x86-Install

  • 上图启动时加载的Kernel和dtb都是我用buildroot环境编译出来的,唯一不同的是NFS左边的rootfs是buildroot生成的,右边是sdk自带的,可以发现绿线一下开始不一样,buildroot的rootfs执行init时找不到libc.so.6。我比较过两个rootfs的lib里包含的libc.so.6是相同的。因为buildroot编译时配置了sdk里的库,没有自己编译。