Author: fireball
Date: Tue Sep 4 22:19:59 2007
New Revision: 28852
URL:
http://svn.reactos.org/svn/reactos?rev=28852&view=rev
Log:
- Use real NT KPCR address (0xFFDFF000).
- Remove all hacked KPCR_BASE definitions.
- Make FreeLDR give address of PageDirectoryStart/End addresses. This was being
ignored/incorrect until now and the page directory could've gotten overwritten.
- Properly setup the HAL PDE, instead of having different PDEs for KUSER_SHARED_DATA, KPCR
and ACPI I/O.
- Do not over-write shared user data with ACPI I/O anymore. This was probably a bad idea.
- Do not mark almost a meg of space as KPCR_USERD_SHARED data anymore, and don't mess
up the CPU TLB anymore.
- Give a dedicated page to KUSER_SHARED_DATA (Page 2, physical address 0x2000) right after
the KPCR, isntead of a random address that probably ended up overwritten later during the
OS's lifetime.
- Fix FS selector in the GDT.
- Remove hack in Trap Fault Handler.
- Add a little hack to allow mapping Page 2 into user-space even though it's marked as
used, this is for the Shared User Data page.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c
trunk/reactos/boot/freeldr/freeldr/include/reactos.h
trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
trunk/reactos/hal/halx86/include/halp.h
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ndk/asm.h
trunk/reactos/ntoskrnl/ex/sysinfo.c
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/io/iomgr/iomgr.c
trunk/reactos/ntoskrnl/ke/freeldr.c
trunk/reactos/ntoskrnl/ke/i386/cpu.c
trunk/reactos/ntoskrnl/mm/freelist.c
trunk/reactos/ntoskrnl/mm/i386/page.c
trunk/reactos/ntoskrnl/mm/mm.c
trunk/reactos/ntoskrnl/mm/mminit.c
trunk/reactos/ntoskrnl/ob/obinit.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c Tue Sep 4 22:19:59 2007
@@ -175,20 +175,10 @@
PageDir->Pde[HyperspacePageTableIndex].Write = 1;
PageDir->Pde[HyperspacePageTableIndex].PageFrameNumber =
PaPtrToPfn(hyperspace_pagetable);
- /* Set up the Apic PDE */
- PageDir->Pde[ApicPageTableIndex].Valid = 1;
- PageDir->Pde[ApicPageTableIndex].Write = 1;
- PageDir->Pde[ApicPageTableIndex].PageFrameNumber = PaPtrToPfn(apic_pagetable);
-
- /* Set up the KPCR PDE */
- PageDir->Pde[KpcrPageTableIndex].Valid = 1;
- PageDir->Pde[KpcrPageTableIndex].Write = 1;
- PageDir->Pde[KpcrPageTableIndex].PageFrameNumber = PaPtrToPfn(kpcr_pagetable);
-
- /* Set up the KUSER PDE */
- PageDir->Pde[KuserPageTableIndex].Valid = 1;
- PageDir->Pde[KuserPageTableIndex].Write = 1;
- PageDir->Pde[KuserPageTableIndex].PageFrameNumber = PaPtrToPfn(kuser_pagetable);
+ /* Set up the HAL PDE */
+ PageDir->Pde[HalPageTableIndex].Valid = 1;
+ PageDir->Pde[HalPageTableIndex].Write = 1;
+ PageDir->Pde[HalPageTableIndex].PageFrameNumber = PaPtrToPfn(apic_pagetable);
/* Set up Low Memory PTEs */
PageDir = (PPAGE_DIRECTORY_X86)&lowmem_pagetable;
@@ -209,35 +199,28 @@
PageDir->Pde[i].PageFrameNumber = PaToPfn(KERNEL_BASE_PHYS + i * PAGE_SIZE);
}
- /* Set up APIC PTEs */
+ /* Setup APIC Base */
PageDir = (PPAGE_DIRECTORY_X86)&apic_pagetable;
PageDir->Pde[0].Valid = 1;
PageDir->Pde[0].Write = 1;
PageDir->Pde[0].CacheDisable = 1;
PageDir->Pde[0].WriteThrough = 1;
- PageDir->Pde[0].PageFrameNumber = PaToPfn(APIC_BASE);
+ PageDir->Pde[0].PageFrameNumber = PaToPfn(HAL_BASE);
PageDir->Pde[0x200].Valid = 1;
PageDir->Pde[0x200].Write = 1;
PageDir->Pde[0x200].CacheDisable = 1;
PageDir->Pde[0x200].WriteThrough = 1;
- PageDir->Pde[0x200].PageFrameNumber = PaToPfn(APIC_BASE + KERNEL_BASE_PHYS);
-
- /* Set up KPCR PTEs */
- PageDir = (PPAGE_DIRECTORY_X86)&kpcr_pagetable;
- PageDir->Pde[0].Valid = 1;
- PageDir->Pde[0].Write = 1;
- PageDir->Pde[0].PageFrameNumber = 1;
-
- /* Setup KUSER PTEs */
- PageDir = (PPAGE_DIRECTORY_X86)&kuser_pagetable;
- for (i = 0; i < 1024; i++)
- {
- /* SEetup each entry */
- PageDir->Pde[i].Valid = 1;
- PageDir->Pde[i].Write = 1;
- PageDir->Pde[i].Owner = 1;
- PageDir->Pde[i].PageFrameNumber = PaToPfn(KI_USER_SHARED_DATA + i *
PAGE_SIZE);
- }
+ PageDir->Pde[0x200].PageFrameNumber = PaToPfn(HAL_BASE + KERNEL_BASE_PHYS);
+
+ /* Setup KUSER_SHARED_DATA Base */
+ PageDir->Pde[0x1F0].Valid = 1;
+ PageDir->Pde[0x1F0].Write = 1;
+ PageDir->Pde[0x1F0].PageFrameNumber = 2;
+
+ /* Setup KPCR Base*/
+ PageDir->Pde[0x1FF].Valid = 1;
+ PageDir->Pde[0x1FF].Write = 1;
+ PageDir->Pde[0x1FF].PageFrameNumber = 1;
}
PLOADER_MODULE
Modified: trunk/reactos/boot/freeldr/freeldr/include/reactos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/reactos.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/reactos.h Tue Sep 4 22:19:59 2007
@@ -40,16 +40,12 @@
#define STARTUP_BASE 0xC0000000
#define HYPERSPACE_BASE 0xC0400000
-#define HYPERSPACE_PAE_BASE 0xC0800000
-#define APIC_BASE 0xFEC00000
-#define KPCR_BASE 0xFF000000
+#define HAL_BASE 0xFFC00000
#define LowMemPageTableIndex 0
#define StartupPageTableIndex (STARTUP_BASE >> 22)
#define HyperspacePageTableIndex (HYPERSPACE_BASE >> 22)
-#define KpcrPageTableIndex (KPCR_BASE >> 22)
-#define ApicPageTableIndex (APIC_BASE >> 22)
-#define KuserPageTableIndex (KI_USER_SHARED_DATA >> 22)
+#define HalPageTableIndex (HAL_BASE >> 22)
typedef struct _PAGE_DIRECTORY_X86
{
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Tue Sep 4 22:19:59 2007
@@ -22,6 +22,9 @@
#include <freeldr.h>
#include <debug.h>
+extern ULONG PageDirectoryStart;
+extern ULONG PageDirectoryEnd;
+
ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
char reactos_kernel_cmdline[255]; // Command line passed to kernel
LOADER_MODULE reactos_modules[64]; // Array to hold boot module info loaded for the
kernel
@@ -592,6 +595,8 @@
* Setup multiboot information structure
*/
LoaderBlock.CommandLine = reactos_kernel_cmdline;
+ LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
+ LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
LoaderBlock.ModsCount = 0;
LoaderBlock.ModsAddr = reactos_modules;
LoaderBlock.DrivesAddr = reactos_arc_disk_info;
Modified: trunk/reactos/hal/halx86/include/halp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?…
==============================================================================
--- trunk/reactos/hal/halx86/include/halp.h (original)
+++ trunk/reactos/hal/halx86/include/halp.h Tue Sep 4 22:19:59 2007
@@ -4,9 +4,6 @@
#ifndef __INTERNAL_HAL_HAL_H
#define __INTERNAL_HAL_HAL_H
-
-/* Temporary hack */
-#define KPCR_BASE 0xFF000000
#define HAL_APC_REQUEST 0
#define HAL_DPC_REQUEST 1
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=2…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Tue Sep 4 22:19:59 2007
@@ -227,11 +227,7 @@
#define ZwCurrentProcess() NtCurrentProcess()
#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )
#define ZwCurrentThread() NtCurrentThread()
-#ifdef _REACTOS_
-#define KIP0PCRADDRESS 0xff000000
-#else
#define KIP0PCRADDRESS 0xffdff000
-#endif
#define KERNEL_STACK_SIZE 12288
#define KERNEL_LARGE_STACK_SIZE 61440
Modified: trunk/reactos/include/ndk/asm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/asm.h?rev=2885…
==============================================================================
--- trunk/reactos/include/ndk/asm.h (original)
+++ trunk/reactos/include/ndk/asm.h Tue Sep 4 22:19:59 2007
@@ -29,7 +29,7 @@
#ifdef CONFIG_SMP
#define PCR fs:
#else
-#define PCR ds:[0xFF000000]
+#define PCR ds:[0xFFDFF000]
#endif
#endif
@@ -613,3 +613,4 @@
+
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c Tue Sep 4 22:19:59 2007
@@ -904,7 +904,7 @@
}
CurrentTime.QuadPart = KeQueryInterruptTime();
- Prcb = ((PKPCR)KPCR_BASE)->Prcb;
+ Prcb = KeGetPcr()->Prcb;
for (i = 0; i < KeNumberProcessors; i++)
{
Spi->IdleTime.QuadPart = (Prcb->IdleThread->KernelTime +
Prcb->IdleThread->UserTime) * 100000LL; // IdleTime
@@ -1196,7 +1196,7 @@
ti = KeQueryTimeIncrement();
- Prcb = ((PKPCR)KPCR_BASE)->Prcb;
+ Prcb = KeGetPcr()->Prcb;
for (i = 0; i < KeNumberProcessors; i++)
{
//sii->ContextSwitches = Prcb->KeContextSwitches;
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h Tue Sep 4 22:19:59 2007
@@ -60,7 +60,6 @@
#define NR_SECTION_PAGE_ENTRIES 1024
#define TEB_BASE 0x7FFDE000
-#define KPCR_BASE 0xFF000000
/* Although Microsoft says this isn't hardcoded anymore,
they won't be able to change it. Stuff depends on it */
Modified: trunk/reactos/ntoskrnl/io/iomgr/iomgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iomgr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iomgr.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iomgr.c Tue Sep 4 22:19:59 2007
@@ -149,7 +149,7 @@
for (i = 0; i < KeNumberProcessors; i++)
{
/* Get the PRCB for this CPU */
- Prcb = ((PKPCR)(KPCR_BASE + i * PAGE_SIZE))->Prcb;
+ Prcb = ((PKPCR)(KIP0PCRADDRESS + i * PAGE_SIZE))->Prcb;
DPRINT("Setting up lookaside for CPU: %x, PRCB: %p\n", i, Prcb);
/* Set the Large IRP List */
Modified: trunk/reactos/ntoskrnl/ke/freeldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/freeldr.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/freeldr.c (original)
+++ trunk/reactos/ntoskrnl/ke/freeldr.c Tue Sep 4 22:19:59 2007
@@ -471,8 +471,8 @@
Status = KiRosAllocateArcDescriptor(0, 1, MemoryFirmwarePermanent);
if (Status != STATUS_SUCCESS) return Status;
- /* Build an entry for the KPCR (which we put in page 1) */
- Status = KiRosAllocateArcDescriptor(1, 2, LoaderMemoryData);
+ /* Build an entry for the KPCR and KUSER_SHARED_DATA */
+ Status = KiRosAllocateArcDescriptor(1, 3, LoaderMemoryData);
if (Status != STATUS_SUCCESS) return Status;
/* Build an entry for the PDE and return the status */
@@ -882,8 +882,8 @@
/* First get some kernel-loader globals */
AcpiTableDetected = (RosLoaderBlock->Flags & MB_FLAGS_ACPI_TABLE) ? TRUE :
FALSE;
- MmFreeLdrMemHigher = RosLoaderBlock->MemHigher;
- MmFreeLdrPageDirectoryEnd = RosLoaderBlock->PageDirectoryEnd;
+ MmFreeLdrMemHigher = RosLoaderBlock->MemHigher;
+ MmFreeLdrPageDirectoryEnd = RosLoaderBlock->PageDirectoryEnd;
if (!MmFreeLdrPageDirectoryEnd) MmFreeLdrPageDirectoryEnd = 0x40000;
/* Set the NT Loader block and initialize it */
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Tue Sep 4 22:19:59 2007
@@ -38,7 +38,7 @@
{0xffff, 0x0000, {{0x00, 0xfb, 0xcf, 0x00}}}, /* KGDT_R3_CODE */
{0xffff, 0x0000, {{0x00, 0xf3, 0xcf, 0x00}}}, /* KGDT_R3_DATA*/
{0x0000, 0x0000, {{0x00, 0x00, 0x00, 0x00}}}, /* KGDT_TSS */
- {0x0fff, 0x0000, {{0x00, 0x93, 0xc0, 0xff}}}, /* KGDT_R0_PCR */
+ {0x0001, 0xf000, {{0xdf, 0x93, 0xc0, 0xff}}}, /* KGDT_R0_PCR */
{0x0fff, 0x0000, {{0x00, 0xf3, 0x40, 0x00}}}, /* KGDT_R3_TEB */
{0x0000, 0x0000, {{0x00, 0x00, 0x00, 0x00}}}, /* KGDT_UNUSED */
{0x0000, 0x0000, {{0x00, 0x00, 0x00, 0x00}}}, /* KGDT_LDT */
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c Tue Sep 4 22:19:59 2007
@@ -428,7 +428,7 @@
if (j == 0)
{
/*
- * Page zero is reserved
+ * Page zero is reserved for the IVT
*/
MmPageArray[0].Flags.Type = MM_PHYSICAL_PAGE_BIOS;
MmPageArray[0].Flags.Consumer = MC_NPPOOL;
@@ -443,6 +443,19 @@
/*
* Page one is reserved for the initial KPCR
+ */
+ MmPageArray[1].Flags.Type = MM_PHYSICAL_PAGE_BIOS;
+ MmPageArray[1].Flags.Consumer = MC_NPPOOL;
+ MmPageArray[1].Flags.Zero = 0;
+ MmPageArray[1].ReferenceCount = 0;
+ InsertTailList(&BiosPageListHead,
+ &MmPageArray[1].ListEntry);
+ MmStats.NrReservedPages++;
+ }
+ else if (j == 2)
+ {
+ /*
+ * Page two is reserved for the KUSER_SHARED_DATA
*/
MmPageArray[1].Flags.Type = MM_PHYSICAL_PAGE_BIOS;
MmPageArray[1].Flags.Consumer = MC_NPPOOL;
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c Tue Sep 4 22:19:59 2007
@@ -1925,8 +1925,16 @@
{
if (!MmIsUsablePage(Pages[i]))
{
- DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i]));
- KEBUGCHECK(0);
+ /* Is this an attempt to map KUSER_SHARED_DATA? */
+ if ((Address == (PVOID)0x7FFE0000) && (PageCount == 1) &&
(Pages[0] == 2))
+ {
+ // allow
+ }
+ else
+ {
+ DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i]));
+ KEBUGCHECK(0);
+ }
}
}
Modified: trunk/reactos/ntoskrnl/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mm.c?rev=28852…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mm.c (original)
+++ trunk/reactos/ntoskrnl/mm/mm.c Tue Sep 4 22:19:59 2007
@@ -192,17 +192,6 @@
{
CPRINT("Page fault at high IRQL was %d, address %x\n",
KeGetCurrentIrql(), Address);
return(STATUS_UNSUCCESSFUL);
- }
- if (PsGetCurrentProcess() == NULL)
- {
- /* Allow this! It lets us page alloc much earlier! It won't be needed
- * after my init patch anyways
- */
- DPRINT("No current process\n");
- if (Address < (ULONG_PTR)MmSystemRangeStart)
- {
- return(STATUS_ACCESS_VIOLATION);
- }
}
/*
Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c Tue Sep 4 22:19:59 2007
@@ -77,10 +77,8 @@
{
PVOID BaseAddress;
ULONG Length;
- //ULONG ParamLength = KernelLength;
NTSTATUS Status;
PHYSICAL_ADDRESS BoundaryAddressMultiple;
- PFN_TYPE Pfn;
PMEMORY_AREA MArea;
DPRINT("MmInitVirtualMemory(%x, %x)\n",LastKernelAddress, KernelLength);
@@ -112,7 +110,7 @@
*/
MiInitPageDirectoryMap();
- BaseAddress = (PVOID)KPCR_BASE;
+ BaseAddress = (PVOID)KIP0PCRADDRESS;
MmCreateMemoryArea(MmGetKernelAddressSpace(),
MEMORY_AREA_SYSTEM,
&BaseAddress,
@@ -158,91 +156,6 @@
0,
BoundaryAddressMultiple);
-#if 0
- DPRINT1("LD Vars: %lx %lx %lx %lx %lx %lx. Last: %lx\n",
- &_image_base__,
- &_text_start__,
- &_text_end__,
- &_init_start__,
- &_init_end__,
- &_bss_end__,
- LastKernelAddress);
- BaseAddress = (PVOID)&_image_base__;
- DPRINT1("Non-LD Vars: %lx %lx %lx %lx %lx %lx. Last: %lx\n",
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- LastKernelAddress);
- Length = PAGE_ROUND_UP(((ULONG_PTR)&_text_end__)) -
(ULONG_PTR)&_image_base__;
- ParamLength = ParamLength - Length;
-
- /*
- * No need to lock the address space at this point since no
- * other threads are running.
- */
- MmCreateMemoryArea(MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- Length,
- PAGE_EXECUTE_READ,
- &MArea,
- TRUE,
- 0,
- BoundaryAddressMultiple);
-
- BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG_PTR)&_text_end__));
- ASSERT(BaseAddress == (PVOID)&_init_start__);
- Length = PAGE_ROUND_UP(((ULONG_PTR)&_init_end__)) -
- PAGE_ROUND_UP(((ULONG_PTR)&_text_end__));
- ParamLength = ParamLength - Length;
-
- MmCreateMemoryArea(MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- Length,
- PAGE_EXECUTE_READ,
- &MArea,
- TRUE,
- 0,
- BoundaryAddressMultiple);
-
- Length = PAGE_ROUND_UP(((ULONG_PTR)&_bss_end__)) -
- PAGE_ROUND_UP(((ULONG_PTR)&_init_end__));
- ParamLength = ParamLength - Length;
- DPRINT("Length %x\n",Length);
- BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG_PTR)&_init_end__));
- DPRINT("BaseAddress %x\n",BaseAddress);
-
- /*
- * No need to lock the address space at this point since we are
- * the only thread running.
- */
- MmCreateMemoryArea(MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- Length,
- PAGE_READWRITE,
- &MArea,
- TRUE,
- 0,
- BoundaryAddressMultiple);
-
- BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG_PTR)&_bss_end__));
- Length = LastKernelAddress - (ULONG_PTR)BaseAddress;
- MmCreateMemoryArea(MmGetKernelAddressSpace(),
- MEMORY_AREA_SYSTEM,
- &BaseAddress,
- Length,
- PAGE_READWRITE,
- &MArea,
- TRUE,
- 0,
- BoundaryAddressMultiple);
-#endif
-
BaseAddress = MiNonPagedPoolStart;
MmCreateMemoryArea(MmGetKernelAddressSpace(),
MEMORY_AREA_SYSTEM,
@@ -281,18 +194,7 @@
TRUE,
0,
BoundaryAddressMultiple);
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &Pfn);
- MmSharedDataPagePhysicalAddress.QuadPart = Pfn << PAGE_SHIFT;
- Status = MmCreateVirtualMapping(NULL,
- (PVOID)KI_USER_SHARED_DATA,
- PAGE_READWRITE,
- &Pfn,
- 1);
- if (!NT_SUCCESS(Status))
- {
- DbgPrint("Unable to create virtual mapping\n");
- KEBUGCHECK(0);
- }
+ MmSharedDataPagePhysicalAddress.QuadPart = 2 << PAGE_SHIFT;
RtlZeroMemory(BaseAddress, Length);
/*
Modified: trunk/reactos/ntoskrnl/ob/obinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obinit.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obinit.c (original)
+++ trunk/reactos/ntoskrnl/ob/obinit.c Tue Sep 4 22:19:59 2007
@@ -67,7 +67,7 @@
for (i = 0; i < KeNumberProcessors; i++)
{
/* Get the PRCB for this CPU */
- Prcb = ((PKPCR)(KPCR_BASE + i * PAGE_SIZE))->Prcb;
+ Prcb = ((PKPCR)(KIP0PCRADDRESS + i * PAGE_SIZE))->Prcb;
/* Set the OBJECT_CREATE_INFORMATION List */
Prcb->PPLookasideList[LookasideCreateInfoList].L = &ObpCiLookasideList.L;