Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-20-2003, 08:34 AM
|
#1
|
Member
Registered: Sep 2003
Posts: 74
Rep:
|
interrupt
What's the C code for enabling and disabling interrupt in C?
|
|
|
10-20-2003, 10:25 AM
|
#2
|
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536
Rep: 
|
What do you mean by "interrupt"?
1) Hardware interrupt (IRQ)? You can't really, the kernel handles hardware interrupt. Just unload (rmmod) the right module(s).
2) Things like "CTRL-C", "CTRL-\" and "kill <pid>" ? These are called "signals" in Linux/UNIX. See "man sigaction".
Last edited by Hko; 10-20-2003 at 10:27 AM.
|
|
|
10-20-2003, 11:15 AM
|
#3
|
Member
Registered: Sep 2003
Posts: 74
Original Poster
Rep:
|
i want to control the speaker to produce sound, should i first disable the interrupts first and then write to the port?
but i don't know the exact procedures, can u tell me , plx?
thanks
|
|
|
10-20-2003, 11:40 AM
|
#4
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
you'll need to do some kernel mode programming, there is an article on linux gazette about programming the pc speaker if your interested.
|
|
|
10-20-2003, 11:52 AM
|
#5
|
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536
Rep: 
|
This is not easy. You don't just "disable interrupts" in Linux.
To do this, you would need to have a kernel module.
This is not in the standard kernel, but here's a link to one effort:
http://www.geocities.com/stssppnn/pcsp.html
|
|
|
10-20-2003, 09:09 PM
|
#6
|
Member
Registered: Sep 2003
Posts: 74
Original Poster
Rep:
|
I am sorry that I am not really understand what the material in the website...
can u suggest some other sites?
|
|
|
All times are GMT -5. The time now is 03:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|