|
发表于 2003-10-25 22:56:50
|
显示全部楼层
Here is a feasible way I have tested(just feasible, but not easy )
open the file: /usr/src/linux-2.4/drivers/char/vt.c and, locate the following code:
#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \
|| (defined(__mips__) && defined(CONFIG_ISA)) \
|| (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
|| defined(__x86_64__)
static void
kd_nosound(unsigned long ignored)
{
/* disable counter 2 */
outb(inb_p(0x61)&0xFC, 0x61);
return;
}
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
static struct timer_list sound_timer = { function: kd_nosound };
unsigned int count = 0;
unsigned long flags;
if (hz > 20 && hz < 32767)
count = 1193180 / hz;
save_flags(flags);
cli();
del_timer(&sound_timer);
if (count) {
/* enable counter 2 */
outb_p(inb_p(0x61)|3, 0x61);
/* set command for counter 2, 2 byte write */
outb_p(0xB6, 0x43);
/* select desired HZ */
outb_p(count & 0xff, 0x42);
outb((count >> & 0xff, 0x42);
if (ticks) {
sound_timer.expires = jiffies+ticks;
add_timer(&sound_timer);
}
} else
kd_nosound(0);
restore_flags(flags);
return;
}
#else
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
now what you should do is to delete the implementation of the fuction _kd_mksound() before "#else" and then rebuid your kernel
(the code after being deleted looks like:
#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \
|| (defined(__mips__) && defined(CONFIG_ISA)) \
|| (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
|| defined(__x86_64__)
static void
kd_nosound(unsigned long ignored)
{
/* disable counter 2 */
outb(inb_p(0x61)&0xFC, 0x61);
return;
}
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
#else
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
or more simply:
#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \
|| (defined(__mips__) && defined(CONFIG_ISA)) \
|| (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
|| defined(__x86_64__)
static void
kd_nosound(unsigned long ignored)
{
/* disable counter 2 */
outb(inb_p(0x61)&0xFC, 0x61);
return;
}
#endif
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
) |
|