From 14bd4e1b9642353031ef5804ded85e4ff5793735 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 23 Mar 2023 23:25:19 +0200 Subject: [PATCH] Detect earlier if TCG processor is present --- Kernel.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Kernel.cpp b/Kernel.cpp index afa4b8d..5dfba68 100644 --- a/Kernel.cpp +++ b/Kernel.cpp @@ -200,10 +200,7 @@ EXTERNC NIF void Main(BootInfo *Info) CPU::InitializeFeatures(0); if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0) - { - KPrint("\eFFA500Debugger detected! (TCG Virtual Machine)"); - DebuggerIsAttached = true; - } + KPrint("\eFFA500TCG Virtual Machine detected."); KPrint("Loading Kernel Symbols"); KernelSymbolTable = new SymbolResolver::Symbols((uintptr_t)Info->Kernel.FileBase); @@ -371,12 +368,14 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info) InitializeMemoryManagement(Info); + if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0) + DebuggerIsAttached = true; + +#ifdef DEBUG /* I had to do this because KernelAllocator * is a global constructor but we need * memory management to be initialized first. */ -#ifdef DEBUG - // Running tests TestString(); TestMemoryAllocation(); #endif