Solved

Using Interrupts in gcc

Posted on 2001-08-23
3
1,079 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

626 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