MmGetPhysicalAddress help

Hi All,

How to get physical address for the given virtual address in Windows ME.
For windows 2000 there is supported function called
MmGetPhysicalAddress(), is there any equivalent function in Windows ME ddk
for this.

Thanks and regards,
Kedar.

MmGetPhysicalAddress() is supported in WinME WDM emulation layer, but you
can also use _CopyPageTable VXD service (if you’re writing some kinda VXD,
see DDK docs for details). By the way MmGetPhysicalAddress() function from
WinME uses _CopyPageTable service (see disasm for details ;-))))

----- Original Message -----
From: “kedar”
To: “Windows System Software Devs Interest List”
Sent: Monday, December 22, 2003 8:36 AM
Subject: [ntdev] MmGetPhysicalAddress help

> Hi All,
>
> How to get physical address for the given virtual address in Windows ME.
> For windows 2000 there is supported function called
> MmGetPhysicalAddress(), is there any equivalent function in Windows ME ddk
> for this.
>
> Thanks and regards,
> Kedar.
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@nival.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Hi,

I tried using MmGetPhysicalAddress() in my code but when I compiled the
code it says that MmGetPhysicalAddress() is undeclared. So I think there
is no support for this in WinME build enviroment. We tried using other
methoed you have mentoned but it is failing at the _linpageLock.

Am I correct?

Thanks and regards,
Kedar.

MmGetPhysicalAddress() is supported in WinME WDM emulation layer, but you
can also use _CopyPageTable VXD service (if you’re writing some kinda VXD,
see DDK docs for details). By the way MmGetPhysicalAddress() function from
WinME uses _CopyPageTable service (see disasm for details ;-))))

----- Original Message -----
From: “kedar”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, December 22, 2003 8:36 AM
> Subject: [ntdev] MmGetPhysicalAddress help
>
>
> > Hi All,
> >
> > How to get physical address for the given virtual address in Windows ME.
> > For windows 2000 there is supported function called
> > MmGetPhysicalAddress(), is there any equivalent function in Windows ME ddk
> > for this.
> >
> > Thanks and regards,
> > Kedar.
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@nival.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >

Yes, in Win2K DDK this function is not declared in WDM.H, but it is declared
in NTDDK.H and imported thru NTOSKRNL.LIB import library.

Very strange but I have no clue why using _CopyPageTable service is failed.
The following code (something like in WinME NTKERN.VXD module) shows how to
get a physical address:

;; BaseAddress - virtual address for which to return the physical address
;; pte - temporary variable

mov eax,[BaseAddress]
lea edx,[pte]
shr eax,12
VMMCall _CopyPageTable,
or eax,eax
jz SHORT _CopyPageTableFailed

mov eax,[BaseAddress]
and eax,00000FFFh
mov edx,[pte]
and edx,0FFFFF000h
or eax,edx
sub edx,edx

On return EDX:EAX pair contains a physical address value (of type
PHYSICAL_ADDRESS aka LARGE_INTEGER)

----- Original Message -----
From: “kedar”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, December 23, 2003 2:43 PM
Subject: [ntdev] Re: MmGetPhysicalAddress help

> Hi,
>
> I tried using MmGetPhysicalAddress() in my code but when I compiled the
> code it says that MmGetPhysicalAddress() is undeclared. So I think there
> is no support for this in WinME build enviroment. We tried using other
> methoed you have mentoned but it is failing at the _linpageLock.
>
> Am I correct?
>
> Thanks and regards,
> Kedar.
>
> > MmGetPhysicalAddress() is supported in WinME WDM emulation layer, but
you
> > can also use _CopyPageTable VXD service (if you’re writing some kinda
VXD,
> > see DDK docs for details). By the way MmGetPhysicalAddress() function
from
> > WinME uses _CopyPageTable service (see disasm for details ;-))))
> >
> > ----- Original Message -----
> > From: “kedar”
> > To: “Windows System Software Devs Interest List”
> > Sent: Monday, December 22, 2003 8:36 AM
> > Subject: [ntdev] MmGetPhysicalAddress help
> >
> >
> > > Hi All,
> > >
> > > How to get physical address for the given virtual address in Windows
ME.
> > > For windows 2000 there is supported function called
> > > MmGetPhysicalAddress(), is there any equivalent function in Windows ME
ddk
> > > for this.
> > >
> > > Thanks and regards,
> > > Kedar.
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@nival.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@nival.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

