LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-23-2010, 06:23 AM   #1
shathil
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Rep: Reputation: 0
Using SIGNALS in linux kernel modules


Hello
I am writing a kernel module which need to do something at some interval. Now this problem can be solved by using a user process, which will send signal to the kernel and the kernel would do accordingly. But it would be nice, i could do it within the kernel module itself. Is there any way to use SIGNALs inside the kernel module?

BR
Mohammad Hoque
 
Old 04-23-2010, 09:01 AM   #2
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Hi,

Quote:
a user process, which will send signal to the kernel and the kernel would do accordingly.
AFAIK signals can only be sent from kernel space to user space, not vice-versa.

Quote:
Is there any way to use SIGNALs inside the kernel module?
Explain what exactly you want to achieve when you say that you want to use signals inside kernel module ?

There is a discussion going on here w.r.t sending signals from kernel space to user space:
http://www.linuxquestions.org/questi...rocess-803485/

also see:
http://linux.die.net/man/2/kill

Last edited by Aquarius_Girl; 04-23-2010 at 09:02 AM.
 
Old 04-23-2010, 10:35 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
Go with your first idea. (I mean that!)

Use a user-space process. Have it request kernel services when necessary.

"The kernel" is an extremely special-purpose environment. It exists only to support userland processes (privileged or not).

For example: "the kernel is not 'signaled.'" Rather, "the kernel exists to implement the concept of 'signals.' (And for that matter... of 'processes' and 'threads.')" It creates these things: therefore, it does not (and cannot...) live by them.

Last edited by sundialsvcs; 04-23-2010 at 10:37 PM.
 
Old 04-24-2010, 03:06 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
As anishakaul and sundialsvcs both implied:
Quote:
If you *can* do something in user space ... then you usually *should* do it in user space!
 
  


Reply



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
LINUX kernel modules arunachalam Linux - General 2 11-14-2005 10:11 PM
Capturing the signals from UNIX kernel Micha Agovic Programming 3 01-30-2002 07:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration