Using the MMU with ESP-IDF
Posted: Sun Oct 31, 2021 8:33 pm
Last year I did a port of Fuzix (a minimal Unix-like operating system) to the ESP8266; it worked really well. (<plug>http://cowlark.com/2021-02-09-esp8266-fuzix</plug>) I'd like to now do a port for the ESP32.
As the ESP32 has a MMU, it'd be really nice to use it. This would have a number of benefits including faster context switches and having all processes load at the same virtual address, but it seems that the WROVER and WROOM units I have don't support using external SRAM for code, so I'm limited to the internal 128kB+128kB RAM. That's lots, TBH, particularly when it's backed up by swap.
However I don't know how easy it is to use the MMU alongside the IDF. The simplest thing would be to run the entire Fuzix kernel as a FreeRTOS task, possibly tied to the second core, with kernel code in flash and the process code in SRAM0 and 2 (and ESP-IDF configured to ignore these areas). However, for the MMU to work at all I have to configure the PID to be 2..7. I know that FreeRTOS doesn't use the MMU at all; does it also not touch the PID system? Would there be any problems if I run the entire system at PID 2?
As the ESP32 has a MMU, it'd be really nice to use it. This would have a number of benefits including faster context switches and having all processes load at the same virtual address, but it seems that the WROVER and WROOM units I have don't support using external SRAM for code, so I'm limited to the internal 128kB+128kB RAM. That's lots, TBH, particularly when it's backed up by swap.
However I don't know how easy it is to use the MMU alongside the IDF. The simplest thing would be to run the entire Fuzix kernel as a FreeRTOS task, possibly tied to the second core, with kernel code in flash and the process code in SRAM0 and 2 (and ESP-IDF configured to ignore these areas). However, for the MMU to work at all I have to configure the PID to be 2..7. I know that FreeRTOS doesn't use the MMU at all; does it also not touch the PID system? Would there be any problems if I run the entire system at PID 2?