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

Notices

Reply
 
Search this Thread
Old 11-28-2006, 02:35 AM   #1
nandac
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
nandac
 
Old 11-28-2006, 10:15 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,401

Rep: Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120
"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 10:20 PM.
 
  


Reply


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 12:32 PM
Communication between the Kernel- and User-Space Siva4Linux Linux - Kernel 3 11-30-2006 03:54 PM
Sending packet from Kernel to User Space kaustubh_pict Linux - Networking 0 03-06-2006 07:52 AM
User/Kernel Space Comms under Redhat 9.0 snigglyfox Programming 3 09-07-2004 05:24 AM
User Space - Kernel Space basu_arani Programming 3 05-25-2004 11:46 AM


All times are GMT -5. The time now is 11:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration