Clarification needed on \Device\PhysicalMemory on Windows
<p><code>\Device\PhysicalMemory</code> is a section object, that is in Win32 API terms a memory-mapped file. Given its name it could be an MMF <em>fully</em> backed by RAM; being a one on one mapping of physical pages.</p>

<p>And that is pretty much my question: does this section object represent nonpaged <strong>physical memory</strong> or the nonpaged <strong>system address space</strong>?</p>

<p>And if it is the former, what about "holes" in physical memory? For example on PAE-enabled systems the physical memory underlying the system address space may be actually "fragmented". What happens if I were to access such holes after mapping a view into that <code>\Device\PhysicalMemory</code> section object?</p>

<p>The reason why I am confused is because the <code>MmMapIoSpace</code> function takes a <code>PHYSICAL_ADDRESS PhysicalAddress</code> parameter and maps that physical address to nonpaged system address space. Also see other memory manager functions like <code>MmAllocateContiguousMemory</code>. It seems pretty dangerous to make <em>actual</em> physical memory available and pretend it can be accessed in a contiguous fashion.</p>

<p>So clearly there's a mapping that is not necessarily one on one between nonpaged physical memory and nonpaged system address space.</p>

<p>Trying to find the above and a number of related terms in Windows Internals, 6th ed. did not yield any definite answer. Chapter 10 mostly deals with what the WDK documentation calls system address space. Therefore I am asking here.</p>

<p>Please make sure to point to authoritative sources for your answer.</p>