tests pcspkr

This commit is contained in:
Adrien Bourmault 2019-05-06 23:08:01 +02:00
parent fbccfab642
commit 58caff5eaa
2 changed files with 4 additions and 8 deletions

View File

@ -87,16 +87,9 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
IoPrintRtcTime(); IoPrintRtcTime();
KernLog("There was %d ticks\n", IoGetRtcTicks());
int *var = 7 * GB;
*var = 1;
IoDoBeep(); IoDoBeep();
KernLog("Goodbye at %s\n", IoGetRtcTimeChar()); KernLog("Goodbye at %s\n", IoGetRtcTimeChar());
// End this machine's suffering // End this machine's suffering
BStdOut->flusher(BStdOut); BStdOut->flusher(BStdOut);
KeCrashSystem(); KeCrashSystem();

View File

@ -48,13 +48,16 @@ void IoQuietSpeaker(void)
void IoDoBeep(void) void IoDoBeep(void)
{ {
ulong flags = KePauseIRQs();
IoStartSpeaker(1000); IoStartSpeaker(1000);
KeRestoreIRQs(flags);
// Worst possible way of waiting // Worst possible way of waiting
// We need actual timers // We need actual timers
ulong ticks = IoGetRtcTicks(); ulong ticks = IoGetRtcTicks();
while (IoGetRtcTicks() < ticks + 1024); while (IoGetRtcTicks() < ticks + 2*1024);
IoQuietSpeaker(); IoQuietSpeaker();
} }