mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
- Added a boot option for reducing the used memory size ('/maxmem=used_memory_in_mb').
svn path=/trunk/; revision=4890
This commit is contained in:
parent
2e437e9b34
commit
07dd3a3809
3 changed files with 46 additions and 7 deletions
|
@ -319,7 +319,8 @@ VOID MmInit1(ULONG FirstKernelPhysAddress,
|
|||
ULONG LastKernelPhysAddress,
|
||||
ULONG LastKernelAddress,
|
||||
PADDRESS_RANGE BIOSMemoryMap,
|
||||
ULONG AddressRangeCount);
|
||||
ULONG AddressRangeCount,
|
||||
ULONG MaxMemInMeg);
|
||||
VOID MmInit2(VOID);
|
||||
VOID MmInit3(VOID);
|
||||
NTSTATUS MmInitPagerThread(VOID);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: main.c,v 1.160 2003/06/07 16:16:39 chorns Exp $
|
||||
/* $Id: main.c,v 1.161 2003/06/14 17:46:24 hbirr Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/main.c
|
||||
|
@ -314,6 +314,8 @@ ExpInitializeExecutive(VOID)
|
|||
CHAR str[50];
|
||||
NTSTATUS Status;
|
||||
BOOLEAN SetupBoot;
|
||||
PCHAR p1, p2;
|
||||
ULONG MaxMem;
|
||||
|
||||
/*
|
||||
* Fail at runtime if someone has changed various structures without
|
||||
|
@ -343,12 +345,41 @@ ExpInitializeExecutive(VOID)
|
|||
KeLowerIrql(DISPATCH_LEVEL);
|
||||
|
||||
NtEarlyInitVdm();
|
||||
|
||||
|
||||
p1 = (PCHAR)KeLoaderBlock.CommandLine;
|
||||
|
||||
MaxMem = 0;
|
||||
while(*p1 && (p2 = strchr(p1, '/')))
|
||||
{
|
||||
p2++;
|
||||
if (!_strnicmp(p2, "MAXMEM", 6))
|
||||
{
|
||||
p2 += 6;
|
||||
while (isspace(*p2)) p2++;
|
||||
if (*p2 == '=')
|
||||
{
|
||||
p2++;
|
||||
while(isspace(*p2)) p2++;
|
||||
if (isdigit(*p2))
|
||||
{
|
||||
while (isdigit(*p2))
|
||||
{
|
||||
MaxMem = MaxMem * 10 + *p2 - '0';
|
||||
p2++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
p1 = p2;
|
||||
}
|
||||
|
||||
MmInit1(FirstKrnlPhysAddr,
|
||||
LastKrnlPhysAddr,
|
||||
LastKernelAddress,
|
||||
(PADDRESS_RANGE)&KeMemoryMap,
|
||||
KeMemoryMapRangeCount);
|
||||
KeMemoryMapRangeCount,
|
||||
MaxMem > 8 ? MaxMem : 4096);
|
||||
|
||||
/* Import ANSI code page table */
|
||||
for (i = 1; i < KeLoaderBlock.ModsCount; i++)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: mminit.c,v 1.46 2003/05/17 19:16:03 ekohl Exp $
|
||||
/* $Id: mminit.c,v 1.47 2003/06/14 17:46:24 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -209,7 +209,8 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
ULONG LastKrnlPhysAddr,
|
||||
ULONG LastKernelAddress,
|
||||
PADDRESS_RANGE BIOSMemoryMap,
|
||||
ULONG AddressRangeCount)
|
||||
ULONG AddressRangeCount,
|
||||
ULONG MaxMem)
|
||||
/*
|
||||
* FUNCTION: Initalize memory managment
|
||||
*/
|
||||
|
@ -225,7 +226,6 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
LastKrnlPhysAddr,
|
||||
LastKernelAddress);
|
||||
|
||||
MmInitGlobalKernelPageDirectory();
|
||||
|
||||
if ((BIOSMemoryMap != NULL) && (AddressRangeCount > 0))
|
||||
{
|
||||
|
@ -245,6 +245,11 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
}
|
||||
}
|
||||
|
||||
if (KeLoaderBlock.MemHigher >= (MaxMem - 1) * 1024)
|
||||
{
|
||||
KeLoaderBlock.MemHigher = (MaxMem - 1) * 1024;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: Set this based on the system command line
|
||||
*/
|
||||
|
@ -252,6 +257,8 @@ VOID MmInit1(ULONG FirstKrnlPhysAddr,
|
|||
MmUserProbeAddress = (PVOID)0x7fff0000;
|
||||
MmHighestUserAddress = (PVOID)0x7ffeffff;
|
||||
|
||||
MmInitGlobalKernelPageDirectory();
|
||||
|
||||
/*
|
||||
* Initialize memory managment statistics
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue