Shared buffer between user and kernel space
I need a shared buffer between user and kernel space. I read that one way is to allocated buffer in kernel and then call mmap from the user space. I searched for an example but couldn't find something useful. If you know, could you please send me any links or sample code that does this.... Thank you...
Creating a shared memory region...
Where in the kernel are you sharing this memory?
If it's in a kernel module then you can search on my name in this forum and you will find at least one example of how I've done this before. Essentially I had a kernel module ethernet driver that I added character driver attributes to and then I could use the mmap() function in user space and in kernel space to setup shared memory. If you are trying to share with the kernel this is the way to go.
You may have to create a dummy module that does nothing but setup the shared memory area if you are targeting some kernel internal buffer.
Hope this helps!!