Solved

Using Interrupts in gcc

Posted on 2001-08-23
3
1,078 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 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