Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-16-2012, 06:07 AM   #1
LQ Newbie
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
pci linux driver: how to get a memory address to do a DMA Write and Read

Hi! I am new to linux drivers. I am trying to perform a DMA write and DMA read to and from the CPU main memory from the FPGA. The FPGA needs to be given the physical memory address to start its DMA write and I am confused as we have only the virtual memory available from the user space. How is the right way to go about it? Also is it possible (via a memory dump) to read the physical memory where the Write has taken place? /dev/mem is not permitted i guess?

Old 12-16-2012, 09:05 AM   #2
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,866

Rep: Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487Reputation: 1487
Basically, it is up to a kernel device driver to provide the translation. User space should never have access to DMA devices as that would bypass all security on the system.

Userspace cannot know if a memory is or is not in physical memory, nor where in physical memory a particular data page is. It may be swapped out... or shuffled around between scheduling activities that the userspace application knows about.

It is possible to get some fixed location (locking pages in memory), but besides requiring privileges to do so, there is only so much that can be done. Even then, it is limited to using a virtual address of the page.

This is also not a newbie subject. You might try the linux hardware forum, but really, your problem is in writing device drivers.

Last edited by jpollard; 12-16-2012 at 09:07 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Device driver read/write functions not running for address 0x80000000 shade963 Linux - Kernel 0 09-10-2012 11:27 AM
How to read/write physical address in Linux. VegasGod Linux - Newbie 3 05-18-2010 10:48 AM
PCI-DMA not syncing: high address but no IOMMU joe_merchant Linux - Hardware 4 09-30-2008 06:16 AM
PCI BURST READ and WRITE from LINUX host (PC ) Rick Davis Linux - General 2 02-21-2008 12:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration