vxKernel/src/kernel/kernel.c

34 lines
679 B
C

#include <vhex/kernel.h>
#include <vhex/hypervisor.h>
//---
// Initialization and unloading
//---
/* kinit(): Install and start vhex */
void kinit(void)
{
hyp_world_t casio = hypervisor_world_new(
"casio",
HYP_WORLD_STATUS_FLAG_UNDELETABLE
);
hyp_world_t vhex = hypervisor_world_new(
"vhex",
HYP_WORLD_STATUS_FLAG_UNDELETABLE
);
hypervisor_world_switch(casio, vhex);
}
/* kquit(): Quit vhex and give back control to the system */
void kquit(void)
{
hyp_world_t casio = hypervisor_world_find("casio");
hyp_world_t vhex = hypervisor_world_find("vhex");
hypervisor_world_switch(vhex, casio);
hypervisor_world_delete(casio);
hypervisor_world_delete(vhex);
}