diff --git a/kaleid/kernel/io/spkr.c b/kaleid/kernel/io/spkr.c index 7834ffb..b4d87b2 100644 --- a/kaleid/kernel/io/spkr.c +++ b/kaleid/kernel/io/spkr.c @@ -31,6 +31,7 @@ void IoStartSpeaker(int freq) char temp; int pitf = 1193180 / freq; + ulong flags = KePauseIRQs(); IoWriteByteOnPort(0x43, 0xB6); IoWriteByteOnPort(0x42, (char)pitf); IoWriteByteOnPort(0x42, (char)(pitf >> 8)); @@ -39,6 +40,7 @@ void IoStartSpeaker(int freq) if (temp != (temp | 3)) { IoWriteByteOnPort(0x61, temp | 3); } + KeRestoreIRQs(flags); } void IoQuietSpeaker(void) @@ -48,9 +50,8 @@ void IoQuietSpeaker(void) void IoDoBeep(void) { - ulong flags = KePauseIRQs(); + IoStartSpeaker(1000); - KeRestoreIRQs(flags); // Worst possible way of waiting // We need actual timers