Accessing physical memory

Hi,

When I call StorPortGetScatterGatherList(pDevExt, srb); in driver, the Sg list had only one element with physical address = 0xbd8e0000.

But when i try to look the memory at this address(0xbd8e0000) it shows the following error:
Unable to retrieve information, Win32 error 0n30. The system cannot read from the specified device.

The debugger displays the memory at address = 0x0bd8e000.

But how can i see the memory at address = 0xbd8e0000?

Thanks

Any help on this please

How are you mapping the physical (logical) address to a virtual address?

Sent from my iPhone

On 19/05/2011, at 20:03, “xxxxx@gmail.com” wrote:

> Hi,
>
> When I call StorPortGetScatterGatherList(pDevExt, srb); in driver, the Sg list had only one element with physical address = 0xbd8e0000.
>
> But when i try to look the memory at this address(0xbd8e0000) it shows the following error:
> Unable to retrieve information, Win32 error 0n30. The system cannot read from the specified device.
>
> The debugger displays the memory at address = 0x0bd8e000.
>
> But how can i see the memory at address = 0xbd8e0000?
>
> Thanks
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I am not mapping the memory. I am just trying to view the memory in the debugger with “View memory” option and setting the options to view physical memory.

So you think “we” sit here, breathlessly waiting for “amogha” to ask a question? Let me ask you what you have done on your own to debunk your own problem, or have you been sitting there wringing your hands and wailing as the seconds ticked by and you didn’t have your answer because the lazy recalcitrant minions on NtDev were drinking coffee and wasting time? Let me go cut your question to here so I don’t have to flip back and forth, which is something you should have done.

I suspect the BD8E memory is what you get for your memory buffer AFTER it has been passed through StorPorts mapping and SG List functions. You have the a buffer pointer in the SRB that you can use that to reference that memory as it is mapped into your driver. But why does your miniport driver need anything from the contents of a data buffer? Given you’re using direct IO, you can pass control information outside of the data buffer in the INPUT BUFFER.

Gary G. Little

----- Your post from 5:02 AM: -----

"When I call StorPortGetScatterGatherList(pDevExt, srb); in driver, the Sg list had only one element with physical address = 0xbd8e0000.

But when i try to look the memory at this address(0xbd8e0000) it shows the following error:
Unable to retrieve information, Win32 error 0n30. The system cannot read from the specified device.

The debugger displays the memory at address = 0x0bd8e000.

But how can i see the memory at address = 0xbd8e0000?"

----- Second Message ~ 2 hours later -----
From: “amogha bv”
To: “Windows System Software Devs Interest List”
Sent: Thursday, May 19, 2011 6:51:19 AM
Subject: RE:[ntdev] Accessing physical memory

Any help on this please


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

If all you want to do is dump the data buffer from WinDbg, then use the buffer pointer in the SRB. That should provide a memory pointer you can use to dump memory in WinDbg. You can also dig out the IRPs MDL.

I’d also suggest you spend some time reading the documentation for WinDbg. All of this is described there.

Gary G. Little

----- Original Message -----
From: “amogha bv”
To: “Windows System Software Devs Interest List”
Sent: Thursday, May 19, 2011 7:04:19 AM
Subject: RE:[ntdev] Accessing physical memory

I am not mapping the memory. I am just trying to view the memory in the debugger with “View memory” option and setting the options to view physical memory.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Gary,

I am sorry if you feel that i had asked a silly question.

I asked this for the case of read/write command. In HW_INITIALIZATION_DATA, MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS .

Also i wanted to confirm whether from the device , the data is written in to the host memory or not.

Thanks

Use !dd command to inspect memory by its physical address.

srb->DataBuffer doesn’t always point to actual virtual address. In some cases, it’s an address relative to MDL’s VirtualAddress.

No indication was given of you asking a silly question. Showing impatience because your wait exceeded 2 hours was silly.

The real point is that there are several ways of using memory dump in WinDbg to display various types of memory. All of them are documented in WinDbg help which you should have been perusing during that 2 hour wait. There is also several ways of getting to the buffer from objects available when you hit a breakpoint in your mini-port driver.

Gary G. Little
C 952-454-4629
H 952-223-1349

On May 19, 2011, at 8:14, xxxxx@gmail.com wrote:

Hi Gary,

I am sorry if you feel that i had asked a silly question.

I asked this for the case of read/write command. In HW_INITIALIZATION_DATA, MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS .

Also i wanted to confirm whether from the device , the data is written in to the host memory or not.

Thanks


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@gmail.com wrote:

When I call StorPortGetScatterGatherList(pDevExt, srb); in driver, the Sg list had only one element with physical address = 0xbd8e0000.

But when i try to look the memory at this address(0xbd8e0000) it shows the following error:
Unable to retrieve information, Win32 error 0n30. The system cannot read from the specified device.

The debugger displays the memory at address = 0x0bd8e000.

But how can i see the memory at address = 0xbd8e0000?

Do you know the difference between a virtual address and a physical address?

Any help on this please

You need to be patient. This is not a paid support forum. You posted
your question in the middle of the night in the US, which is still where
the majority of list members reside.


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