Re: nosound module

Tuomas Heino (tbittih@xgw.fi)
Sun, 12 Jan 1997 11:59:59 +0200 (EET)


On Fri, 10 Jan 1997, Ingo Molnar wrote:

> dont know wether some1 has coded this up yet, but this small 1 minute
> module should disable >all< beeper sound on the Linux machine. [currently
> anyone can change the bell pitch value back to the original one ...]
>
> Just compile it and do 'insmod nosound.o' as root. Sounds should be back
> working after 'rmmod nosound'.
>
> modules dont work in 2.1.20, so i havent tested it. Let me know if it
> works or not.
>
> -- mingo
>
> -------------------------------------------------------------->
> #include <linux/module.h>
>
> extern void (*kd_mksound)(unsigned int hz, unsigned int ticks);
> extern void _kd_mksound(unsigned int hz, unsigned int ticks);
>
> static void our_zerosound(unsigned int hz, unsigned int ticks)
> {
> }
>
> int init_module(void)
> {
> kd_mksound=our_zerosound;
> return 1;
> }
>
> void cleanup_module(void)
> {
> kd_mksound=_kd_mksound;
> }
>
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strength-reduce -DMODULE -DMODVERSIONS -include /usr/src/linux-2.1.17/include/linux/modversions.h -o ~tbittih/src/nosound.o ~tbittih/src/nosound.c
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x57): undefined reference to `main'
/tmp/cca114841.o: In function `init_module':
/tmp/cca114841.o(.text+0x12): undefined reference to `kd_mksound'
/tmp/cca114841.o: In function `cleanup_module':
/tmp/cca114841.o(.text+0x22): undefined reference to `kd_mksound'
/tmp/cca114841.o(.text+0x26): undefined reference to `_kd_mksound'

Did I forget something/how should I compile it?
(CONFIG_MODULES=y, CONFIG_MODVERSIONS=y, CONFIG_KERNELD=y)
Also... if I code a visual bell module based on that (whenever I get that
compiled;) ... visual bell should be long enough to be noticed ... so how
to sleep not-so-long amounts of time? ;)