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
Solved

Using Interrupts in gcc

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
linux rpm install 5 227
Trying to compile syslinux 4.03 on Ubuntu 14.04 14 175
How to use docker to run your java program on a linux box 9 109
bash file 10 49
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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