diff --git a/sortix/Makefile b/sortix/Makefile index cf88e4ee..eb9b870e 100644 --- a/sortix/Makefile +++ b/sortix/Makefile @@ -121,7 +121,6 @@ scheduler.o \ segment.o \ serialterminal.o \ signal.o \ -sound.o \ string.o \ symbol.o \ syscall.o \ diff --git a/sortix/interrupt.cpp b/sortix/interrupt.cpp index a5093a93..34505e3f 100644 --- a/sortix/interrupt.cpp +++ b/sortix/interrupt.cpp @@ -39,8 +39,6 @@ #include "x86-family/idt.h" -#include "sound.h" // Hack for SIGSEGV - namespace Sortix { namespace Interrupt { @@ -266,8 +264,6 @@ void CrashHandler(CPU::InterruptRegisters* regs) Log::PrintF("%s exception at ip=0x%zx (cr2=0x%p, err_code=0x%p)\n", message, ip, regs->cr2, regs->err_code); - Sound::Mute(); - // Exit the process with the right error code. // TODO: Sent a SIGINT, SIGBUS, or whatever instead. CurrentProcess()->Exit(139); diff --git a/sortix/kernel.cpp b/sortix/kernel.cpp index aba91fc1..d58dac62 100644 --- a/sortix/kernel.cpp +++ b/sortix/kernel.cpp @@ -81,7 +81,6 @@ #include "initrd.h" #include "vga.h" #include "bga.h" -#include "sound.h" #include "io.h" #include "pipe.h" #include "poll.h" @@ -530,9 +529,6 @@ static void BootThread(void* /*user*/) // Initialize the VGA driver. VGA::Init("/dev", slashdev); - // Initialize the sound driver. - Sound::Init(); - // Initialize the identity system calls. Identity::Init(); diff --git a/sortix/sound.cpp b/sortix/sound.cpp deleted file mode 100644 index c20d22c1..00000000 --- a/sortix/sound.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - - Copyright(C) Jonas 'Sortie' Termansen 2011, 2012. - - This file is part of Sortix. - - Sortix is free software: you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation, either version 3 of the License, or (at your option) any later - version. - - Sortix is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along with - Sortix. If not, see . - - sound.cpp - Implements a simple sound system. - -*******************************************************************************/ - -#include -#include -#include -#include - -#include "sound.h" - -namespace Sortix -{ - namespace Sound - { - kthread_mutex_t soundlock; - - void Mute() - { - ScopedLock lock(&soundlock); - uint8_t TMP = (CPU::InPortB(0x61)) & 0xFC; - - CPU::OutPortB(0x61, TMP); - } - - void Play(unsigned Frequency) - { - ScopedLock lock(&soundlock); - //Set the PIT to the desired frequency - uint32_t Div = 1193180 / Frequency; - CPU::OutPortB(0x43, 0xB6); - CPU::OutPortB(0x42, (uint8_t) (Div) ); - CPU::OutPortB(0x42, (uint8_t) (Div >> 8)); - - // And play the sound using the PC speaker - uint8_t TMP = CPU::InPortB(0x61); - - if ( TMP != (TMP | 3) ) - { - CPU::OutPortB(0x61, TMP | 3); - } - } - - void SysSetFrequency(unsigned frequency) - { - if ( frequency == 0 ) { Mute(); } else { Play(frequency); } - } - - void Init() - { - soundlock = KTHREAD_MUTEX_INITIALIZER; - Syscall::Register(SYSCALL_SET_FREQUENCY, (void*) SysSetFrequency); - } - } -} diff --git a/sortix/sound.h b/sortix/sound.h deleted file mode 100644 index f4567ae3..00000000 --- a/sortix/sound.h +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - - Copyright(C) Jonas 'Sortie' Termansen 2011, 2012. - - This file is part of Sortix. - - Sortix is free software: you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation, either version 3 of the License, or (at your option) any later - version. - - Sortix is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along with - Sortix. If not, see . - - sound.h - Implements a simple sound system. - -*******************************************************************************/ - -#ifndef SORTIX_SOUND_H -#define SORTIX_SOUND_H - -namespace Sortix -{ - namespace Sound - { - void Init(); - void Mute(); - void Play(unsigned Frequency); - } -} - -#endif diff --git a/sortix/time.cpp b/sortix/time.cpp index 47262b6f..bd8e09e6 100644 --- a/sortix/time.cpp +++ b/sortix/time.cpp @@ -39,8 +39,6 @@ #include #include -#include "sound.h" - #ifdef PLATFORM_SERIAL #include "serialterminal.h" #endif