mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:26:17 +00:00
- Implement one more hack to obtain LaskKrnlPhysAddr (not really a solution for reactos, since ntldr allows kernel+drivers+hal to not be continuous in memory), when booting via ntldr/winldr.
svn path=/trunk/; revision=32216
This commit is contained in:
parent
822f692add
commit
62b9a5ba19
1 changed files with 24 additions and 1 deletions
|
@ -319,8 +319,31 @@ MmInit1(ULONG_PTR FirstKrnlPhysAddr,
|
||||||
|
|
||||||
/* Get the addresses */
|
/* Get the addresses */
|
||||||
FirstKrnlPhysAddr = (ULONG_PTR)LdrEntry->DllBase - KSEG0_BASE;
|
FirstKrnlPhysAddr = (ULONG_PTR)LdrEntry->DllBase - KSEG0_BASE;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: How do we get the last address? */
|
/* Get the last kernel address */
|
||||||
|
if (!LastKrnlPhysAddr)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY NextEntry;
|
||||||
|
PMEMORY_ALLOCATION_DESCRIPTOR Md;
|
||||||
|
|
||||||
|
for (NextEntry = KeLoaderBlock->MemoryDescriptorListHead.Flink;
|
||||||
|
NextEntry != &KeLoaderBlock->MemoryDescriptorListHead;
|
||||||
|
NextEntry = NextEntry->Flink)
|
||||||
|
{
|
||||||
|
Md = CONTAINING_RECORD(NextEntry, MEMORY_ALLOCATION_DESCRIPTOR, ListEntry);
|
||||||
|
if (Md->MemoryType == LoaderBootDriver ||
|
||||||
|
Md->MemoryType == LoaderSystemCode ||
|
||||||
|
Md->MemoryType == LoaderHalCode)
|
||||||
|
{
|
||||||
|
if (Md->BasePage+Md->PageCount > LastKrnlPhysAddr)
|
||||||
|
LastKrnlPhysAddr = Md->BasePage+Md->PageCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert to a physical address */
|
||||||
|
LastKrnlPhysAddr = LastKrnlPhysAddr << PAGE_SHIFT;
|
||||||
|
LastKernelAddress = LastKrnlPhysAddr | KSEG0_BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set memory limits */
|
/* Set memory limits */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue