mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 07:56:59 +00:00
[FREELDR]
Fix/improve range check. CORE-8995 #resolve CORE-8997 #resolve svn path=/trunk/; revision=66091
This commit is contained in:
parent
890e37805d
commit
e7d852bc11
2 changed files with 7 additions and 6 deletions
|
@ -203,7 +203,7 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi
|
|||
REGS Regs;
|
||||
ULONGLONG RealBaseAddress, EndAddress, RealSize;
|
||||
TYPE_OF_MEMORY MemoryType;
|
||||
ULONG Size;
|
||||
ULONG Size, RequiredSize;
|
||||
ASSERT(PcBiosMapCount == 0);
|
||||
|
||||
TRACE("GetBiosMemoryMap()\n");
|
||||
|
@ -212,18 +212,19 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi
|
|||
bit value at address 0x413 inside the BDA, which gives us the usable size
|
||||
in KB */
|
||||
Size = (*(PUSHORT)(ULONG_PTR)0x413) * 1024;
|
||||
if (Size < MEMORY_MARGIN)
|
||||
RequiredSize = FREELDR_BASE + FrLdrImageSize + PAGE_SIZE;
|
||||
if (Size < RequiredSize)
|
||||
{
|
||||
FrLdrBugCheckWithMessage(
|
||||
MEMORY_INIT_FAILURE,
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"The BIOS reported a usable memory range up to 0x%x, which is too small!\n\n"
|
||||
"The BIOS reported a usable memory range up to 0x%x, which is too small!\n"
|
||||
"Required size is 0x%x\n\n"
|
||||
"If you see this, please report to the ReactOS team!",
|
||||
Size);
|
||||
Size, RequiredSize);
|
||||
}
|
||||
|
||||
|
||||
/* Int 15h AX=E820h
|
||||
* Newer BIOSes - GET SYSTEM MEMORY MAP
|
||||
*
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#define STACKADDR HEX(F000) /* The 32/64-bit stack top will be at 0000:F000, or 0xF000 */
|
||||
#define FREELDR_BASE HEX(F800)
|
||||
#define FREELDR_PE_BASE HEX(10000)
|
||||
#define MEMORY_MARGIN HEX(90000) /* We need this much memory */
|
||||
#define MEMORY_MARGIN HEX(88000) /* We need this much memory */
|
||||
|
||||
#define BIOSCALLBUFSEGMENT (BIOSCALLBUFFER/16) /* Buffer to store temporary data for any Int386() call */
|
||||
#define BIOSCALLBUFOFFSET HEX(0000) /* Buffer to store temporary data for any Int386() call */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue