Open Jeremygu opened 5 years ago
On Wed, Oct 17, 2018 at 10:01 PM Haifeng Gu notifications@github.com wrote:
Hi,
After building the linux-4.18.2 with patching riscv-linux-4.18, BusyBox1.26.2 and initramfs (all steps following to this README https://github.com/riscv/riscv-tools/tree/priv-1.10#linuxman), I run the command spike bbl vmlinux to boot the linux but get stuck:
That README you cited if 4 years old and hopelessly out of date. You should not assume that anything in there is correct. Because most of the info in there is wrong.
Which exact linux are you using? If you are using upstream linux from kernel.org, I think 4.19 is the first one that is bootable. The older ones are missing critical drivers. While 4.19 works, I think it only works on qemu, not on the unleashed hardware, because drivers for the hardware are still missing. You may want to use riscv/riscv-linux instead until everything we need is upstream.
There are many easier ways to get linux nowadays. You can download debian, fedora, opensuse, openembedded, etc. There is also on github sifive/freedom-u-sdk which can build a linux kernel with buildroot and boot it.
jeremy@j-XPS-8700:~/workspace/riscv/linux-4.18.2$ spike bbl vmlinux
Why are you using spike? Spike is the golden reference, but doesn't support any peripherals. You should use qemu instead if you want to do any useful work.
Console: colour dummy device 80x25 console [tty0] enabled bootconsole [early0] disabled
Could you please give any advice? Appreciate it very much.
When using spike, this usually indicates that you are using the wrong serial driver. The new driver is better than the old driver, but does not work on spike. To get the old driver, you have to enable CONFIG_HVC_RISCV_SBI.
Jim
Hi Jim,
Thanks for your response. I use the linux-4.18.2 downloaded from kernel.org since riscv-linux has the 4.18 version.
I am new to this, and may not need many peripherals now for getting start. Therefore, I followed the instructions tring to boot a small linux by using spike.
As you mentioned CONFIG_HVC_RISCV_SBI, I checked that it had been set y
in the linux-4.18.2/.config
file. Then I rebuilt vmlinux
, but got the same problem..
BTW, I fully agree with you that there're many linux that we can get to use. Just now I tried the freedom-u-sdk by simply unset RISCV
and make sim
. Very easy to boot it up.
But I really want to figure out what the problem is there.
We are still in the process of upstreaming RISC-V linux kernel support. I believe 4.19 is the first one from kernel.org that will work, but only on qemu and not on unleashed hardware yet (don't know about spike). riscv-linux is kernel.org plus all of the missing patches that haven't been accepted upstream yet. So 4.18 from riscv-linux may work even if 4.18 from kernel.org does not. If you want more info about RISC-V linux, you should probably ask on the linux-riscv mailing list instead of here.
Hi,
After building the linux-4.18.2 with patching riscv-linux-4.18, BusyBox1.26.2 and initramfs (all steps following to this README), I run the command
spike bbl vmlinux
to boot the linux but get stuck:Could you please give any advice? Appreciate it very much.