visor/src/efi.c

33 lines
574 B
C
Raw Normal View History

2025-03-10 19:19:53 +01:00
#include <stdbool.h>
2025-03-10 02:36:46 +01:00
#include <efi.h>
#include <efilib.h>
2025-03-10 19:19:53 +01:00
#include "virt.h"
struct virt_vtable *virt = &virt_vtable_intel;
static char virt_err[100];
2025-03-10 02:36:46 +01:00
EFIAPI
EFI_STATUS
efi_main(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE *systemTable)
{
InitializeLib(imageHandle, systemTable);
2025-03-10 20:24:32 +01:00
2025-03-10 02:36:46 +01:00
Print(L"Hello, World!\n");
2025-03-10 19:19:53 +01:00
2025-03-10 20:24:32 +01:00
AsciiPrint("* Checking for VT-x Support\n");
2025-03-10 19:19:53 +01:00
if (!virt->has_support(virt_err, sizeof virt_err)) {
AsciiPrint(virt_err);
2025-03-10 20:24:32 +01:00
} else {
AsciiPrint("* Enabling VT-x\n");
virt->enable();
AsciiPrint("* VT-x enabled!\n");
2025-03-10 19:19:53 +01:00
}
for (;;) {}
2025-03-10 02:36:46 +01:00
return EFI_SUCCESS;
}