RTEMS virtual address to physical address on i386

Daron Chabot daron at nucleus.usask.ca
Wed Jun 21 17:16:19 UTC 2006

On 21-Jun-06, at 11:10 AM, Yan Luo wrote:

> Hello,
> I am trying to initiate DMA transfer on i386. I use bus master IDE
> controller to transfer a block of data from hard disk to memory. To  
> do that,
> I need to set up the Physical Region Descriptor(PRD) table, in  
> which the
> memory region physical base address and byte count are specified. I  
> wonder
> how to translate the virtual address of a buffer to "physical  
> address".
> Specifically, if I have "buffer =3D (uint8_t *)malloc(some_size)", is
> "buffer" a virtual address? If it is, how do I translate it to  
> physical
> address that
> can be used for DMA? I know Linux has something like virt_to_phy() or
> pci_allocate_consistent(), does RTEMS have similar APIs?
> Please advise. Thank you.
> Yan

On the 386 BSP, all addresses are physical. Kernel and user  
applications run at the same privilege level (i.e. 0).

And no, there is no DMA API like linux's pci_alloc_consistent().


-- dc

More information about the users mailing list