我对嵌入式 Linux 还很陌生,非常希望得到一些帮助。我正在尝试在risc-v FPGA。
我使用 busybox initramfs 构建了 linux 5.0.0,并使用这个引导程序然后我将 .elf 文件加载到 RAM 中,出现以下错误
[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80400000
[ 0.000000] No DTB passed to the kernel
[ 0.000000] Linux version 5.0.0-dirty (lemoncake@lemoncake-950XDA) (gcc version 11.1.0 (g5964b5cd727)) #1 SMP Mon Feb 21 20:42:33 KST 2022
[ 0.000000] initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000080400000-0x0000000081ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080400000-0x0000000081ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080400000-0x0000000081ffffff]
[ 0.000000] On node 0 totalpages: 7168
[ 0.000000] Normal zone: 56 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 7168 pages, LIFO batch:0
[ 0.000000] elf_hwcap is 0x1101
[ 0.000000] percpu: Embedded 12 pages/cpu @(ptrval) s18508 r8192 d22452 u49152
[ 0.000000] pcpu-alloc: s18508 r8192 d22452 u49152 alloc=12*4096
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 7112
[ 0.000000] Kernel command line: selinux=0 root=/dev/ram rw console=hvc0,1000000 earlycon=sbi debug
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 20044K/28672K available (4619K kernel code, 162K rwdata, 808K rodata, 2502K init, 213K bss, 8628K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 38225208935 ns
[ 0.000964] sched_clock: 32 bits at 50MHz, resolution 20ns, wraps every 42949672950ns
[ 0.011671] Console: colour dummy device 80x25
[ 0.144353] printk: console [hvc0] enabled
[ 0.150619] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=200000)
[ 0.158831] pid_max: default: 32768 minimum: 301
[ 0.195096] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.201619] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.477065] rcu: Hierarchical SRCU implementation.
[ 0.578630] smp: Bringing up secondary CPUs ...
[ 0.583664] smp: Brought up 1 node, 1 CPU
[ 0.659321] devtmpfs: initialized
[ 0.799263] random: get_random_u32 called from bucket_table_alloc+0xa0/0x20c with crng_init=0
[ 0.869138] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.877168] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.947256] NET: Registered protocol family 16
[ 2.517448] vgaarb: loaded
[ 2.684003] clocksource: Switched to clocksource riscv_clocksource
[ 4.701897] NET: Registered protocol family 2
[ 4.825810] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[ 4.839968] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 4.850333] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 4.864189] TCP: Hash tables configured (established 1024 bind 1024)
[ 4.881878] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 4.893763] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 4.933738] NET: Registered protocol family 1
[ 4.943948] PCI: CLS 0 bytes, default 64
[ 38.825356] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 43.900897] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[ 43.908191] io scheduler mq-deadline registered
[ 43.913134] io scheduler kyber registered
[ 56.341540] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 58.440165] loop: module loaded
[ 58.840776] NET: Registered protocol family 10
[ 59.071341] Segment Routing with IPv6
[ 59.089525] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 59.267534] NET: Registered protocol family 17
[ 60.241092] Freeing unused kernel memory: 2500K
[ 60.245932] This architecture does not have kernel memory protection.
[ 60.252956] Run /init as init process
FATAL: kernel too old
[ 60.592541] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000005
[ 60.597897] CPU: 0 PID: 1 Comm: init Not tainted 5.0.0-dirty #1
[ 60.601681] Call Trace:
[ 60.604578] [<c0274450>] walk_stackframe+0x0/0x108
[ 60.608340] [<c0274690>] show_stack+0x3c/0x50
[ 60.611969] [<c06d2cb4>] dump_stack+0x84/0xb0
[ 60.615561] [<c027a060>] panic+0x11c/0x28c
[ 60.619019] [<c027c8a4>] do_exit+0x874/0x8e4
[ 60.622594] [<c027d554>] do_group_exit+0x40/0xac
[ 60.626353] [<c0288454>] get_signal+0x110/0x650
[ 60.630117] [<c0273b00>] do_notify_resume+0x94/0x384
[ 60.634054] [<c0272dac>] ret_from_exception+0x0/0x10
[ 60.638820] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000005 ]---
在里面:
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
exec /bin/sh
对不起,我的英语不好。