DragonFly BSD
DragonFly kernel List (threaded) for 2004-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

My first real attempt at kernel hacking!


From: Chris Pressey <cpressey@xxxxxxxxxxxxxxx>
Date: Wed, 3 Mar 2004 22:43:07 -0800

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@.

Thanks to Emiel, Rob, and Samy for the help and encouragement :)

-Chris



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]