mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
Kernel: Try to detect Sound Blaster 16 before creating an instance
We shouldn't create a SB16 instance without checking if the Sound Blaster 16 card is actually installed in the system.
This commit is contained in:
parent
5bb35da784
commit
f2faf11d61
3 changed files with 16 additions and 2 deletions
|
@ -89,6 +89,19 @@ SB16::~SB16()
|
|||
{
|
||||
}
|
||||
|
||||
void SB16::detect()
|
||||
{
|
||||
IO::out8(0x226, 1);
|
||||
IO::delay(32);
|
||||
IO::out8(0x226, 0);
|
||||
|
||||
auto data = dsp_read();
|
||||
if (data != 0xaa) {
|
||||
return;
|
||||
}
|
||||
SB16::create();
|
||||
}
|
||||
|
||||
void SB16::create()
|
||||
{
|
||||
s_the.ensure_instance();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue