Results 1 to 6 of 6
Hi all,
I have a very basic question, please help
Can anyone direct me the code example of mapping allocated memory at the Kernel to user space (using dma_malloc_* or ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-25-2009 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 7
Map allocated kernel memory to user space
Hi all,
I have a very basic question, please help
Can anyone direct me the code example of mapping allocated memory at the Kernel to user space (using dma_malloc_* or even kmalloc)
Best regards
Dudi
- 02-27-2009 #2Just Joined!
- Join Date
- Jan 2009
- Location
- Bangalore
- Posts
- 15
Map allocated kernel memory to user space
Hi,
you can use copy_to_user from kernel to user
or copy_from_user from user to kernel
- 02-27-2009 #3
Try this link:
Linux-Kernel: dmaable memory in user space
Is this what your after?
- 02-27-2009 #4Just Joined!
- Join Date
- Oct 2008
- Posts
- 7
Thank you, gerard4143.
actually it answer partly to my question (the code at the link is a question by itself and has a bug) I need a code which is working the way that allocating coherent of dma'ble memory is done at the kernel and mmap to user space with no bugs. (the user space is only ask for the amout of the memory by bytes and the kernel allocate it inside the kernel)
- 02-27-2009 #5
So your trying to allocate kernel memory and have it available to user processes by mapping it into the user process...i.e. your trying to share memory freely between the kernel and user processes...is this close to what you want...Gerard4143
- 02-28-2009 #6Just Joined!
- Join Date
- Oct 2008
- Posts
- 7
Hi gerard4143,
That's right I'm trying to get COHERENT physical memory allocated at the Kernel since the hardware I use need it. Yet it is not important to me to share is not important, I only run on user space process to access this memory


Reply With Quote
