The final report of Google Summer of Code.
This project was continued from the project last year -- to provide a hypervisor to fit the RTEMS paravirtualization layer. The POK is an ARINC 653 compliant operating system, but not a hypervisor supported virtualization. The paravirtualization layer in RTEMS is a set of sensitive instructions that can't be execute in user space directly. To support the paravirtualization layer in RTEMS, we have to adapt the POK as a hypervisor and implement the interface defined in paravirtualization layer.
In the design phase, I think we should separate the virtualization progress from normal POK development. So first step we implement a hypercall system, and replace some virtualization-related system with new hypercall. Before the Summer began Philipp has changed the code of ocarina to support the virtualization option in ADDL.
The goal should be getting the timer sample in RTEMS running. The key problem is interrupt handling and delivery. The new structure vCPU in POK kernel which aims to management virtualization resource better is also designed for interrupt delivery.
When an interrupt happened, it should be handing in POK kernel first, and then the POK kernel check all the vCPU interrupt register information. If one vCPU is register for an interrupt, the POK kernel will mark in the vCPU.
After the interrupt hanging in the vCPU structure, when a vCPU resumes, it should deal with interrupt. This part mainly using the iret instruction to jump to user space from kernel space. In the user space, after the interrupt handler of Guest OS running, it will return to kernel space through hypercall do_iret. However, unfortunately, this return part can't work normally yet now.
In the sample testHypercall, there is an example of handler in user space. However, this never be invoked due to the failure of iret instruction.