LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 11-23-2010, 08:19 AM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 119

Rep: Reputation: 15
Allocating 16MB of kernel space _get_free_pages


Hello,

I tried to call _get_free_pages (GFP_KERNEL,12) in order to allocate 16MB of continuous kernel memory.

I do it only once when the user tries to open the device.

The call returns 0. So the allocation fails.

How can I allocate 16MB in the kernel ?

According to chapter 8 in the Device Driver book (page 222): "The maximum allowed value for order is 10 or 11(corresponding to 1024 or 2048 pages), depending on the architecture.


Thanks.
 
Old 11-23-2010, 02:34 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,028

Rep: Reputation: 75
You can reserve the kind of big memory at boot time.
 
Old 11-23-2010, 03:40 PM   #3
zvivered
Member
 
Registered: Sep 2007
Posts: 119

Original Poster
Rep: Reputation: 15
Is this the only way ?

Quote:
Originally Posted by nini09 View Post
You can reserve the kind of big memory at boot time.
Thank you for your reply.

According to DD3,chapter-8:

Allocating memory at boot time is a “dirty” technique, because it bypasses all memory management policies by reserving a private memory pool. This technique is inelegant and inflexible, but it is also the least prone to failure. Needless to say, a module can’t allocate memory at boot time; only drivers directly linked to the kernel can do that.

Is this the way a video adapter driver allocates memory ?

Thanks.
 
  


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
How to allocate a block of 16MB in kernel space using my driver module s_anumolu Linux - General 1 07-15-2005 12:48 AM
Allocating hard drive space Armon Linux - General 4 05-05-2005 08:26 PM
Need Help Allocating Space on my HD to install linux! chrishikel Linux - Newbie 6 09-10-2004 02:55 PM
allocating space for new partition ranger12002 Linux - General 12 07-20-2003 03:07 PM
allocating space and a couple other things Cheese Linux - Software 2 12-09-2001 03:55 PM


All times are GMT -5. The time now is 10:14 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration