2017-04-08 75 views
0

我读了manual和的buildroot的创建我必须改变什么才能用Nios2启动Linux 4.9?

$ ls buildroot/output/images/ 
rootfs.cpio rootfs.jffs2 rootfs.tar 

然后我内置的U-Boot的图像中使用:

~/nios2/u-boot-socfpga$ ls -al u-boot 
-rwxrwxr-x 1 developer developer 852924 apr 8 14:00 u-boot 

然后我做make menuconfig和选择路径的buildroot文件

enter image description here

现在我构建vmImage。

OBJCOPY arch/nios2/boot/vmlinux.bin 
    GZIP arch/nios2/boot/vmlinux.gz 
    UIMAGE arch/nios2/boot/vmImage 
Image Name: Linux-4.9.0-00104-g84d4f8a-dirty 
Created:  Sat Apr 8 14:02:22 2017 
Image Type: NIOS II Linux Kernel Image (gzip compressed) 
Data Size: 7237729 Bytes = 7068.09 kB = 6.90 MB 
Load Address: c0000000 
Entry Point: c0000000 
Kernel: arch/nios2/boot/vmImage is ready 

我想知道为什么我现在无法运行任何生成的图像。错误的方法在哪里?这一切都编译但我的文件系统不进来的地方,当我将文件下载到

$ nios2-download -g /home/developer/nios2/linux4/vmlinux 
Using cable "USB-Blaster [2-1]", device 1, instance 0x00 
Pausing target processor: OK 
Initializing CPU cache (if present) 
OK 
Downloaded 8504KB in 43.7s (194.5KB/s) 
Verified OK       
Starting processor at address 0xC0000000 

它停止与内核恐慌:

$ nios2-terminal 
nios2-terminal: connected to hardware target using JTAG UART on cable 
nios2-terminal: "USB-Blaster [2-1]", device 1, instance 0 
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) 

Linux version 4.9.0-00104-g84d4f8a-dirty ([email protected]) (gcc version 6.2.0 (Sourcery CodeBench Lite 2016.11-32)) #49 Sat Apr 8 14:02:21 CEST 2017 
bootconsole [early0] enabled 
early_console initialized at 0xe8001440 
On node 0 totalpages: 32768 
free_area_init_node: node 0, pgdat c084e52c, node_mem_map c0883b80 
    Normal zone: 256 pages used for memmap 
    Normal zone: 0 pages reserved 
    Normal zone: 32768 pages, LIFO batch:7 
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 
pcpu-alloc: [0] 0 
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 
Kernel command line: debug console=ttyAL0,115200 
PID hash table entries: 512 (order: -1, 2048 bytes) 
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) 
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) 
Sorting __ex_table... 
Memory: 121196K/131072K available (2233K kernel code, 66K rwdata, 352K rodata, 5852K init, 197K bss, 9876K reserved, 0K cma-reserved) 
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 
NR_IRQS:64 nr_irqs:64 0 
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������clocksource: nios2-clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 38225208935 ns 
Console: colour dummy device 80x25 
Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=50000) 
pid_max: default: 32768 minimum: 301 
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) 
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) 
cpu cpu0: Error -2 creating of_node link 
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns 
�random: fast init done 
clocksource: Switched to clocksource nios2-clksrc 
random: crng init done 
futex hash table entries: 256 (order: -1, 3072 bytes) 
workingset: timestamp_bits=30 max_order=15 bucket_order=0 
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) 
io scheduler noop registered 
io scheduler deadline registered 
io scheduler cfq registered (default) 
�8001440.serial: ttyJ0 at MMIO 0x8001440 (irq = 2, base_baud = 0) is a Altera JTAG UART 
mousedev: PS/2 mouse device common for all mice 
Warning: unable to open an initial console. 
Failed to create /dev/root: -2 
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -2 
Please append a correct "root=" boot option; here are the available partitions: 
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) 
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) 

我能做些什么呢?

回答

2

您必须将initramfs源文件指向cpio存档,因此/home/developer/nios2/buildroot/output/images/rootfs.cpio

更简单的是让Buildroot构建你的内核并选择initramfs文件系统。然后Buildroot将负责将initramfs链接到内核中。

相关问题