Electronic – RTOS + Virtual Memory

rtos

Given a device that incorporates an embedded processor (MIPS), MMU, small RAM and larger flash memory, is there an RTOS with small memory footprint that has a built in support for "virtual memory", where some RAM can be used as a cache for the larger flash memory?
(This implies a non-flat memory model, where page faults trigger an interrupt that performs the page swap)

Thanks

Best Answer

Generally speaking, RTOS and VM are mutually exclusive. The RT in RTOS stands for "Real Time", meaning that the OS has a quick (and deterministic) task swap time and IRQ latency. You can't really have that when some of your memory is located in Flash/SSD/HD and might have to be swapped into main memory.

Another two features that you don't really see together is "small memory footprint" and VM. You don't define what "small memory footprint" is, so I'm defining it as "the most amount of ram you'd find embedded with the CPU". Or about 128Kbytes. VM is rarely used in these systems, due to needing RT performance and usually having limited amounts of off-chip storage. If the RAM is external, you can always use larger chips to get rid of the need for VM.

Your best bet is to use a non-RT OS that has some RT extensions. Linux is the first thing that comes to mind here, but I would hardly describe it as having a "small memory footprint". I have not seen other RTOS's that can do this. I'm not saying that they don't exist, just that I haven't seen them. If you do find one, I'd be wary of it since it definitely isn't mainstream and probably has some issues (that may or may not matter to you).