rustsbi/rustsbi-qemu

It can't start test in Linux environment

ChaiEvan opened this issue · 6 comments

It looks good in windows :

PS C:\Rust\rustsbi-qemu> cargo qemu
    Finished release [optimized] target(s) in 0.06s
     Running `target\release\xtask.exe qemu`
    Finished release [optimized] target(s) in 0.06s
    Finished release [optimized] target(s) in 0.06s
[rustsbi] RustSBI version 0.3.0-alpha.4, adapting to RISC-V SBI v1.0.0
.______       __    __      _______.___________.  _______..______   __
|   _  \     |  |  |  |    /       |           | /       ||   _  \ |  |
|  |_)  |    |  |  |  |   |   (----`---|  |----`|   (----`|  |_)  ||  |
|      /     |  |  |  |    \   \       |  |      \   \    |   _  < |  |
|  |\  \----.|  `--'  |.----)   |      |  |  .----)   |   |  |_)  ||  |
| _| `._____| \______/ |_______/       |__|  |_______/    |______/ |__|
[rustsbi] Implementation     : RustSBI-QEMU Version 0.2.0-alpha.2
[rustsbi] Platform Name      : riscv-virtio,qemu
[rustsbi] Platform SMP       : 8
[rustsbi] Platform Memory    : 0x80000000..0x88000000
[rustsbi] Boot HART          : 6
[rustsbi] Device Tree Region : 0x87e00000..0x87e01925
[rustsbi] Firmware Address   : 0x80000000
[rustsbi] Supervisor Address : 0x80200000
[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)
[rustsbi] pmp02: 0x80000000..0x80200000 (---)
[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)
[rustsbi] pmp04: 0x88000000..0x00000000 (-wr)
.....................

But when I try to run it in ubuntu22.04, an error was thrown out in the beginnig like this:

$:~/workspace/debug/rustsbi-qemu$ cargo qemu
    Finished release [optimized] target(s) in 0.01s
     Running `target/release/xtask qemu`
    Finished release [optimized] target(s) in 0.01s
    Finished release [optimized] target(s) in 0.01s
xtask: QEMU command not found. Does your system have QEMU installed and environment variable configured?
xtask: error: No such file or directory (os error 2)
$: ~

Do you have qemu installed? cargo qemu will search for qemu-system-riscv64 and need it to run correctly.

Though I think you have qemu, this seems not.

yes, I thought it was installed too.
added qemu to path, it didn't throw out errors anymore. Installed, it hang there.

~/workspace/debug/rustsbi-qemu$ cargo qemu
Finished release [optimized] target(s) in 0.01s
Running target/release/xtask qemu
Finished release [optimized] target(s) in 0.01s
Finished release [optimized] target(s) in 0.01s

I think I know what is going on. This is a known issue that we haven't yet determined its direct cause. To be short, on some platform, qemu give rustsbi-qemu a wrong device tree (some part of its format does not follow the spec), and rustsbi-qemu currently does not ignore these error and will trap in a deadly loop. Thus no output is shown.

Recently I have modified it a bit to bypass this issue and will open a PR of this modification to solve your problem.

#33 is now merged, please test again with latest main branch :) @ChaiEvan

fixed, thx

If there are futher problems, please reopen the issue to let the community know ;)