LinuxQuestions.org
Visit Jeremy's Blog.
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 07-05-2005, 12:42 AM   #1
Elric of Grans
Member
 
Registered: May 2005
Posts: 46

Rep: Reputation: 15
Interrupt routine...


G'Day,

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.
 
Old 07-05-2005, 05:44 PM   #2
asgeirss
Member
 
Registered: Aug 2003
Location: Vancouver, Canada
Distribution: RH, SL
Posts: 37

Rep: Reputation: 15
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

Good luck!
 
Old 07-05-2005, 07:11 PM   #3
Elric of Grans
Member
 
Registered: May 2005
Posts: 46

Original Poster
Rep: Reputation: 15
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!
 
  


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
encryption in CGI routine rblampain Linux - Security 3 08-12-2005 10:55 PM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
About startup routine eshwar_ind Programming 18 05-23-2004 02:01 AM
Please confirm backup routine LLS Linux - General 4 09-30-2003 11:30 AM
Unable to hit my serial port interrupt routine hguts Linux - Software 1 07-15-2003 07:45 AM

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

All times are GMT -5. The time now is 08:57 AM.

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