LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 10-20-2003, 08:34 AM   #1
dummyagain
Member
 
Registered: Sep 2003
Posts: 74

Rep: Reputation: 15
interrupt


What's the C code for enabling and disabling interrupt in C?
 
Old 10-20-2003, 10:25 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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.
 
Old 10-20-2003, 11:15 AM   #3
dummyagain
Member
 
Registered: Sep 2003
Posts: 74

Original Poster
Rep: Reputation: 15
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
 
Old 10-20-2003, 11:40 AM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
you'll need to do some kernel mode programming, there is an article on linux gazette about programming the pc speaker if your interested.
 
Old 10-20-2003, 11:52 AM   #5
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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
 
Old 10-20-2003, 09:09 PM   #6
dummyagain
Member
 
Registered: Sep 2003
Posts: 74

Original Poster
Rep: Reputation: 15
I am sorry that I am not really understand what the material in the website...

can u suggest some other sites?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Interrupt routine... Elric of Grans Programming 2 07-05-2005 07:11 PM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
about interrupt dummyagain Programming 0 10-26-2003 02:09 AM
eth0 interrupt filo Linux - Networking 3 02-28-2003 02:06 PM
interrupt??? raven Linux - Hardware 1 06-10-2002 06:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration