virtual address to physical address

Hai All,

How to get the physical memroy address that is associated witht the
virtual memroy address that has been allocated by malloc() under windows
2000.

Any information will be helpful.

Thanks and regards,
Kedar.

Hai All,

I am developing a user mode application which is used to test a hardware.
Harware needs buffers for the DMA transfers. So I need to write the
physical address in to the dma registers, memory allocated by malloc()
will be virtual address so i need to convert this to physical address.

Can you please suggest a solution to achieve this.

Thanks in advance.

Regards,
Kedar.

I didn’t see an answer to this question (apologize if this was already
answered).

MmProbeAndLockPages
The MmProbeAndLockPages routine probes specified pages, makes them
resident, and locks the physical pages mapped by the virtual address
range in memory; the MDL is updated to describe the physical pages.

VOID
MmProbeAndLockPages(
IN OUT PMDL MemoryDescriptorList,
IN KPROCESSOR_MODE AccessMode,
IN LOCK_OPERATION Operation
);

You have to lock the pages, because if you don’t, the physical address
could change due to paging actitivity. /TomH

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Tuesday, April 15, 2003 8:01 AM
To: File Systems Developers
Subject: [ntfsd] virtual address to physical address

Hai All,

How to get the physical memroy address that is associated witht the
virtual memroy address that has been allocated by malloc() under windows
2000.

Any information will be helpful.

Thanks and regards,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Ok. I just answered your prior question. However, when using DMA the
game changes a bit, because DMA’ing 4k fragments (page size fragments)
can be a big pain.

There is DMA adapter help routines in the kernel. You should have this
information if you own the DDK, which you need to in your case. Here is
an excerpt from the DDK help that talks about the DMA adapter and a list
of functions that is supports. I have omitted the call structure since
you should have this as part of your DDK. Look at these functions and
sample device drivers that support DMA.

DMA_OPERATIONS
The DMA_OPERATIONS structure provides a table of pointers to functions
that control the operation of a DMA controller.

PutDmaAdapter
Pointer to a system-defined routine to free a DMA_ADAPTER structure. For
further information, see PutDmaAdapter.
AllocateCommonBuffer
Pointer to a system-defined routine to allocate a physically contiguous
DMA buffer. For further information, see AllocateCommonBuffer.
FreeCommonBuffer
Pointer to a system-defined routine to free a physically contiguous DMA
buffer previously allocated by AllocateCommonBuffer. For further
information, see FreeCommonBuffer.
AllocateAdapterChannel
Pointer to a system-defined routine to allocate a channel for DMA
operations. For further information, see AllocateAdapterChannel.
FlushAdapterBuffers
Pointer to a system-defined routine to flush data from the system or
busmaster adapter’s internal cache after a DMA operation. For further
information, see FlushAdapterBuffers.
FreeAdapterChannel
Pointer to a system-defined routine to free a channel previously
allocated for DMA operations by AllocateAdapterChannel. For further
information, see FreeAdapterChannel.
FreeMapRegisters
Pointer to a system-defined routine to free map registers allocated for
DMA operations. For further information, see FreeMapRegisters.
MapTransfer
Pointer to a system-defined routine to begin a DMA operation. For
further information, see MapTransfer.
GetDmaAlignment
Pointer to a system-defined routine to obtain the DMA alignment
requirements of the controller. For further information, see
GetDmaAlignment.
ReadDmaCounter
Pointer to a system-defined routine to obtain the current transfer count
for a DMA operation. For further information, see ReadDmaCounter.
GetScatterGatherList
Pointer to a system-defined routine that allocates map registers and
creates a scatter/gather list for DMA. On Windows 98 and Windows Me,
this value is NULL. For further information, see GetScatterGatherList.
PutScatterGatherList
Pointer to a system-defined routine that frees map registers and a
scatter/gather list after a DMA operation is complete. On Windows 98 and
Windows ME, this value is NULL. For further information, see
PutScatterGatherList.
CalculateScatterGatherList
Pointer to a system-defined routine that determines the buffer size
needed to hold a scatter/gather list for a given buffer. This member is
only available in version 2 of DMA_OPERATIONS. For further information,
see CalculateScatterGatherList.
BuildScatterGatherList
Pointer to a system-defined routine that allocates map registers and
creates a scatter/gather list for DMA in a driver-supplied buffer. This
member is only available in version 2 of DMA_OPERATIONS. For further
information, see BuildScatterGatherList.
BuildMdlFromScatterGatherList
Pointer to a system-defined routine that builds an MDL corresponding to
a scatter/gather list. This member is only available in version 2 of
DMA_OPERATIONS. For further information, see
BuildMdlFromScatterGatherList.

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Monday, April 21, 2003 1:18 AM
To: File Systems Developers
Subject: [ntfsd] virtual address to physical address

Hai All,

I am developing a user mode application which is used to test a
hardware.
Harware needs buffers for the DMA transfers. So I need to write the
physical address in to the dma registers, memory allocated by malloc()
will be virtual address so i need to convert this to physical address.

Can you please suggest a solution to achieve this.

Thanks in advance.

Regards,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to xxxxx@lists.osr.com