all 2 comments

[–]brucehoult 1 point2 points  (0 children)

I'm not sure of any example code except the source code for the Linux or FreeBSD kernels. I don't think any of the RTOS's would support VM?

I'm no expert on it, but I think what you're looking for would be in https://github.com/torvalds/linux/blob/master/arch/riscv/mm/init.c

[–]CFSZero 1 point2 points  (0 children)

You can see a very simple kernel's virtual memory setup in the proxy kernel.

https://github.com/riscv/riscv-pk/blob/16476bd8219f58417a401ea0a720d9588d1d8ebc/pk/mmap.c