WSBELL(9)
β¨ WSBELL(9) β the wscons system bell support glow-up β¨
okay so this is the wsbell manual page, from the Kernel Developer's Manual β yes bestie we're in kernel dev territory, buckle up π
πΈ NAME πΈ
wsbell, wsbelldevprint β it's giving wscons system bell support π like literally the bell module for wscons, no cap.
π¦ SYNOPSIS π¦
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsbellvar.h>
int
wsbelldevprint(void *aux, const char *pnp);
π DESCRIPTION π
So the wsbell module is a whole component of the wscons(9) framework, and its entire personality is keyboard-independent bell support. Iconic. β¨
All of the actual support is provided by the wsbell(4) device driver β and that driver must be a child of the hardware device driver, like that's the vibe check, no exceptions. π
And here's the tea: the only hardware device drivers that can provide a wsbell facility are speaker(4) devices. That's it. That's the list. π«Ά
π DATA TYPES π
Speaker drivers that wanna support wscons bell devices will make use of these data types, periodt:
struct wsbelldev_attach_argsβ a structure used to attach the wsbell(4) child device. It's got the following members:void *accesscookie;
like it's a tiny struct but it's the main character of the attach process, lowkey π₯
β FUNCTIONS β
wsbelldevprint(aux, pnp)β the default wsbell printing routine that gets used byconfig_found(). (peep autoconf(9) if you need the lore) π
π AUTOCONFIGURATION π
Hot take incoming: speaker drivers that wanna use the wsbell module must be a parent to the wsbell(4) device, and they gotta provide an attachment interface. no shortcuts bestie β
So to actually attach the wsbell(4) device, the speaker driver has to:
- allocate and populate a
wsbelldev_attach_argsstructure, - stick a pointer to the parent's device structure in there as an access cookie πͺ,
- and then call
config_found()to perform the attach (see autoconf(9) for the full rundown).
that's the whole recipe, slay π
π§ OPERATION π§
When a bell event is received on a wsdisplay(4) device, the system bell is sounded. π
that's it. that's the operation. short and sweet, we love a concise queen π
π₯ CODE REFERENCES π₯
- The wscons subsystem lives in the directory
sys/dev/wscons. ποΈ - The wsbell module itself is implemented within the file
sys/dev/wscons/wsbell.c. ioctl(2)operations are listed insys/dev/wscons/wsconsio.h.
(and yes, the original really does say "implement" instead of "implemented" in that second bullet β I'm not fixing it, I'm just a girl π«Ά)
π SEE ALSO π
ioctl(2), wsbell(4), wscons(4), wskbd(4), autoconf(9), driver(9), intro(9), wscons(9), wsdisplay(9), wskbd(9)
like literally go read all of these, they're all connected, iykyk π¦
ngl the bell module is small but it's doing its little job and we respect it π
okay bye bestie β this page dropped with the Debian crew on June 30, 2017, so if you see a date on it, that's why πΈ stay ringing, mwah π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2017 Nathanial Sloss <nathanialsloss@yahoo.com.au>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms