Subject: Re: Beep events [was: beep on halt]
To: Julio Merino <jmmv@menta.net>
From: Bang Jun-Young <junyoung@mogua.com>
List: tech-kern
Date: 10/21/2002 16:54:51
On Sun, Oct 20, 2002 at 11:47:51PM +0200, Julio Merino wrote:
> Hello (again)
>
> According to what people has suggested and seen that this interests to
> several people, I've made some more changes to my patch.
>
> First, all variables go inside sysctl's kern. namespace. This is the most
> logical thought, as this can work in several platforms, not just i386 (to
> be implemented). Also, the beeps can be called from, for example, ddb or
> any other MI part of the kernel (as somebody said, when panic'ing or
> entering the debugger).
>
> So, this is what my sysctl reports now:
>
> $ sysctl -a | grep beep
> kern.beep.onhalt.count = 0
> kern.beep.onhalt.pitch = 1500
> kern.beep.onhalt.period = 250
> kern.beep.onreboot.count = 0
> kern.beep.onreboot.pitch = 1500
> kern.beep.onreboot.period = 250
>
> As before, all this stuff can be completely enabled/disabled by using the
> BEEP_EVENTS kernel option.
>
> The overload on the kernel is really small:
>
> $ cd /var/build/kernel/DARKSTAR
> $ ls -l netbsd
> -rwxr-xr-x 1 jmmv wheel 2045483 Oct 20 23:38 netbsd
> $ ls -l /netbsd
> -rwxr-xr-x 1 root wheel 2046170 Oct 20 23:26 /netbsd
> $ bc
> 2046170 - 2045483
> 687
>
> You see, 687 bytes...
>
> Attached is patches.tgz, which contains the kernel patch and sysctl patch.
> Probably, sysctl changes are wrong... well, I do not know enough this
> program's code.
>
> So, what do you think now? May this be send-pr'ed after the review?
IMHO, the idea of using sysctl here is a kernel bloat. Just
sysbeep(...);
delay(...);
would be enough. I don't see a good reason to repeat beep several times
either.
Jun-Young
--
Bang Jun-Young <junyoung@mogua.com>