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 01-20-2014, 09:48 PM   #1
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, 05:28 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,848

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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.
Old 01-21-2014, 06:01 PM   #3
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!


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 04:18 PM
Memory Mapping DMA Buffers in User Space ramukaka Linux - Kernel 6 08-08-2010 05:02 PM
How map the IP Addresses anupverma Linux - Networking 0 07-08-2004 09: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 05:58 AM
short on DMA buffers pgcbiz Linux - General 1 08-01-2002 03:10 PM > Forums > Linux Forums > Linux - Newbie

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

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