Subject: Re: Beep on halt (second patch)
To: Takahiro Kambe <taca@back-street.net>
From: Julio Merino <jmmv@menta.net>
List: tech-kern
Date: 10/20/2002 00:01:45
This is a multi-part message in MIME format.
--Multipart_Sun__20_Oct_2002_00:01:45_+0200_08171600
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
On Sun, 20 Oct 2002 02:04:48 +0900
Takahiro Kambe <taca@back-street.net> wrote:
> At that time, we thought this functionality should be controllable
> with sysctl(8).
>
> kern.shutdown_beep.on (bool) beep on shutdown or not
> kern.shutdown_beep.duration (int) beep time in some unit
> kern.shutdown_beep.pitch (int) pitch of beep
> kern.shutdown_beep.count (int) beep number of times
I have tried this, under the machdep. namespace. Adding new sysctl's
involves more work, and also needs modifying the sysctl program
itself... I do not like this... So I've added two new configuration
variables to specify the freq/time. That is
options BEEP_ON_HALT - if defined, specifies how many beeps. If not
defined, the feature is *completly* disabled
(cannot be easily achieved with sysctl...)
options BEEP_ON_HALT_FREQ - frequency in hz.
options BEEP_ON_HALT_TIME - duration of tone in msecs.
What do you think?
Thanks!
--
Julio Merino (http://jmmv.dyndns.org/) <jmmv@menta.net>
--Multipart_Sun__20_Oct_2002_00:01:45_+0200_08171600
Content-Type: application/octet-stream;
name="beep2.diff"
Content-Disposition: attachment;
filename="beep2.diff"
Content-Transfer-Encoding: base64
SW5kZXg6IGNvbmYvR0VORVJJQwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9zeXNzcmMv
c3lzL2FyY2gvaTM4Ni9jb25mL0dFTkVSSUMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNTE5CmRp
ZmYgLXUgLXUgLXIxLjUxOSBHRU5FUklDCi0tLSBHRU5FUklDCTIwMDIvMTAvMTggMTU6MTE6MTEJ
MS41MTkKKysrIEdFTkVSSUMJMjAwMi8xMC8xOSAyMTo1MTo1MApA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