Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 11-28-2006, 03:35 AM   #1
LQ Newbie
Registered: Oct 2006
Posts: 16

Rep: Reputation: 0
How to share data b/w user space and kernel space

Hi All,
I am new to kernel programmming.

I have to share some huge data structures b/w user space application and kernel module. What are all options available to be for this.

I would like to avoid the duplication of data in userspace and kernel space.

Can ,by some mean,can I acess data structures defined in user space, in my kernel module.

thanks in advance
Old 11-28-2006, 11:15 PM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177
"Huge?" That's rather an unusual thing to say about kernel memory.

Kernel-level code can access memory in userspace by any one of several mechanisms.

Perhaps if you explained in more detail what it is you are proposing to do?

Probably the most common mechanism is to set up a virtual device, which the user-side application can talk to.

Perhaps the user-side application that actually talks to the kernel device is itself a "root" (or a specific, non-root userid) daemon that is the one that's mainly responsible for providing services to other user-side applications, employing the kernel device as part of its means for doing so.

In your kernel-side code, you definitely want to avoid duplication of data .. and you must be careful not to blindly trust the addresses provided by any user-side code. Usually, the actual programming that's on the kernel side is quite small and specialized: it's on the kernel side only because it cannot be anywhere else.

Last edited by sundialsvcs; 11-28-2006 at 11:20 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
notify user space application from the kernel space lordofring Linux - Software 2 06-22-2009 01:32 PM
Communication between the Kernel- and User-Space Siva4Linux Linux - Kernel 3 11-30-2006 04:54 PM
Sending packet from Kernel to User Space kaustubh_pict Linux - Networking 0 03-06-2006 08:52 AM
User/Kernel Space Comms under Redhat 9.0 snigglyfox Programming 3 09-07-2004 06:24 AM
User Space - Kernel Space basu_arani Programming 3 05-25-2004 12:46 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration