【问题标题】:Glitch Booting Linux with Spike?使用 Spike 启动 Linux 时出现故障?
【发布时间】:2019-07-20 21:54:51
【问题描述】:

我使用 Spike 使用 riscv 工具启动 linux,但 linux 启动顺序似乎在 Bootconsole[early0] disabled 处停止。

我尝试添加内核命令行 root=/dev/vda ro console=ttyS0 但没有奏效。相同的控制台设置适用于 QEMU。还检查了 .config 文件中的 CONFIG_HVC_RISCV_SBI=y 行。它就在那里。还是过不了。

尝试使用 Linux 内核版本 4.19 到 5.2。没运气。我在这里做错了吗?

我遵循的步骤:

使用 Riscv 工具链编译 linux 使用 ../configure --host=riscv64-unknown-elf --with-payload= [vmlinux 的路径] 编译 riscv-pk 使用“Spike bbl”来启动spike image。

如果需要更多信息,请告诉我。

对不起,这里是菜鸟。

附加终端输出

bbl loader
OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
Linux version 4.19.59 (root@AsusFX504) (gcc version 8.2.0 (GCC)) #2 SMP Sat Jul 20 05:11:32 IST 2019
bootconsole [early0] enabled
initrd not found or empty - disabling initrd
Zone ranges:
  DMA32    [mem 0x0000000080200000-0x00000000ffffffff]
  Normal   empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000080200000-0x00000000ffffffff]
Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff]
software IO TLB: mapped [mem 0xfa3fe000-0xfe3fe000] (64MB)
elf_hwcap is 0x112d
percpu: Embedded 17 pages/cpu s29912 r8192 d31528 u69632
Built 1 zonelists, mobility grouping on.  Total pages: 516615
Kernel command line: 
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Sorting __ex_table...
Memory: 1988760K/2095104K available (5468K kernel code, 329K rwdata, 1751K rodata, 193K init, 806K bss, 106344K reserved, 0K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Hierarchical RCU implementation.
rcu:    RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
Console: colour dummy device 80x25
console [tty0] enabled
bootconsole [early0] disabled

【问题讨论】:

  • 要查看其中的内容,您可以在内核命令行中添加keep_bootcon

标签: linux linux-kernel riscv


【解决方案1】:

这可能是因为在您的 linux config 中启用了虚拟终端。禁用虚拟终端可能会解决您的问题。

在 Linux 中 ma​​ke menuconfig 转到:-

地点:

  • -> 设备驱动程序
  • -> 字符设备

并禁用虚拟终端

Symbol: VT [=y]    n                                                                                                                                                                                 
Type  : bool                                                                                                                                                                                          
Prompt: Virtual terminal 

【讨论】:

    【解决方案2】:

    如前所述,原因是启用了 VT,因此内核有一个虚拟 VT 帧缓冲区,它根本无处可去,但您不必禁用它。 console=ttyS0 也不起作用,因为 SPIKE 不模拟它。请注意,这也不适用于 HiFive Unleashed,因为串行终端有 ttySIF0 和 ttySIF1。你想要的是console=hvc0 并且 SPIKE 将能够从那里继续,例如在您的内核 .config 中:

    CONFIG_CMDLINE_BOOL=y
    CONFIG_CMDLINE="earlyprintk console=hvc0"
    CONFIG_CMDLINE_FORCE=y
    

    【讨论】:

      猜你喜欢
      • 2014-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多