From ba113a088aeb344d83b97485e4f792a5a2251c78 Mon Sep 17 00:00:00 2001 From: "adrian.spycher" <adrian.spycher@etu.hesge.ch> Date: Tue, 15 Oct 2024 11:16:12 +0200 Subject: [PATCH] feat!: complete second hypercall --- vmm/vmm_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/vmm/vmm_main.c b/vmm/vmm_main.c index ea766d9..efcdbae 100644 --- a/vmm/vmm_main.c +++ b/vmm/vmm_main.c @@ -163,13 +163,20 @@ int main(int argc, char* argv[]) case 1: // console - hyper_virtual_console_params_t *p = (hyper_virtual_console_params_t *)shared_buf; - printf("%s\n", p->msg + mem); + hyper_virtual_console_params_t *p_consol = (hyper_virtual_console_params_t *)shared_buf; + printf("%s\n", p_consol->msg + mem); + break; + + case 2: // timer + + hyper_timer_sleep_params_t *p_timer = (hyper_timer_sleep_params_t *)shared_buf; + printf("waiting %dus\n", p_timer->us); + sleep(p_timer->us / 1e6); + done = true; break; } } - done = true; break; case KVM_EXIT_MMIO: // Encountered a MMIO VMexit -- GitLab