LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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: 294

Rep: Reputation: 23
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,857

Rep: Reputation: 161Reputation: 161
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: 294

Original Poster
Rep: Reputation: 23
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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