why are you trying to get the physical address for the page? If you’re
planning on doing a DMA transfer into it, you shoudl use the DMA API
(MapTransfer or GetScatterGather) so the HAL can do any necessary double
buffering for you.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of kedar
Sent: Tuesday, December 23, 2003 3:43 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: MmGetPhysicalAddress help

Hi,

I tried using MmGetPhysicalAddress() in my code but when I compiled the
code it says that MmGetPhysicalAddress() is undeclared. So I think there
is no support for this in WinME build enviroment. We tried using other
methoed you have mentoned but it is failing at the _linpageLock.

Am I correct?

Thanks and regards,
Kedar.

MmGetPhysicalAddress() is supported in WinME WDM emulation layer, but
you can also use _CopyPageTable VXD service (if you’re writing some
kinda VXD, see DDK docs for details). By the way
MmGetPhysicalAddress() function from WinME uses _CopyPageTable service

(see disasm for details ;-))))

----- Original Message -----
From: “kedar”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, December 22, 2003 8:36 AM
> Subject: [ntdev] MmGetPhysicalAddress help
>
>
> > Hi All,
> >
> > How to get physical address for the given virtual address in Windows
ME.
> > For windows 2000 there is supported function called
> > MmGetPhysicalAddress(), is there any equivalent function in Windows
> > ME ddk for this.
> >
> > Thanks and regards,
> > Kedar.
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@nival.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Hi,

Thanks a lot. Its working now.

Regards,
Kedar.

Yes, in Win2K DDK this function is not declared in WDM.H, but it is declared
in NTDDK.H and imported thru NTOSKRNL.LIB import library.

Very strange but I have no clue why using _CopyPageTable service is failed.
The following code (something like in WinME NTKERN.VXD module) shows how to
get a physical address:

;; BaseAddress - virtual address for which to return the physical address
;; pte - temporary variable

mov eax,[BaseAddress]
lea edx,[pte]
shr eax,12
VMMCall _CopyPageTable,
> or eax,eax
> jz SHORT _CopyPageTableFailed
>
> mov eax,[BaseAddress]
> and eax,00000FFFh
> mov edx,[pte]
> and edx,0FFFFF000h
> or eax,edx
> sub edx,edx
>
> On return EDX:EAX pair contains a physical address value (of type
> PHYSICAL_ADDRESS aka LARGE_INTEGER)
>
>
> ----- Original Message -----
> From: “kedar”
> To: “Windows System Software Devs Interest List”
> Sent: Tuesday, December 23, 2003 2:43 PM
> Subject: [ntdev] Re: MmGetPhysicalAddress help
>
>
> > Hi,
> >
> > I tried using MmGetPhysicalAddress() in my code but when I compiled the
> > code it says that MmGetPhysicalAddress() is undeclared. So I think there
> > is no support for this in WinME build enviroment. We tried using other
> > methoed you have mentoned but it is failing at the _linpageLock.
> >
> > Am I correct?
> >
> > Thanks and regards,
> > Kedar.
> >
> > > MmGetPhysicalAddress() is supported in WinME WDM emulation layer, but
> you
> > > can also use _CopyPageTable VXD service (if you’re writing some kinda
> VXD,
> > > see DDK docs for details). By the way MmGetPhysicalAddress() function
> from
> > > WinME uses _CopyPageTable service (see disasm for details ;-))))
> > >
> > > ----- Original Message -----
> > > From: “kedar”
> > > To: “Windows System Software Devs Interest List”
> > > Sent: Monday, December 22, 2003 8:36 AM
> > > Subject: [ntdev] MmGetPhysicalAddress help
> > >
> > >
> > > > Hi All,
> > > >
> > > > How to get physical address for the given virtual address in Windows
> ME.
> > > > For windows 2000 there is supported function called
> > > > MmGetPhysicalAddress(), is there any equivalent function in Windows ME
> ddk
> > > > for this.
> > > >
> > > > Thanks and regards,
> > > > Kedar.
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: xxxxx@nival.com
> > > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@nival.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >