WSBELL(9)

πŸ“¦ version 11.0, in nixpkgs unstable

✨ 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 by config_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:

  1. allocate and populate a wsbelldev_attach_args structure,
  2. stick a pointer to the parent's device structure in there as an access cookie πŸͺ,
  3. 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 in sys/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