Check if the cpu supports the pae mode.
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/loader.c

Modified: trunk/reactos/boot/freeldr/freeldr/reactos/loader.c
--- trunk/reactos/boot/freeldr/freeldr/reactos/loader.c	2005-07-30 18:52:33 UTC (rev 16898)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/loader.c	2005-07-30 18:55:25 UTC (rev 16899)
@@ -20,6 +20,7 @@
  */
 
 #include <freeldr.h>
+#include <../arch/i386/hardware.h>
 #include <internal/i386/ke.h>
 
 #define NDEBUG
@@ -279,33 +280,43 @@
 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;
-            }
-        }
+          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;
+              }
+          }
+       }
     }
-    if (PaeModeEnabled)
-    {
-       /* FIXME:
-        *   Check if the cpu is pae capable
-        */
-    }
 }
 
 /*++