Subject: Re: Getting rid of BEEP_ONHALT_*
To: Martin Husemann <martin@duskware.de>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 02/24/2006 20:08:49
On 24/02/2006, at 19:58, Martin Husemann wrote:

> On Fri, Feb 24, 2006 at 06:34:16PM +0100, Julio M. Merino Vidal wrote:
>> The problem is that the kernel has too many options.  Many of them
>> are useful and required, but I don't think being able to configure
>> such minor things is a good idea, specially being build-time-only
>> options...  Things should 'just work' and be kept simple.
>
> You can (and I gues that's what der Mouse tried to suggest implicitly)
> simply use a default value for the pitch and length, but have them
> overridable via the options. That way you only need BEEP_ONHALT, but
> still could change the pitch with BEEP_ONHALT_PITCH.

This is what the code currently does, isn't it?
> I don't see a problem with compile time options for *this* type of  
> things.
> Making a sysctl out of it is certainly overkill. You could use a  
> global
> variable that gets initialized with the option value:
>
> #ifdef BEEP_ONHALT
> #ifndef	BEEP_ONHALT_PITCH
> #define	BEEP_ONHALT_PITCH	1500
> #endif
> int beep_onhalt_pitch = BEEP_ONHALT_PITCH;
> #endif
>
> Then you can use gdb to change the value in the kernel binary w/o  
> recompiling.

But these will be lost every time you update the kernel.  If it is
a sysctl node you can just stick the values in sysctl.conf and use
them forever.

As 1) the feature is optional and 2) sysctl nodes are now dynamic,
(so no need to mess with userland) I don't see why adding some more
sysctl nodes could hurt...

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/