how to find the max physical address on running OS from Kernel mode

Hi

How can I find the max physical address on running OS from Kernel mode?
Is there any equivalent api like GetPhysicallyInstalledSystemMemory?

Thanks.

Are you thinking the highest RAM address or do device physical addresses count. I was just chatting with someone who asked if they could have a terabyte non-volatile storage device addressable on the PCIe bus. I told them mapping it to virtual addresses might be a problem, but the physical addresses on the bus are determined by the hardware not the OS. There are a number of interesting NVRAM technologies in the pipeline, and in 10 years we might look back on what a silly concept storage controllers and storage I/O requests were.

Hypervisors also sometimes do identity mapping of the physical address of a VM, so a VM might be told the available physical address range starts at 102 gigabytes and goes to 108 gigabytes. This way if you want to pass a PCI(e) device into the VM, the physical address it uses to program the device is correct, with no other translation. Identity mapping has a number of downsides, like really inflexible memory allocation policies. It makes live VM migration impossible if the physical address range of the source and destination don’t match.

How is it useful to know the maximum physical address?

Jan

On 2/16/16, 11:24 PM, “xxxxx@lists.osr.com on behalf of xxxxx@gmail.com” wrote:

>Hi
>
>How can I find the max physical address on running OS from Kernel mode?
>Is there any equivalent api like GetPhysicallyInstalledSystemMemory?
>
>Thanks.

MmGetPhysicalMemoryRanges

Undocumented but still in the WDK headers.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi
>
> How can I find the max physical address on running OS from Kernel mode?
> Is there any equivalent api like GetPhysicallyInstalledSystemMemory?
>
> Thanks.
>

xxxxx@gmail.com wrote:

How can I find the max physical address on running OS from Kernel mode?
Is there any equivalent api like GetPhysicallyInstalledSystemMemory?

Just to be pedantic, allow me to point out that your RAM is not
necessarily the largest physical address on the machine. You might have
I/O devices mapped beyond that point.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank you for the replies.

Is there any api to know the RAM size only.

You have not said why you think you need this, and which versions of Windows
do you want it for. There are ways that have worked on some older systems,
but I am not sure work with Windows 10.

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Wednesday, February 17, 2016 8:29 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] how to find the max physical address on running OS from
Kernel mode

Thank you for the replies.

Is there any api to know the RAM size only.


NTDEV is sponsored by OSR

Visit the list online at:
http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software
drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at
http:</http:></http:></http:>

> do you want it for. There are ways that have worked on some older systems,

but I am not sure work with Windows 10.

MmQuerySystemSize is still documented and not deprecated


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

>MmQuerySystemSize is still documented and not deprecated

That returns MmLargeSystem always (that is if there is more than 32MB of
RAM). Or that is what it used to do.

//Daniel