mirror of
https://github.com/reactos/reactos.git
synced 2024-07-18 02:16:14 +00:00
- Create a memory area for the kpcr.
- Fixed the end address for unmapping unused address space behind the kernel. - Free some unmapped pages. - Initialized the pageop and rmap implementation earlier in the startup process. svn path=/trunk/; revision=6664
This commit is contained in:
parent
6dbdc4ff63
commit
29e31c6fb0
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: mminit.c,v 1.55 2003/10/12 17:05:48 hbirr Exp $
|
/* $Id: mminit.c,v 1.56 2003/11/16 15:19:28 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top directory
|
* COPYRIGHT: See COPYING in the top directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -47,6 +47,7 @@ extern unsigned int _bss_end__;
|
||||||
static MEMORY_AREA* kernel_text_desc = NULL;
|
static MEMORY_AREA* kernel_text_desc = NULL;
|
||||||
static MEMORY_AREA* kernel_init_desc = NULL;
|
static MEMORY_AREA* kernel_init_desc = NULL;
|
||||||
static MEMORY_AREA* kernel_map_desc = NULL;
|
static MEMORY_AREA* kernel_map_desc = NULL;
|
||||||
|
static MEMORY_AREA* kernel_kpcr_desc = NULL;
|
||||||
static MEMORY_AREA* kernel_data_desc = NULL;
|
static MEMORY_AREA* kernel_data_desc = NULL;
|
||||||
static MEMORY_AREA* kernel_param_desc = NULL;
|
static MEMORY_AREA* kernel_param_desc = NULL;
|
||||||
static MEMORY_AREA* kernel_pool_desc = NULL;
|
static MEMORY_AREA* kernel_pool_desc = NULL;
|
||||||
|
@ -133,6 +134,16 @@ MmInitVirtualMemory(ULONG LastKernelAddress,
|
||||||
FALSE,
|
FALSE,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
|
BaseAddress = (PVOID)KPCR_BASE;
|
||||||
|
MmCreateMemoryArea(NULL,
|
||||||
|
MmGetKernelAddressSpace(),
|
||||||
|
MEMORY_AREA_SYSTEM,
|
||||||
|
&BaseAddress,
|
||||||
|
PAGE_SIZE * MAXIMUM_PROCESSORS,
|
||||||
|
0,
|
||||||
|
&kernel_kpcr_desc,
|
||||||
|
FALSE,
|
||||||
|
FALSE);
|
||||||
BaseAddress = (PVOID)KERNEL_BASE;
|
BaseAddress = (PVOID)KERNEL_BASE;
|
||||||
Length = PAGE_ROUND_UP(((ULONG)&_text_end__)) - KERNEL_BASE;
|
Length = PAGE_ROUND_UP(((ULONG)&_text_end__)) - KERNEL_BASE;
|
||||||
ParamLength = ParamLength - Length;
|
ParamLength = ParamLength - Length;
|
||||||
|
@ -375,17 +386,16 @@ MmInit1(ULONG FirstKrnlPhysAddr,
|
||||||
MmStats.NrTotalPages += 256;
|
MmStats.NrTotalPages += 256;
|
||||||
}
|
}
|
||||||
#ifdef BIOS_MEM_FIX
|
#ifdef BIOS_MEM_FIX
|
||||||
MmStats.NrTotalPages += 16;
|
MmStats.NrTotalPages += 16;
|
||||||
#endif
|
#endif
|
||||||
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGE_SIZE) / 1024);
|
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGE_SIZE) / 1024);
|
||||||
|
|
||||||
LastKernelAddress = (ULONG)MmInitializePageList(
|
LastKernelAddress = (ULONG)MmInitializePageList((PVOID)FirstKrnlPhysAddr,
|
||||||
(PVOID)FirstKrnlPhysAddr,
|
(PVOID)LastKrnlPhysAddr,
|
||||||
(PVOID)LastKrnlPhysAddr,
|
MmStats.NrTotalPages,
|
||||||
MmStats.NrTotalPages,
|
PAGE_ROUND_UP(LastKernelAddress),
|
||||||
PAGE_ROUND_UP(LastKernelAddress),
|
BIOSMemoryMap,
|
||||||
BIOSMemoryMap,
|
AddressRangeCount);
|
||||||
AddressRangeCount);
|
|
||||||
kernel_len = LastKrnlPhysAddr - FirstKrnlPhysAddr;
|
kernel_len = LastKrnlPhysAddr - FirstKrnlPhysAddr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -400,23 +410,21 @@ MmInit1(ULONG FirstKrnlPhysAddr,
|
||||||
MmSetPageProtect(NULL,
|
MmSetPageProtect(NULL,
|
||||||
(PVOID)i,
|
(PVOID)i,
|
||||||
PAGE_EXECUTE_READ);
|
PAGE_EXECUTE_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Invalidating between %x and %x\n",
|
DPRINT("Invalidating between %x and %x\n",
|
||||||
LastKernelAddress,
|
LastKernelAddress,
|
||||||
KERNEL_BASE + 2 * PAGE_TABLE_SIZE);
|
0xc0600000);
|
||||||
for (i=(LastKernelAddress);
|
for (i=(LastKernelAddress); i<0xc0600000; i+=PAGE_SIZE)
|
||||||
i<(KERNEL_BASE + 2 * PAGE_TABLE_SIZE);
|
|
||||||
i=i+PAGE_SIZE)
|
|
||||||
{
|
{
|
||||||
MmRawDeleteVirtualMapping((PVOID)(i));
|
MmRawDeleteVirtualMapping((PVOID)(i));
|
||||||
}
|
}
|
||||||
DPRINT("Almost done MmInit()\n");
|
DPRINT("Almost done MmInit()\n");
|
||||||
#ifndef MP
|
#ifndef MP
|
||||||
/* FIXME: This is broken in SMP mode */
|
/* FIXME: This is broken in SMP mode */
|
||||||
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me, FALSE, NULL, NULL);
|
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me, TRUE, NULL, NULL);
|
||||||
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me2, FALSE, NULL, NULL);
|
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me2, TRUE, NULL, NULL);
|
||||||
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me3, FALSE, NULL, NULL);
|
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me3, TRUE, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Intialize memory areas
|
* Intialize memory areas
|
||||||
|
@ -429,6 +437,8 @@ MmInit1(ULONG FirstKrnlPhysAddr,
|
||||||
VOID INIT_FUNCTION
|
VOID INIT_FUNCTION
|
||||||
MmInit2(VOID)
|
MmInit2(VOID)
|
||||||
{
|
{
|
||||||
|
MmInitializeRmapList();
|
||||||
|
MmInitializePageOp();
|
||||||
MmInitSectionImplementation();
|
MmInitSectionImplementation();
|
||||||
MmInitPagingFile();
|
MmInitPagingFile();
|
||||||
}
|
}
|
||||||
|
@ -445,10 +455,8 @@ MmInit3(VOID)
|
||||||
MmDeletePageTable(NULL, 0);
|
MmDeletePageTable(NULL, 0);
|
||||||
#endif
|
#endif
|
||||||
MmInitZeroPageThread();
|
MmInitZeroPageThread();
|
||||||
MmInitPagerThread();
|
|
||||||
MmCreatePhysicalMemorySection();
|
MmCreatePhysicalMemorySection();
|
||||||
MmInitializeRmapList();
|
MiInitBalancerThread();
|
||||||
MmInitializePageOp();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialise the modified page writer.
|
* Initialise the modified page writer.
|
||||||
|
|
Loading…
Reference in a new issue