Detect earlier if TCG processor is present

This commit is contained in:
Alex 2023-03-23 23:25:19 +02:00
parent c56bc2c4d7
commit 14bd4e1b96
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -200,10 +200,7 @@ EXTERNC NIF void Main(BootInfo *Info)
CPU::InitializeFeatures(0); CPU::InitializeFeatures(0);
if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0) if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0)
{ KPrint("\eFFA500TCG Virtual Machine detected.");
KPrint("\eFFA500Debugger detected! (TCG Virtual Machine)");
DebuggerIsAttached = true;
}
KPrint("Loading Kernel Symbols"); KPrint("Loading Kernel Symbols");
KernelSymbolTable = new SymbolResolver::Symbols((uintptr_t)Info->Kernel.FileBase); KernelSymbolTable = new SymbolResolver::Symbols((uintptr_t)Info->Kernel.FileBase);
@ -371,12 +368,14 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info)
InitializeMemoryManagement(Info); InitializeMemoryManagement(Info);
if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0)
DebuggerIsAttached = true;
#ifdef DEBUG
/* I had to do this because KernelAllocator /* I had to do this because KernelAllocator
* is a global constructor but we need * is a global constructor but we need
* memory management to be initialized first. * memory management to be initialized first.
*/ */
#ifdef DEBUG
// Running tests
TestString(); TestString();
TestMemoryAllocation(); TestMemoryAllocation();
#endif #endif