mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +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
Notes:
sideshowbarker
2024-07-18 22:35:22 +09:00
Author: https://github.com/supercomputer7
Commit: f2faf11d61
Pull-request: https://github.com/SerenityOS/serenity/pull/5237
Issue: https://github.com/SerenityOS/serenity/issues/5234
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