My first real attempt at kernel hacking!

Matthew Dillon dillon at apollo.backplane.com
Fri Mar 5 22:52:25 PST 2004


:Ever since Matt added systimers, my DragonFly console has been lacking
:something: an audible bell.  I'm sure many people don't miss it, but I
:got used to it, especially as feedback when tab-completion fails.  So I
:added a way to make syscons use my soundcard for ringing the bell.
:
:The theory of operation is very simple.  Every time the bell rings, the
:syscons driver makes a byte available on /dev/consolectl.  A userland
:daemon, belld, opens /dev/consolectl and reads from it, which blocks
:until a byte becomes available.  When it does, belld spawns a
:user-specified program (in my case, "/usr/local/bin/madplay ding.mp3"),
:then waits for the next byte in an infinite loop.
:
:Dead simple, but effective, and a good starter project for cutting my
:teeth in the wild and woolly world of kernel programming.
:
:The files are available here:
:
:  http://catseye.webhop.net/projects/belld/
:
:If I get some positive feedback, I'll clean it up and send it to
:submit at .
:
:Thanks to Emiel, Rob, and Samy for the help and encouragement :)
:
:-Chris

   I like the idea!  I'll take a look at the patch tomorrow.  One thing
   I might do (if the code doesn't already do it) is limit the number
   of bells that can build up in the device driver to something reasonable,
   like 2.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list