LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to trensfer data from user space to interrupt handler? (https://www.linuxquestions.org/questions/programming-9/how-to-trensfer-data-from-user-space-to-interrupt-handler-607245/)

rose_hatami 12-16-2007 11:23 PM

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?

rose_hatami 12-18-2007 12:02 AM

Quote:

Originally Posted by rose_hatami (Post 2992898)
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.

rstewart 12-18-2007 10:29 AM

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.

rose_hatami 12-19-2007 04:40 AM

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

jlinkels 12-19-2007 05:17 AM

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


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