Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using Interrupts in gcc

Posted on 2001-08-23
3
Medium Priority
?
1,086 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

876 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