Leo

Here is a code snippet that uses the PC speaker driver (rather than the 
sound chip which would be more involved) to create two short beeps. You can 
edit it to make the beeps longer or shorter.
You can also remove one of the beeps. You might also want to replace the 
busy-wait for-loop with an RT wait of some sort. If you want a reference see 
"The Indispensable PC Hardware Book"
by Hans-Peter Messmer (third edition).


short tc = 1193180/440;
int i;

outb(inb(0x61) | 3), 0x61);
outb(0xB6, 0x43);
outb(tc & 0xFF, 0x42);
outb((tc >> 8) & 0xFF, 0x42);

for(i=0; i<20000000; i++){}
outb(inb(0x61) & 0xFC, 0x61);

for(i=0; i<100000000; i++){}

outb(inb(0x61) | 3), 0x61);
outb(0xB6, 0x43);
outb(tc & 0xFF, 0x42);
outb((tc >> 8) & 0xFF, 0x42);

for(i=0; i<20000000; i++){}
outb(inb(0x61) & 0xFC, 0x61);


Daniel






>hello!

>I plan to write a simple interrupt routine to verify the PC
>have recieved the interrupt signal.
>
>could the interrupt routine do nothing but make a beep
>sound?
>
>It seems that following code doesn't work.:
>
>printk("D", 0x07);
>
>regards.
>
>leo
>
>_____________________________________________
>�׶�����--�й��˵����ϼ�԰ http://www.263.net
>@263.net�й����������ʾ� http://freemail.263.net
>-- [rtl] ---
>To unsubscribe:
>echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
>echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
>---
>For more information on Real-Time Linux see:
>http://www.rtlinux.org/rtlinux/
>
>-- [rtl] ---
>To unsubscribe:
>echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
>echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
>---
>For more information on Real-Time Linux see:
>http://www.rtlinux.org/rtlinux/
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to