This is probably a pretty simple question, but I was not quite sure of the answer. In brief, can you write an interrupt routine in user space?
I have a bit of hardware (1-wire interface) that, due to a bug, must be interrupt driven; if possible I would like to have my user-space program (alone) transmit data, wait for an interrupt, then request data, interrupt, etc. All the routine would need to do is set a gobal variable or something --- it is so that I know the transfer is complete.
If it is not possible, I shall have to look into how I can do something else from kernel; if it is possible, any basic advice (or useful reading) would be appreciated.
I'm not an expert, but I believe the short answer is no.
Signals are definitely kernel-level programming.
Every other OS I have programmed has required system level programming to create a true interrupt.
Apparently the following book is quite good for Linux hardware programming, our lab was able to write a couple of device drivers using it.
Title: Linux Device Drivers
Author: Jonathan Corbet, Alessandro Rubini, Greg Greg Kroah-Hartman
Format: Trade Paperback · Published: February 2005
Dimensions: 608 Pages, 7 x 9 in
ISBN: 0596005903 · Published by O'reilly
Thanks for the reply!
I was afraid that may be the answer, but I was kind of hoping I may be able to take the easy way out. The last time I wrote an interrupt routine, I could include it in my standard program... but that chip did not have an OS, so there was no other way to do it ;) It will take longer like this, but I imagine the end product *would* be better: thanks again!
|All times are GMT -5. The time now is 05:52 AM.|