LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-20-2014, 08:48 PM   #1
ManteoBob
LQ Newbie
 
Registered: Jan 2014
Posts: 2

Rep: Reputation: Disabled
Advice on how to map very large buffers & obtain addresses for processor and dma


I am a new to linux and would like to use linux in a data acquisition application. I would like to have a very large buffer area that is filled directly by the d/a dma controller. Once the buffer is full, the acquisition is over and the application will write the data to disk. If done properly, I would think that the processor would be near idle w/ the dma controllers for the d/a & disk doing most of the work.

I think I would like to reserve a pile of (high?) memory and map them via hugetlbs via parameters to the linux load line. This should allow the application to efficiently access this area (?). I have access to the d/a driver and expect I should be able to convert the virtual address from the application to something useful for the dma hardware. It is unclear to me if virt_to_phys() is appropriate.

Comments & suggestions on how implement this is greatly appreciated.
 
Old 01-21-2014, 04:28 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,759

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Can your dma controller handle scatter-gather lists? If so, then just allocate huge pages, push them into an sg list and call dma_map_sg to map the phys addr. If not, then you need to allocate contiguous physical memory. You can create huge pages with sysctl shortly after boot (before memory is fragmented), you don't need to do it on the kernel command line.

https://www.kernel.org/doc/Documenta...-API-HOWTO.txt
http://www.linuxjournal.com/node/7104/print
 
Old 01-21-2014, 05:01 PM   #3
ManteoBob
LQ Newbie
 
Registered: Jan 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
I now have a direction and lots to read before the next question. Thanks for the quick reply smallpond!
 
  


Reply


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] how to map local addresses to FQDN addresses with postfix sneakyimp Linux - Server 5 08-04-2011 03:18 PM
Memory Mapping DMA Buffers in User Space ramukaka Linux - Kernel 6 08-08-2010 04:02 PM
How map the IP Addresses anupverma Linux - Networking 0 07-08-2004 08:11 AM
Suse 8.2 change my DMA setting on my DVD-R drive to off & IDE DMA MODE NOT SHOWING IT maximalred Linux - General 0 08-23-2003 04:58 AM
short on DMA buffers pgcbiz Linux - General 1 08-01-2002 02:10 PM


All times are GMT -5. The time now is 12:03 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration