[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocate userspace memory



Hi...


I'm writing pseudo chardev and i need to pass some structure to userspace. It includes strings and pointers to other structures. I need to allocate userspace memory chunks and pass pointers to in into userspace process where it can be used. Is there any chance to do it?
I think technically it is possible. Although I don't know the exact how-to, it can be done by kmalloc(GFP_USER), and then creating proper VMA (or insert the page to a VMA).

However, I suggest another way. Pre allocate a chunk of memory, then via interface such as /proc, pass the address to the related kernel function. Let your kernel function acknowledge this address and pass information to it.

What do you think?

regards,

Mulyadi


-- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