Hi there,
I'm starting developing a very simple Windows CE 5.0 driver in the
Platform Builder 5.0.

My first question is: how can i get a physical address from a logical
address (passed to the driver as pointer to a buffer)?
Where can I get some more exhaustive documentation about these kind of
task?

Thanks a lot in advance!

PS: Excuse me for my maybe-trivial questions, I'm quite new in driver
programming.

Re: Logical Address To Physical Address by Valter

Valter
Mon May 15 04:57:10 CDT 2006

"onof" <onofrio.panzarino@gmail.com> wrote in
news:1147684013.002393.309600@j73g2000cwa.googlegroups.com:

> Hi there,
> I'm starting developing a very simple Windows CE 5.0 driver in the
> Platform Builder 5.0.
>
> My first question is: how can i get a physical address from a
> logical address (passed to the driver as pointer to a buffer)?
> Where can I get some more exhaustive documentation about these
> kind of task?
>
> Thanks a lot in advance!
>
> PS: Excuse me for my maybe-trivial questions, I'm quite new in
> driver programming.
>

If you need to do that inside your OAL (ex: in the ISR) you may use
OALVAtoPA.

If you need to allocate a buffer for which you need to know both the
virtual and the physical address is better to use
HalAllocateCommonBuffer instead of allocating a block of memory in
the usual way.
If you allocate a buffer using malloc or new that is greater than
your MMU page size (4Kb for ARM processors), the system will allocate
the pages needed to fullfill your request and map them in contiguous
virtual address but nothing grants that they are also contiguous
physical addresses. If you convert the first address of your memory
block to a physical address and pass it, for example, to a peripheral
device with DMA capabilities, you may risk that the device will fill
the first page and the start to fill the next _physical_ page,
corrupting other processes' data.

--
Valter Minute
(the reply address of this message is invalid)
(l'indirizzo di reply di questo messaggio non è valido)

Re: Logical Address To Physical Address by writetothiru

writetothiru
Mon May 15 09:13:51 CDT 2006

Hi,
You need to use LockPages OS API to obtain physical address
corresponding to a virtual address.

A. Thirupathi Reddy


onof wrote:
> Hi there,
> I'm starting developing a very simple Windows CE 5.0 driver in the
> Platform Builder 5.0.
>
> My first question is: how can i get a physical address from a logical
> address (passed to the driver as pointer to a buffer)?
> Where can I get some more exhaustive documentation about these kind of
> task?
>
> Thanks a lot in advance!
>
> PS: Excuse me for my maybe-trivial questions, I'm quite new in driver
> programming.