X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fboot%2Ffreeldr%2Ffreeldr%2Freactos%2Floader.c;h=76be0c36d203c0d977e3f19a7561e8731a4fb6a6;hp=44cb02b88603bf495eec51637a26b7470d290e5d;hb=2316f9549895dfd2d58bc6ee7e85d578fcde0606;hpb=dce178cf7c71a5ac877e82cf49862fb20cad06f7 diff --git a/reactos/boot/freeldr/freeldr/reactos/loader.c b/reactos/boot/freeldr/freeldr/reactos/loader.c index 44cb02b8860..76be0c36d20 100644 --- a/reactos/boot/freeldr/freeldr/reactos/loader.c +++ b/reactos/boot/freeldr/freeldr/reactos/loader.c @@ -20,6 +20,7 @@ */ #include +#include <../arch/i386/hardware.h> #include #define NDEBUG @@ -279,32 +280,42 @@ VOID FASTCALL FrLdrGetPaeMode(VOID) { - PCHAR p; + BOOLEAN PaeModeSupported; + PaeModeSupported = FALSE; PaeModeEnabled = FALSE; - /* Read Command Line */ - p = (PCHAR)LoaderBlock.CommandLine; - while ((p = strchr(p, '/')) != NULL) { + if (CpuidSupported() & 1) + { + ULONG eax, ebx, ecx, FeatureBits; + GetCpuid(1, &eax, &ebx, &ecx, &FeatureBits); + if (FeatureBits & X86_FEATURE_PAE) + { + PaeModeSupported = TRUE; + } + } - p++; - /* Find "PAE" */ - if (!strnicmp(p, "PAE", 3)) { + if (PaeModeSupported) + { + PCHAR p; - /* Make sure there's nothing following it */ - if (p[3] == ' ' || p[3] == 0) { + /* Read Command Line */ + p = (PCHAR)LoaderBlock.CommandLine; + while ((p = strchr(p, '/')) != NULL) { - /* Use Pae */ - PaeModeEnabled = TRUE; - break; - } - } - } - if (PaeModeEnabled) - { - /* FIXME: - * Check if the cpu is pae capable - */ + p++; + /* Find "PAE" */ + if (!strnicmp(p, "PAE", 3)) { + + /* Make sure there's nothing following it */ + if (p[3] == ' ' || p[3] == 0) { + + /* Use Pae */ + PaeModeEnabled = TRUE; + break; + } + } + } } }