问题描述
计算机启动时,它会从BIOS扬声器中发出蜂鸣声 .
When computer starts to boot, It makes a beep sound from the BIOS Speaker.
如何在Assembly或C ++中做到这一点?显然,我想通过BIOS Speaker发出蜂鸣声.
记住我的意思是BIOS扬声器
How do i can do this in Assembly or C++ ?Clearly I want to make Beep Sound by BIOS Speaker.
Remember i mean BIOS Speakers
它为此有中断吗?我搜索了一下,但没有找到..我使用了一些中断,但是没有这样做.以下代码:
Does it have any interrupt for that ? I searched about that but nothing found..I used some interrupt But the didn't do this. the following code :
int main(){
cout<<"\a";
}
从扬声器而不是Bios产生声音
Produced the sound from the Speaker, Not Bios
我该怎么做?有任何中断吗?
How can i do this ? with any interrupt ?
推荐答案
我想,在任何现代Windows操作系统中实现此功能的唯一方法是编写内核模式驱动程序.原因是in
或out
指令在用户模式下不可用,并且没有用于蜂鸣器的API.
The only way you can implement this in any modern Windows OS is, I guess, writing Kernel Mode driver. The reason is that in
or out
instructions are not available in user mode, and there is no API for beeper available.
- http://en.wikipedia.org/wiki/Protection_ring
- https://msdn .microsoft.com/en-us/library/windows/hardware/ff554836(v = vs.85).aspx
- http://en.wikipedia.org/wiki/Protection_ring
- https://msdn.microsoft.com/en-us/library/windows/hardware/ff554836(v=vs.85).aspx
但是,如果您只想研究底层编程,请考虑编写自己的引导程序甚至BIOS(使用虚拟机).
However, if you're just willing to dig into low-level programming, consider writing own bootloader or even own BIOS (using virtual machine).
这篇关于在BIOS中发出哔声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!