diff --git a/guest/console/console.h b/guest/console/console.h index 64d693a9a3b8ed9151ac14056e6bb79553cc135e..d8d494ea10281696786eb4330a599e740254d92b 100644 --- a/guest/console/console.h +++ b/guest/console/console.h @@ -7,6 +7,6 @@ // --- FUNCTION --- -void console_send_pv(char *str); +void console_pv_send(char *str); #endif // _CONSOLE_H_ diff --git a/guest/console/console_pv.c b/guest/console/console_pv.c index 5a6b9de69a5adc144cb4ac4bd9bf96fd16e3c86a..d0616e095380f9011d8accf6eeda1094a4106c0c 100644 --- a/guest/console/console_pv.c +++ b/guest/console/console_pv.c @@ -10,7 +10,7 @@ // --- FUNCTION --- -void console_send_pv(char *str) { +void console_pv_send(char *str) { hyper_virtual_console_params_t param_console; param_console.msg = (uint64_t)str; diff --git a/guest/guest_main.c b/guest/guest_main.c index be271eb3b4cefe0913e87329febb9379385349ca..092e96fef0866be0e3a26678fd86fa61c47d496c 100644 --- a/guest/guest_main.c +++ b/guest/guest_main.c @@ -1,12 +1,8 @@ #include <stdint.h> #include "idt.h" -#include "utils.h" #include "x86.h" -#include "pmio.h" -#include "shared/hypercall_params.h" -#include "ide/ide.h" #include "gfx/gfx.h" #include "timer/timer.h" #include "console/console.h" @@ -14,36 +10,30 @@ // If PV == 1 => uses paravirtualized drivers (when available) // If PV == 0 => uses physical (hardware) drivers (when available) #if PV == 1 -#define timer_sleep timer_sleep_pv +#define timer_wait timer_pv_wait +#define console_send console_pv_send +#define gfx_init gfx_pv_init #else -#define timer_sleep timer_sleep_phys +#define timer_wait timer_phys_wait +#define console_send console_pv_send +#define gfx_init gfx_phys_init #endif -// Dummy examples -// void timer_sleep_pv(int usec) {} -// void timer_sleep_phys(int usec) {} - void guest_main() { idt_init(); // Initialize interrupt subsystem sti(); // Enable hardware interrupts - // - pv console - + // - console - char *str = "Hi from the guest !"; - console_send_pv(str); - - // - pv timer - - timer_pv_wait(1e6); + console_send(str); - // - phys timer - - timer_phys_wait(1e6); + // - timer - + timer_wait(1e6); - // - pv gfx init - + // - gfx init - gfx_pv_init(1920, 1080); - // - phys gfx init - - /* gfx_phys_init(1920, 1080); */ - - // timer_sleep(100000); + timer_wait(1e7); } diff --git a/vmm/operation.c b/vmm/operation.c index 54035b2fe3cffc2ae74f593a30fb700b8dd0ee14..e0f3406ac654b9c2ed841f2b3b40813d4eebd417 100644 --- a/vmm/operation.c +++ b/vmm/operation.c @@ -44,7 +44,7 @@ void op_callback_console_conclude(void *addr) { hyper_virtual_console_params_t *p_consol = (hyper_virtual_console_params_t *)addr; - printf("hypercall : sending a message...\n"); + printf("action : sending a message...\n"); printf("%s\n", (char *)p_consol->msg); } @@ -57,7 +57,7 @@ void op_callback_timer_conclude(void *addr) { hyper_timer_sleep_params_t *p_timer = (addr == NULL) ? ¶m_timer : (hyper_timer_sleep_params_t *)addr; - printf("hypercall : setting up a %dus timer...\n", p_timer->us); + printf("action : setting up a %dus timer...\n", p_timer->us); usleep(p_timer->us); } @@ -75,7 +75,7 @@ void op_callback_gfx_init_conclude(void *addr) { hyper_init_gfx_params_t *p_gfx_init = (addr == NULL) ? ¶m_gfx_init : (hyper_init_gfx_params_t *)addr; - printf("hypercall : initializing gfx %dx%d...\n", p_gfx_init->width, p_gfx_init->height); + printf("action : initializing gfx %dx%d...\n", p_gfx_init->width, p_gfx_init->height); width_gfx = p_gfx_init->width; height_gfx = p_gfx_init->height; sem_post(&sem_gfx);