Real Time OS inside Hypervisor

Just wondering if anyone has any thoughts on running a real time OS inside Hypervisor.

  • What level of time determinism could be expected?
  • Could the VM process be given real time scheduling priority?
  • Can the VM process be assigned an exclusive core(s)?

Whilst probably not suitable for safety critical systems, this could be a nice approach for certain low to medium performance requirements.

Any thoughts or info would be greatly appreciated.

Post not yet marked as solved Up vote post of mttx Down vote post of mttx
1.3k views

Replies

There is not strict real-time scheduling in Hypervisor framework at the moment.

If you have a concrete use case for a specific real time OS that is impacted, please file a feature request through the Feedback Assistant. This kind of feedback can drive the direction of future changes.

To approximate real time scheduling, you can try changing the scheduling of the thread running the vCPU.

Each vCPU is backed by thread in the process. What you can do is set up those threads such that it uses real time priority. This can be done through Mach APIs: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html#//apple_ref/doc/uid/TP30000905-CH211-BABCHEEB. Then, as long as the guest and its traps remain within the time constraints, you should have good control over the timing.

Thanks for the info.

I don't have a specific real time OS at the moment, but I've started trying to run FreeRTOS inside Hypervisor. Nothing to report yet.

Thanks for the link, the real time scheduling policy looks convincing. If real time threads are available in macOS, I wonder if a separate RTOS is even necessary?