Fix the detection of /3GB switch.
Modified: trunk/reactos/boot/freeldr/freeldr/multiboot.c
_____
Modified: trunk/reactos/boot/freeldr/freeldr/multiboot.c
--- trunk/reactos/boot/freeldr/freeldr/multiboot.c 2005-02-18
15:13:02 UTC (rev 13632)
+++ trunk/reactos/boot/freeldr/freeldr/multiboot.c 2005-02-18
17:15:01 UTC (rev 13633)
@@ -4,7 +4,7 @@
* FILE: boot/freeldr/freeldr/multiboot.c
* PURPOSE: ReactOS Loader
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
- * Hartmutt Birr - SMP/PAE Code
+ * Hartmut Birr - SMP/PAE Code
*/
#include <freeldr.h>
@@ -54,7 +54,7 @@
#define ApicPageTableIndexPae (APIC_BASE >> 21)
-#define KernelEntryPoint (KernelEntry - KERNEL_BASE_PHYS) +
KernelBase
+#define KernelEntryPoint (KernelEntry - KERNEL_BASE_PHYS) +
KernelBase
/* Load Address of Next Module */
ULONG_PTR NextModuleBase = 0;
@@ -217,7 +217,7 @@
/* Jump to Kernel */
PagedJump = (ASMCODE)KernelEntryPoint;
PagedJump(Magic, &LoaderBlock);
- }
+}
/*++
* FrLdrGetKernelBase
@@ -239,27 +239,24 @@
FASTCALL
FrLdrGetKernelBase(VOID)
{
- PCHAR p1;
- PCHAR p2;
+ PCHAR p;
/* Read Command Line */
- for(p1 = (PCHAR)&LoaderBlock.CommandLine; *p1 && (p2 = strchr(p1,
'/')); p2++) {
+ p = (PCHAR)LoaderBlock.CommandLine;
+ while ((p = strchr(p, '/')) != NULL) {
/* Find "/3GB" */
- if (!strnicmp(p2, "3GB", 3)) {
+ if (!strnicmp(p + 1, "3GB", 3)) {
/* Make sure there's nothing following it */
- if (p2[3] == ' ' || p2[3] == 0) {
+ if (p[4] == ' ' || p[4] == 0) {
/* Use 3GB */
KernelBase = 0xC0000000;
-
- } else {
-
- /* Use 2GB */
- KernelBase = 0x80000000;
}
}
+
+ p++;
}
/* Set KernelBase */
Show replies by date