LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-14-2005, 11:22 PM   #1
s_anumolu
LQ Newbie
 
Registered: May 2005
Posts: 2

Rep: Reputation: 0
How to allocate a block of 16MB in kernel space using my driver module


Hi all,
I am new to device driver programming and working on linux 2-4-20. I have tried to allcoate 16MB block in kernel space with get_free_pages(), kmalloc(), kmem_cache_create().; I am not able to allocate more than 2Mb though used the GFP_USER or with GFP_KERNEL flags. I could not do more than that , as per their limitations in allocation. Can any one please help me in this issue.
Thanks
sudheer
 
Old 07-15-2005, 12:48 AM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
yes it's very hard to get a concurrent DMA buffer larger than 128 KB at runtime
i think it's because the memory gets fragmented
you can keep digging at the same area with kmalloc(GFP_ATOMIC)
but that seems like pretty risky buisness to me
download the samples here
http://examples.oreilly.com/linuxdrive2/
and check out the folder allocator

i don't know that much about it or what you are doing but there is a driver I/O abstraction layer
struct kiobuf from <linux/iobuf.h>
you can allocate a vector of buffers
Code:
int alloc_kiovec(int nr, struct kiobuf **iovec);
it allows you to ignore the underlying vm junk
or for block devices you got the kernel file
./drivers/char/raw.c
where you really don't go through the kernel at all
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Driver module in kernel hazzyb Linux - Hardware 1 09-21-2005 02:54 PM
ATI driver kernel module bmorgan98 Mandriva 1 08-23-2005 12:32 PM
Need to allocate more space to email - Help lizard99 Linux - Software 5 04-23-2005 09:56 AM
how to know whether a driver or other module build-in kernel ? jiawj Slackware 1 04-10-2005 02:21 AM
new driver module claims to be for a different kernel build chr15t0 Linux - General 2 03-21-2004 04:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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