aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/sound/frequency.c
diff options
context:
space:
mode:
authorMarvin Borner2020-06-17 18:31:46 +0200
committerMarvin Borner2020-06-17 18:31:46 +0200
commiteed77bd2970a00d1394ed027ceca5b646e4671ce (patch)
treec44643d98aed2b6818f2b33417c0dea9c5853094 /src/kernel/sound/frequency.c
parent49dfa1f4021026bf7c4d77817959c8aa24067016 (diff)
Started rewrite
Diffstat (limited to 'src/kernel/sound/frequency.c')
-rw-r--r--src/kernel/sound/frequency.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/kernel/sound/frequency.c b/src/kernel/sound/frequency.c
deleted file mode 100644
index caa4b07..0000000
--- a/src/kernel/sound/frequency.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <io/io.h>
-#include <stdint.h>
-#include <timer/timer.h>
-
-void play_sound(u32 frequency)
-{
- u32 divided;
- u8 tmp;
-
- divided = 1193180 / frequency;
- outb(0x43, 0xb6);
- outb(0x42, (u8)(divided));
- outb(0x42, (u8)(divided >> 8));
-
- tmp = inb(0x61);
- if (tmp != (tmp | 3)) {
- outb(0x61, (u8)(tmp | 3));
- }
-}
-
-static void shut_up()
-{
- u8 tmp = (u8)(inb(0x61) & 0xFC);
-
- outb(0x61, tmp);
-}
-
-// Make a beep
-void beep(u32 frequency, u32 ticks)
-{
- play_sound(frequency);
- timer_wait((int)ticks);
- shut_up();
-} \ No newline at end of file