Accessing Physical memory from storport driver

Hi,
I have a physical address of the memory and needs to write a specific value for the storport driver. Tried with the below commands:
physicalAdd = (ULONG)0xFEFFC000;
storPhysicalAdd = StorPortConvertUlongToPhysicalAddress(physicalAdd);
pVirtaulAdd = StorPortGetVirtualAddress(DeviceExtension, storPhysicalAdd);
*((unsigned int*)pVirtaulAdd) = 0x14;
The return value of the API StorPortGetVirtualAddress is coming as NULL.

Am i missing any step which is required, i feel the physical memory is not mapped so returning Null pointer. Please help me how can i write the values on the physical memory from the storport driver.

Thanks

You don’t map arbitrary physical addresses in a StorPort miniport. Where did
you get this address from?

-scott
OSR
@OSRDrivers

wrote in message news:xxxxx@ntdev…

Hi,
I have a physical address of the memory and needs to write a specific value
for the storport driver. Tried with the below commands:
physicalAdd = (ULONG)0xFEFFC000;
storPhysicalAdd = StorPortConvertUlongToPhysicalAddress(physicalAdd);
pVirtaulAdd = StorPortGetVirtualAddress(DeviceExtension, storPhysicalAdd);
*((unsigned int*)pVirtaulAdd) = 0x14;
The return value of the API StorPortGetVirtualAddress is coming as NULL.

Am i missing any step which is required, i feel the physical memory is not
mapped so returning Null pointer. Please help me how can i write the values
on the physical memory from the storport driver.

Thanks

Hello Scott,

There was a request from hardware team team to fix some hardware issue
related with SATA controller…

They asked us to modify some contents of physical memory…

Jagadish.h

On Friday, 14 October 2016, Scott Noone wrote:

> You don’t map arbitrary physical addresses in a StorPort miniport. Where
> did you get this address from?
>
> -scott
> OSR
> @OSRDrivers
>
> wrote in message news:xxxxx@ntdev…
>
> Hi,
> I have a physical address of the memory and needs to write a specific
> value for the storport driver. Tried with the below commands:
> physicalAdd = (ULONG)0xFEFFC000;
> storPhysicalAdd = StorPortConvertUlongToPhysicalAddress(physicalAdd);
> pVirtaulAdd = StorPortGetVirtualAddress(DeviceExtension, storPhysicalAdd);
> ((unsigned int)pVirtaulAdd) = 0x14;
> The return value of the API StorPortGetVirtualAddress is coming as NULL.
>
> Am i missing any step which is required, i feel the physical memory is not
> mapped so returning Null pointer. Please help me how can i write the values
> on the physical memory from the storport driver.
>
> Thanks
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> lists.cfm?list=ntdev>
>
> 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://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

Did they ask you to write a device register, or modify some arbitrary physical memory?