Subject: Beep events [was: beep on halt]
To: None <tech-kern@netbsd.org>
From: Julio Merino <jmmv@menta.net>
List: tech-kern
Date: 10/20/2002 23:47:51
This is a multi-part message in MIME format.

--Multipart_Sun__20_Oct_2002_23:47:51_+0200_081d5a00
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

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?

Thank you!

-- 
Julio Merino (http://jmmv.dyndns.org/) <jmmv@menta.net>

--Multipart_Sun__20_Oct_2002_23:47:51_+0200_081d5a00
Content-Type: application/octet-stream;
 name="patches.tgz"
Content-Disposition: attachment;
 filename="patches.tgz"
Content-Transfer-Encoding: base64

H4sIANsjsz0AA+0aa3ObxjZfpV+x15mmsoUlQOhhuc7EkUnjqWPpWkqnmSSji2BlcYOAArLjZPzf
7zm7PAXIaW/jfig7iUHLeeyePXteu64W6KvDT9SzW4a5XD75Hk0SxZ6ikCeESP2uiE8i8d/YZEmR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