Page table fault when accessing virtual address xxx. #262
-
Do I have to use FS mode if I want to append a device ? I would like to append a new device using SE mode, so I create a new device named 'PKCC' inhert from 'BasicPioDevice' in '/src/dev'.
the C program 'paixu.elf' will access the address '0xF0000000',
But the access to address 0xF0000000 failed with the follwing fatal:
how to solve the error? Please help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Typically, if you do FS mode, you can open an mmap to "/dev/mem" to use physical address directly. If you want to avoid FS mode, you can modify gem5 to not trigger the address translation process for that particular address range. |
Beta Was this translation helpful? Give feedback.
To follow up, in SE mode, you can use
Process.map
to insert virt->phys mappings into the emulated page table. See https://github.com/gem5/gem5/blob/stable/src/sim/Process.py#L39You can also use
mmap
in SE mode to get the specific virtual address that you used in themap
function described above.Finally, you may also be interested in the
EmulatedDriver
class found here: https://github.com/gem5/gem5/blob/stable/src/sim/Process.py#L75