Message-ID: <42CDCDE0.7090100@reactos.com>
Date: Fri, 08 Jul 2005 02:50:40 +0200
From: Filip Navara <navaraf@reactos.com>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: ReactOS Development List <ros-dev@reactos.com>
Subject: Re: [ros-dev] Re: [ros-svn] [navaraf] 16445: Put the page tables
	and hyperspace at	the right place in memory (ie. Windows compatible).
References: <000601c581c1$cf6b3cb0$6b01a8c0@PENELOPE>
 <42CD8CAD.5060006@gmx.de>
In-Reply-To: <42CD8CAD.5060006@gmx.de>
Content-Type: multipart/mixed; boundary="------------000508090500060805090906"

This is a multi-part message in MIME format.
--------------000508090500060805090906
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hartmut Birr wrote:

>navaraf@svn.reactos.com wrote:
>
>  
>
>>Put the page tables and hyperspace at the right place in memory (ie. Windows compatible).
>>
>>
>>Updated files:
>>trunk/reactos/boot/freeldr/freeldr/arch/i386/mb.S
>>trunk/reactos/boot/freeldr/freeldr/multiboot.c
>>trunk/reactos/ntoskrnl/mm/i386/page.c
>>
>>_______________________________________________
>>Ros-svn mailing list
>>Ros-svn@reactos.com
>>http://reactos.com:8080/mailman/listinfo/ros-svn
>>
>>
>> 
>>
>>    
>>
>Hi,
>
>on windows the hyperspace area is always 4MB. If you change the size you
>have also to change the mapping and initialisation functions.
>  
>
Sorry, I was confused by incorrect graph in the Windows Internals, 4th 
edition book which shows an 8Mb hyperspace region (in fact the high 4Mb 
are unused). Do you think the attached patch corrects the problem?

Regards,
Filip

--------------000508090500060805090906
Content-Type: text/x-patch;
 name="hyperspace.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="hyperspace.diff"

Index: boot/freeldr/freeldr/reactos/loader.c
===================================================================
--- boot/freeldr/freeldr/reactos/loader.c	(revision 16454)
+++ boot/freeldr/freeldr/reactos/loader.c	(working copy)
@@ -445,9 +445,6 @@
         PageDir->Pde[HyperspacePageTableIndex].Valid = 1;
         PageDir->Pde[HyperspacePageTableIndex].Write = 1;
         PageDir->Pde[HyperspacePageTableIndex].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable);
-        PageDir->Pde[HyperspacePageTableIndex + 1].Valid = 1;
-        PageDir->Pde[HyperspacePageTableIndex + 1].Write = 1;
-        PageDir->Pde[HyperspacePageTableIndex + 1].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable + 4096);
 
         /* Set up the Apic PDE */
         PageDir->Pde[ApicPageTableIndex].Valid = 1;
Index: boot/freeldr/freeldr/arch/i386/mb.S
===================================================================
--- boot/freeldr/freeldr/arch/i386/mb.S	(revision 16454)
+++ boot/freeldr/freeldr/arch/i386/mb.S	(working copy)
@@ -72,7 +72,7 @@
 	.fill 2*4096, 1, 0
 
 _hyperspace_pagetable:
-	.fill 2*4096, 1, 0
+	.fill 4096, 1, 0
 	
 _apic_pagetable:
 	.fill 4096, 1, 0
Index: ntoskrnl/mm/i386/page.c
===================================================================
--- ntoskrnl/mm/i386/page.c	(revision 16476)
+++ ntoskrnl/mm/i386/page.c	(working copy)
@@ -40,7 +40,7 @@
 #define PAE_PAGEDIRECTORY_MAP	(0xc0000000 + (PAGETABLE_MAP / (512)))
 
 #define HYPERSPACE		(Ke386Pae ? 0xc0800000 : 0xc0400000)
-#define IS_HYPERSPACE(v)	(((ULONG)(v) >= HYPERSPACE && (ULONG)(v) < 0xc0c00000))
+#define IS_HYPERSPACE(v)	(((ULONG)(v) >= HYPERSPACE && (ULONG)(v) < HYPERSPACE + 0x400000))
 
 ULONG MmGlobalKernelPageDirectory[1024];
 ULONGLONG MmGlobalKernelPageDirectoryForPAE[2048];
@@ -2391,7 +2391,7 @@
                       MmGetKernelAddressSpace(),
                       MEMORY_AREA_SYSTEM,
                       &BaseAddress,
-		      Ke386Pae ? 0x400000 : 0x800000,
+                      0x400000,
                       0,
                       &hyperspace_desc,
                       TRUE,

--------------000508090500060805090906--

