You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code starting from Chapter 3 does not work on newer versions of QEMU (it seems for any version >= 6.0). You will get an exception as soon as entering the supervisor mode with mcause=1 . This indicates an instruction access fault as per the manual.
After some investigation, I think this might be caused by the newer version of QEMU implementing Physical Memory Protection (PMP). As mentioned in the manual, if the registers are not configured, all memory access in supervisor mode will fail.
A simple (but dirty) solution is to bypass the PMP by adding one configuration in the kinit function.
The code starting from Chapter 3 does not work on newer versions of QEMU (it seems for any version >= 6.0). You will get an exception as soon as entering the supervisor mode with
mcause=1
. This indicates an instruction access fault as per the manual.After some investigation, I think this might be caused by the newer version of QEMU implementing Physical Memory Protection (PMP). As mentioned in the manual, if the registers are not configured, all memory access in supervisor mode will fail.
A simple (but dirty) solution is to bypass the PMP by adding one configuration in the
kinit
function.This allows read, write, and execution for all physical addresses starting from 0.
Reference: https://five-embeddev.com/riscv-isa-manual/latest/machine.html#sec:pmp
The text was updated successfully, but these errors were encountered: