--- trunk/reactos/ntoskrnl/mm/mminit.c 2005-10-24 17:54:55 UTC (rev 18753)
+++ trunk/reactos/ntoskrnl/mm/mminit.c 2005-10-24 17:55:50 UTC (rev 18754)
@@ -31,22 +31,10 @@
static BOOLEAN IsThisAnNtAsSystem = FALSE;
static MM_SYSTEM_SIZE MmSystemSize = MmSmallSystem;
-static MEMORY_AREA* kernel_text_desc = NULL;
-static MEMORY_AREA* kernel_init_desc = NULL;
-static MEMORY_AREA* kernel_kpcr_desc = NULL;
-static MEMORY_AREA* kernel_data_desc = NULL;
-static MEMORY_AREA* kernel_param_desc = NULL;
-static MEMORY_AREA* kernel_pool_desc = NULL;
-static MEMORY_AREA* kernel_shared_data_desc = NULL;
-static MEMORY_AREA* kernel_mapped_vga_framebuffer_desc = NULL;
-static MEMORY_AREA* MiKernelMapDescriptor = NULL;
-static MEMORY_AREA* MiPagedPoolDescriptor = NULL;
-
PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress;
PVOID MiNonPagedPoolStart;
ULONG MiNonPagedPoolLength;
-//PVOID MiKernelMapStart;
extern ULONG init_stack;
extern ULONG init_stack_top;
@@ -92,6 +80,7 @@
NTSTATUS Status;
PHYSICAL_ADDRESS BoundaryAddressMultiple;
PFN_TYPE Pfn;
+ PMEMORY_AREA MArea;
DPRINT("MmInitVirtualMemory(%x, %x)\n",LastKernelAddress, KernelLength);
@@ -100,12 +89,16 @@
MmInitMemoryAreas();
- MiNonPagedPoolStart = (char*)LastKernelAddress + PAGE_SIZE;
+ /* Start the paged and nonpaged pool at a 4MB boundary. */
+ MiNonPagedPoolStart = (PVOID)ROUND_UP((ULONG_PTR)LastKernelAddress + PAGE_SIZE, 0x400000);
MiNonPagedPoolLength = MM_NONPAGED_POOL_SIZE;
- MmPagedPoolBase = (char*)MiNonPagedPoolStart + MiNonPagedPoolLength + PAGE_SIZE;
+ MmPagedPoolBase = (PVOID)ROUND_UP((ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength + PAGE_SIZE, 0x400000);
MmPagedPoolSize = MM_PAGED_POOL_SIZE;
+ DPRINT("NonPagedPool %x - %x, PagedPool %x - %x\n", MiNonPagedPoolStart, (ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength - 1,
+ MmPagedPoolBase, (ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize - 1);
+
MiInitializeNonPagedPool();
/*
@@ -120,11 +113,37 @@
&BaseAddress,
PAGE_SIZE * MAXIMUM_PROCESSORS,
0,
- &kernel_kpcr_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
+ /* Local APIC base */
+ BaseAddress = (PVOID)0xFEE00000;
+ MmCreateMemoryArea(NULL,
+ MmGetKernelAddressSpace(),
+ MEMORY_AREA_SYSTEM,
+ &BaseAddress,
+ PAGE_SIZE,
+ 0,
+ &MArea,
+ TRUE,
+ FALSE,
+ BoundaryAddressMultiple);
+
+ /* i/o APIC base */
+ BaseAddress = (PVOID)0xFEC00000;
+ MmCreateMemoryArea(NULL,
+ MmGetKernelAddressSpace(),
+ MEMORY_AREA_SYSTEM,
+ &BaseAddress,
+ PAGE_SIZE,
+ 0,
+ &MArea,
+ TRUE,
+ FALSE,
+ BoundaryAddressMultiple);
+
BaseAddress = (PVOID)0xFF3A0000;
MmCreateMemoryArea(NULL,
MmGetKernelAddressSpace(),
@@ -132,7 +151,7 @@
&BaseAddress,
0x20000,
0,
- &kernel_mapped_vga_framebuffer_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
@@ -151,7 +170,7 @@
&BaseAddress,
Length,
0,
- &kernel_text_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
@@ -168,7 +187,7 @@
&BaseAddress,
Length,
0,
- &kernel_init_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
@@ -190,7 +209,7 @@
&BaseAddress,
Length,
0,
- &kernel_data_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
@@ -203,7 +222,7 @@
&BaseAddress,
Length,
0,
- &kernel_param_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
@@ -215,23 +234,11 @@
&BaseAddress,
MiNonPagedPoolLength,
0,
- &kernel_pool_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
- BaseAddress = (PVOID)MM_KERNEL_MAP_BASE;
- Status = MmCreateMemoryArea(NULL,
- MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- MM_KERNEL_MAP_SIZE,
- 0,
- &MiKernelMapDescriptor,
- TRUE,
- FALSE,
- BoundaryAddressMultiple);
-
BaseAddress = MmPagedPoolBase;
Status = MmCreateMemoryArea(NULL,
MmGetKernelAddressSpace(),
@@ -239,7 +246,7 @@
&BaseAddress,
MmPagedPoolSize,
0,
- &MiPagedPoolDescriptor,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);
@@ -257,7 +264,7 @@
&BaseAddress,
Length,
0,
- &kernel_shared_data_desc,
+ &MArea,
TRUE,
FALSE,
BoundaryAddressMultiple);