LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-16-2012, 05:07 AM   #1
ice61
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?

thanks!
ice61
 
Old 12-16-2012, 08:05 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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 08:07 AM.
 
  


Reply



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 10:27 AM
How to read/write physical address in Linux. VegasGod Linux - Newbie 3 05-18-2010 09:48 AM
PCI-DMA not syncing: high address but no IOMMU joe_merchant Linux - Hardware 4 09-30-2008 05:16 AM
PCI BURST READ and WRITE from LINUX host (PC ) Rick Davis Linux - General 2 02-21-2008 11:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:49 AM.

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