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();
KernLog("There was %d ticks\n", IoGetRtcTicks());
int *var = 7 * GB;
*var = 1;
IoDoBeep();
KernLog("Goodbye at %s\n", IoGetRtcTimeChar());
// End this machine's suffering
BStdOut->flusher(BStdOut);
KeCrashSystem();

View File

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