sycuricon / riscv-spike-sdk

Run Linux on RISC-V Spike Simulator
MIT License
45 stars 18 forks source link

Current main is Broken #33

Closed tobywenman closed 2 months ago

tobywenman commented 3 months ago

Hey, when I clone this repository fresh and run ./quickstart.sh followed by make Linux no longer successfully boots and just hangs after printing the logo. I've tried backdating spike and that made no difference:

[toby.wenman@nb194 riscv-spike-sdk]$ make
mkdir -p /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/rootfs/buildroot_initramfs_sysroot
tar -xpf /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/rootfs/buildroot_initramfs/images/rootfs.tar -C /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/rootfs/buildroot_initramfs_sysroot --exclude ./dev --exclude ./usr/share/locale
make -C /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/repo/linux O=/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/build/linux \
    CONFIG_INITRAMFS_SOURCE="/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/conf/initramfs.txt /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/rootfs/buildroot_initramfs_sysroot" \
    CONFIG_INITRAMFS_ROOT_UID=529202712 \
    CONFIG_INITRAMFS_ROOT_GID=529200513 \
    CROSS_COMPILE=riscv64-unknown-linux-gnu- \
    ARCH=riscv \
    all
make[1]: Entering directory '/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/repo/linux'
make[2]: Entering directory '/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/build/linux'
  GEN     Makefile
  CALL    /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/repo/linux/scripts/checksyscalls.sh
  Kernel: arch/riscv/boot/Image.gz is ready
make[2]: Leaving directory '/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/build/linux'
make[1]: Leaving directory '/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/repo/linux'
/home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/toolchain/bin/spike --isa=rv64imafdc_zifencei_zicsr_zicntr_zihpm /home/codasip.com/toby.wenman/Documents/riscv-spike-sdk/build/riscv-pk/bbl
bbl loader

          RISC-V Spike Simulator SDK

          ___           ___           ___     
         /\  \         /\  \         /\  \    
        /  \  \       /  \  \       /  \  \   
       / /\ \  \     / /\ \  \     / /\ \  \  
      /  \~\ \  \   _\ \~\ \  \   _\ \~\ \  \ 
     / /\ \ \ \__\ /\ \ \ \ \__\ /\ \ \ \ \__\
     \/_|  \/ /  / \ \ \ \ \/__/ \ \ \ \ \/__/
        | |  /  /   \ \ \ \__\    \ \ \ \__\  
        | |\/__/     \ \/ /  /     \ \/ /  /  
        | |  |        \  /  /       \  /  /   
         \|__|         \/__/         \/__/ 

(spike) q 

I'm not really sure how to debug this so any help is greatly appreciated, thanks.

Phantom1003 commented 3 months ago

If the simulation gets stuck after printing the logo, it probably means that the linux kernel boot hangs.

Phantom1003 commented 3 months ago

I can't reproduce the problem, can you list the versions of your subrepositories and your environment?

huayongxu commented 3 months ago

I have the same issue after the logo is print. linux kernel could not be downloaded from the repo https://github.com/sycuricon/riscv-spike-sdk , so I downloaded linux-6.6.2.tar.gz directly from https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/ , then git init/add/commit. but the simulation still gets stuck. thanks

tobywenman commented 3 months ago

It's just all of the default values for the submodules. This is the .gitmodule file:

[toby.wenman@nb194 riscv-spike-sdk]$ cat .gitmodules 
[submodule "riscv-gnu-toolchain"]
    path = repo/riscv-gnu-toolchain
    url = https://github.com/riscv/riscv-gnu-toolchain.git
[submodule "buildroot"]
    path = repo/buildroot
    url = https://github.com/buildroot/buildroot.git
[submodule "linux"]
    path = repo/linux
    url = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[submodule "riscv-pk"]
    path = repo/riscv-pk
    url = https://github.com/riscv/riscv-pk
[submodule "riscv-isa-sim"]
    path = repo/riscv-isa-sim
    url = https://github.com/riscv/riscv-isa-sim
[submodule "opensbi"]
    path = repo/opensbi
    url = https://github.com/riscv-software-src/opensbi

I'm on RHEL8

Phantom1003 commented 2 months ago

Ops, I got the problem. It was introduced by #32, now the main branch should work :)

Thanks @Cpider

tobywenman commented 2 months ago

That works again on my end now. Thanks for the help!