Solved

Using Interrupts in gcc

Posted on 2001-08-23
3
1,069 Views
Last Modified: 2008-03-06
When i use gcc to compile, how do I use Interrupts? Like i have int86() func. in turboC .
0
Comment
Question by:rasaraja
3 Comments
 
LVL 1

Expert Comment

by:nhuanvn
ID: 6424172
Don't think that you can direct gcc to *use* interrupts.
If you have a function and you want it to be an ISR,
then somewhere in your program, make a system call to
signal. See man pages for gcc and signal for more
information. Just type
   man gcc <Enter>
   man signal <Enter>
Btw, I see it in your profile that you have so many B and C
grades for solutions. You may not receive useful answers
then.
0
 

Author Comment

by:rasaraja
ID: 6425792
Thanks for the grade tip.I never really noticed this !!
I'll see the man pages :-)
0
 
LVL 5

Accepted Solution

by:
bryanh earned 50 total points
ID: 6449198
Using interrupts isn't really a matter of the compiler you use or even of the programming language you use.  It's an operating system matter.  I don't know what int86() in Turbo C is, but I doubt it's a feature of Turbo C as much as it's a feature of the operating system your Turbo C function runs on.

In Linux, if you want a user program to respond to a hardware interrupt, you write a device driver and install it with insmod.  Your program typically does a read() which causes that device driver to be invoked and doesn't return until the interrupt in question occurs.
 
If you want a program to be "interrupted" by an interrupt, you have it use signal() to set up a signal handler, then you have a second process wait for the interrupt with read() and then signal the first process (with kill()).

More often, if you're interested in hardware interrupts, you just write your entire program as a device driver and insmod it.

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now