2015-10-06 98 views
1

在FPGA ZC706上启动linux-3.14.4时出现以下错误。我有建立以下几个方面的所有工具:在ZC706上引导linux-3.14.41:内核恐慌

火箭芯片:

$ Latest master branch is checked out and generate boot.bin 

riscv-gnu-toolchain: 
$ ./build.sh (riscv64-unknown-elf) 
$ make linux (for riscv64-unknown-linux-gnu-gcc) 

Linux kernel: 
$curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.41.tar.xz | tar -xJkf - 
$ cd linux-3.14.41 
$ git init 
$ git remote add origin https://github.com/riscv/riscv-linux.git 
$ git fetch 
$ git checkout -f -t origin/master 
$ make ARCH=riscv defconfig 
$ make -j12 ARCH=riscv vmlinux 

根光盘映像:

$ dd if=/dev/zero of=root.bin bs=1M count=64 
$ mkfs.ext2 -F root.bin 

引导:

1. First copy all files (vmlinux, root.bin, boot.bin, devicetree.dtb, uImage, uramdisk.image.gz) into sdcard. 
(2) $ mkdir /sdcard 
$ mount /dev/mmcblk0p1 /sdcard 
$ ./fesvr-zynq +disk=/sdcard/riscv/root.bin bbl /sdcard/riscv/vmlinux 

引导启动,但停留在一个点。以下是引导错误

[ 0.000000] Zone ranges: 
    [ 0.000000] Normal [mem 0x00200000-0x0fffffff] 
    [ 0.000000] Movable zone start for each node 
    [ 0.000000] Early memory node ranges 
    [ 0.000000] node 0: [mem 0x00200000-0x0fffffff] 
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64135 
    [ 0.000000] Kernel command line: root=/dev/htifblk0 
    [ 0.000000] PID hash table entries: 1024 (order: 1, 8192 bytes) 
    [ 0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes) 
    [ 0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes) 
    [ 0.000000] Sorting __ex_table... 
    [ 0.000000] Memory: 253568K/260096K available (1725K kernel code, 120K rwdata, 356K rodata, 68K init, 211K bss, 6528K reserved) 
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 
    [ 0.000000] NR_IRQS:2 
    [ 0.150000] Calibrating delay using timer specific routine.. 20.01 BogoMIPS (lpj=100074) 
    [ 0.150000] pid_max: default: 32768 minimum: 301 
    [ 0.150000] Mount-cache hash table entries: 512 (order: 0, 4096 bytes) 
    [ 0.150000] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes) 
    [ 0.150000] devtmpfs: initialized 
    [ 0.150000] NET: Registered protocol family 16 
    [ 0.150000] bio: create slab <bio-0> at 0 
    [ 0.150000] Switched to clocksource riscv_clocksource 
    [ 0.150000] NET: Registered protocol family 2 
    [ 0.150000] TCP established hash table entries: 2048 (order: 2, 16384 bytes) 
    [ 0.150000] TCP bind hash table entries: 2048 (order: 2, 16384 bytes) 
    [ 0.150000] TCP: Hash tables configured (established 2048 bind 2048) 
    [ 0.150000] TCP: reno registered 
    [ 0.150000] UDP hash table entries: 256 (order: 1, 8192 bytes) 
    [ 0.150000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) 
    [ 0.150000] NET: Registered protocol family 1 
    [ 0.150000] futex hash table entries: 256 (order: 0, 6144 bytes) 
    [ 0.150000] io scheduler noop registered 
    [ 0.150000] io scheduler cfq registered (default) 
    [ 0.170000] htifcon htif1: detected console 
    [ 0.180000] console [htifcon0] enabled 
    [ 0.180000] htifblk htif2: detected disk 
    [ 0.180000] htifblk htif2: added htifblk0 
    [ 0.180000] TCP: cubic registered 
    [ 0.180000] VFS: Mounted root (ext2 filesystem) readonly on device 254:0. 
    [ 0.180000] devtmpfs: error mounting -2 
    [ 0.180000] Freeing unused kernel memory: 68K (ffffffff80000000 - ffffffff80011000) 
    [ 0.180000] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance. 
    [ 0.180000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.41-g2317c43-dirty #2 
    [ 0.180000] Call Trace: 
    [ 0.180000] [<ffffffff80012f54>] walk_stackframe+0x0/0xc8 
    [ 0.180000] [<ffffffff801bbff4>] panic+0xb4/0x1c4 
    [ 0.180000] [<ffffffff80012a24>] sys_rt_sigreturn+0x140/0x178 
    [ 0.180000] [<ffffffff801bba08>] rest_init+0x80/0x84 
    [ 0.180000] [<ffffffff801bbafc>] kernel_init+0xf0/0xf4 
    [ 0.180000] [<ffffffff801bba08>] rest_init+0x80/0x84 

谁能帮我,我是否错过了什么。我也试过用 linux-3.14.33;同样的错误来了

+2

'没有工作init发现'似乎足够清晰... –

+0

谢谢马克,为您的轮班回复。你可以请建议一个解决办法来解决这个问题吗?我错过了任何步骤? – Monjur

+0

您可能已将内核复制到启动设备,但内核本身在没有其他OS的情况下基本上是无用的。一旦kern开始,它就会启动'init',然后开始启动所有其他的事情。并根据错误消息,你没有'init',或没有指出内核应该在哪里寻找init。 –

回答

1
I can now boot kernel on SPIKE ISA as well as FPGA. I omit some steps while building root.bin mentioned at https://github.com/riscv/riscv-tools. 

$ dd if=/dev/zero of=root.bin bs=1M count=64 
$ mkfs.ext2 -F root.bin 

will generate empty root.bin. We need to mount disc image and complete the file systems after completing busy box building as mentioned at https://github.com/riscv/riscv-tools