mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Fixed the size of the hyperspace area (thanks to Filip Navara).
- Enabled Pae mode in freeldr if it is requested. svn path=/trunk/; revision=16592
This commit is contained in:
parent
6d92ae56c6
commit
6088c647a3
3 changed files with 53 additions and 26 deletions
|
@ -72,7 +72,7 @@ _kernel_pagetable:
|
|||
.fill 2*4096, 1, 0
|
||||
|
||||
_hyperspace_pagetable:
|
||||
.fill 2*4096, 1, 0
|
||||
.fill 4096, 1, 0
|
||||
|
||||
_apic_pagetable:
|
||||
.fill 4096, 1, 0
|
||||
|
|
|
@ -279,11 +279,32 @@ VOID
|
|||
FASTCALL
|
||||
FrLdrGetPaeMode(VOID)
|
||||
{
|
||||
/* FIXME: Read command line */
|
||||
PCHAR p;
|
||||
|
||||
PaeModeEnabled = FALSE;
|
||||
|
||||
/* Read Command Line */
|
||||
p = (PCHAR)LoaderBlock.CommandLine;
|
||||
while ((p = strchr(p, '/')) != NULL) {
|
||||
|
||||
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
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -445,9 +466,6 @@ FrLdrSetupPageDirectory(VOID)
|
|||
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;
|
||||
|
|
|
@ -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];
|
||||
|
@ -2371,12 +2371,13 @@ MiInitPageDirectoryMap(VOID)
|
|||
MEMORY_AREA* hyperspace_desc = NULL;
|
||||
PHYSICAL_ADDRESS BoundaryAddressMultiple;
|
||||
PVOID BaseAddress;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("MiInitPageDirectoryMap()\n");
|
||||
|
||||
BoundaryAddressMultiple.QuadPart = 0;
|
||||
BaseAddress = (PVOID)PAGETABLE_MAP;
|
||||
MmCreateMemoryArea(NULL,
|
||||
Status = MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
|
@ -2386,17 +2387,25 @@ MiInitPageDirectoryMap(VOID)
|
|||
TRUE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
KEBUGCHECK(0);
|
||||
}
|
||||
BaseAddress = (PVOID)HYPERSPACE;
|
||||
MmCreateMemoryArea(NULL,
|
||||
Status = MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
Ke386Pae ? 0x400000 : 0x800000,
|
||||
0x400000,
|
||||
0,
|
||||
&hyperspace_desc,
|
||||
TRUE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
KEBUGCHECK(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue