LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-01-2013, 09:04 AM   #1
Rezo
LQ Newbie
 
Registered: Jun 2013
Posts: 11

Rep: Reputation: Disabled
Allocating memory with "get_free_pages(flag,order)"


Good day to everyone,
sorry for my english
i'am new to linux, linux kernel and so on,

i'am trying to understand how to allocate physically contiguous up to 2 MB, but dont understand how to use "get_free_pages" function to allocate it, if anyoane has an example, or know how to use it, or maybe some other functions, please reply. I'am trying to use it for DMA.

thanx for replying
 
Old 07-01-2013, 11:50 PM   #2
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware, Debian, Gentoo, FreeBSD, OpenBSD
Posts: 208

Rep: Reputation: 41
First up, I've never written a device driver. However, the documentation at http://kernelnewbies.org/KernelMemoryAllocation seems to indicate you should not be using get_free_pages(), but instead the DMA memory routines. See the section titled DMA at the bottom of the page.

Also the DMA API docs at https://www.kernel.org/doc/Documentation/DMA-API.txt mention you should not be using get_free_pages.
 
Old 07-02-2013, 03:26 AM   #3
Rezo
LQ Newbie
 
Registered: Jun 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
thanx for replying padeen,

I already write a basic driver, now i'am trying wo work with DMA, and reading some documentation i just saw this function, but it's seems that nobody use it. there are many documentation on DMA, but when it comes tu use it its very complicated , like trying to crack a password without passcracker.
 
Old 11-21-2013, 05:12 AM   #4
Rezo
LQ Newbie
 
Registered: Jun 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
found more useful:
kmalloc - for allocating memory up to 128 KB
and
vmalloc - for big area memory
 
  


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
difference between "Memory" & "Good Memory" in AIX nagendrar AIX 2 12-18-2009 07:05 PM
"ext3_new_block: Allocating block in system zone" from RAID5 device tan_ce Linux - Server 3 11-25-2008 06:37 AM
Measure "CPU load" and "memory consumption" of a process DaneelGiskard Programming 3 08-30-2007 11:43 AM
FSCK.EXT3 "error allocating inode bitmap" arfon Linux - Software 6 05-15-2006 10:48 AM
Allocating free disk space - start of "/ " needs moving. ibex Linux - General 4 04-17-2006 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:29 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