Keyboard interrupt handler and more
I need to serve keyboard interrupts in my application. I have done fair share of searching and I generally know how to register interrupt handler with kernel. But I don't know how to save/restore previous interrupt handler so when my application finishes computer remains usable. Also I need to have a function called on regular time intervals. I heard there is a kernel function for that but I don't know which one it is. Thank you in advance for any help.
|
Quote:
Code:
#include <signal.h> |
Register an interrupt handler from a kernel module - that's doable, but from an user-space application? I rather does not work this way (of course, depending on the OS).
In general, you would need to store old handler address and then restore it later (if you know where to write the address, it should be rather easy). I don't know what you're doing and what's the reason you need your own interrupt handler (what with different types of keyboards?), but it may be a much better idea to get raw access to keyboard from the application. |
One more note: the code taylor_venable posted is not about interrupt handling, but signal handling, what is a different issue. The original poster may be, however, making the same mistake.
|
i can tell how i have implemented my keypad to get detected
first; request kernel for an interrupt in ur driver for keyboard otherwise kernel will ignore the interrupt request_irq(interrupt number,function to get executed on irq...) second: write an irq routine that will get executed on recieve of interrupt (function what i have mentioned above) write it as short as possible read the buffer on recieve of interrupt "copy_to_user" on completion of line |
Request keyboard interrupt handler for application
Can anyone send me the code for key board interrupt handling. I need to open the keyboard device and handle the keyboard interrupts and send my application the received key information. Thanks a lot.
|
All times are GMT -5. The time now is 10:08 AM. |