LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-16-2007, 11:23 PM   #1
rose_hatami
LQ Newbie
 
Registered: Nov 2007
Posts: 9

Rep: Reputation: 0
how to trensfer data from user space to interrupt handler?


Hi every one
i have an interrupt handler and have linked it to my linux kernel (2.6)
as a module. it have to modify some variables whenever it is executed. the question is how an interrupt handler can modify the global variables in an user-space program. or if it can't, how my program can count the number of execution of that specific interrupt handler?
 
Old 12-18-2007, 12:02 AM   #2
rose_hatami
LQ Newbie
 
Registered: Nov 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rose_hatami View Post
Hi every one
i have an interrupt handler and have linked it to my linux kernel (2.6)
as a module. it have to modify some variables whenever it is executed. the question is how an interrupt handler can modify the global variables in an user-space program. or if it can't, how my program can count the number of execution of that specific interrupt handler?
come on!!!
plz, I need your help!
someone will tell me what to do. i'm sure.
 
Old 12-18-2007, 10:29 AM   #3
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
I would presume that you have written your interrupt handler as part of some sort of device driver. If this is true then I would have the interrupt handler define, and maintain it's own counter in kernel space not user space. I would also use the ioctl mechanisms to pass the current value of the counter back to user space by writing an application that opens your pseudo-device and issues the ioctl call to your driver in order to have it pass the data back to user space.
 
Old 12-19-2007, 04:40 AM   #4
rose_hatami
LQ Newbie
 
Registered: Nov 2007
Posts: 9

Original Poster
Rep: Reputation: 0
dear friend
thank u for your help.
my problem in exact word is a module for customizing the timer of the system. this module is going to run every 5 msec. after 10 times that my module will be run the original timer handler of the system have to be run (then again my handler for 10 times will be run every 5msec)
in fact i want to convert the bahaviure of a windows base program (with the functions setvect and getvect)to a linux base one.
i have studed about the timer functions of the linux kernel itself but there accuracy is not good.
since the accuracy is vary important i have to use the hardware timer of the system itself.

ok, would u plz send some sample code of using "ioctl"? i dont know how to use it!
ofcourse i will highly thank u if u tell me any better idea for better implementing of the program.

O_PEOPLE I REALLY NEED ENY LITTLE HELP TO SOLVE THE PROBLEM
 
Old 12-19-2007, 05:17 AM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Isn't the way to communicate between kernel space and user space thru the /proc file system?

O'Reilly: Writing Linux Device Drivers. Freely available on-line.

jlinkels
 
  


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
How to share data b/w user space and kernel space nandac Linux - Kernel 1 11-28-2006 10:15 PM
control is not going to interrupt handler when interrupt comes in serial driver sateeshalla Linux - Kernel 1 05-04-2006 09:43 AM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
Timer Interrupt Handler opereira Programming 1 03-03-2004 04:57 PM
can interrupt handler call user space function? pot_po Programming 0 11-07-2002 09:32 PM

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

All times are GMT -5. The time now is 11:50 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