by molticrystal · 5y ago · 0 comments
https://en.wikipedia.org/wiki/Cooperative_Linux
>The term "cooperative" is used to describe two entities working in parallel. In effect Cooperative Linux turns the two different operating system kernels into two big coroutines. Each kernel has its own complete CPU context and address space, and each kernel decides when to give control back to its partner.
>However, while both kernels theoretically have full access to the real hardware, modern PC hardware is not designed to be controlled by two different operating systems at the same time. Therefore, the host kernel is left in control of the real hardware and the guest kernel contains special drivers that communicate with the host and provide various important devices to the guest OS. The host can be any OS kernel that exports basic primitives that allow the Cooperative Linux portable driver to run in CPL0 mode (ring 0) and allocate memory.
[0] see the dozens of official Windows GUI frameworks: https://news.ycombinator.com/item?id=16736720 (and since then, it's gotten worse: https://www.google.com/search?hl=en&q=uwp%20deprecated)
QEMU might work for your usecase though.
It's mostly used in embedded or IOT systems, or inside a single application with async/await, but it can be used for the whole OS as well.
If the system and its built-in applications are designed to take advantage of it, and any external application is run inside a VM to make sure it doesn't misbehave, cooperative multitasking works great.