ATTIMER(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… ATTIMER(4) β€” the i8254 Programmable Interval Timer (AT Timer) driver, explained πŸŽ€

okay so this is the attimer page from the Kernel Interfaces Manual, and it's genuinely one of those "small driver, big responsibilities" situations. it's giving quiet main character energy. let's get into it 🫢


✨ NAME ✨

attimer β€” the i8254 Programmable Interval Timer (AT Timer) driver. yes bestie, that's the beepy-ticky one πŸ’–

🌸 SYNOPSIS 🌸

this driver is a mandatory part of x86 kernels, so no, you can't just opt out, it's not that kind of party 😭

the following tunables are settable from loader(8):

hint.attimer.X.clock
  • controls support for the event timer functionality πŸ•°οΈ
  • setting this value to 0 disables it
  • the default value is 1
hint.attimer.X.timecounter
  • controls support for the time counter functionality ⏱️
  • setting this value to 0 disables it
  • the default value is 1
hw.i8254.freq
  • lets you override the default counter frequency 🎚️
  • the same value is also available at run-time via the machdep.i8254_freq sysctl
lowkey important: hw.i8254.freq and machdep.i8254_freq are literally the same value, one's the loader-time knob and one's the run-time view. iykyk πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so this driver takes the i8254 Programmable Interval Timer (AT Timer) hardware and uses it to hand the kernel one timecounter and one event timer, plus it generates sound tones for the system speaker πŸ”Šβœ¨ like, multitasking icon behavior.

the hardware itself includes three channels. and each channel includes a 16 bit counter which decreases with a known, platform-dependent frequency. counters can operate in several different modes, including periodic and one-shot β€” so you've got options, she's versatile πŸ’β€β™€οΈ

the output of each channel has platform-defined wiring, and here's the breakdown:

  • one channel is wired to the interrupt controller and may be used as the event timer πŸ•°οΈ
  • one channel is wired to the speaker and is used to generate sound tones 🎡
  • one timer is reserved for platform purposes (hands off, she's busy) πŸ™ˆ

and here's the clever-but-slightly-fussy part: the attimer driver uses a single hardware channel to provide both time counter and event timer functionality. to make that possible, the respective counter must be running in periodic mode. and because of that, the one-shot event timer mode is supported only when time counter functionality is disabled ⚠️ like, that's the tradeoff, that's the deal, no cap.

also worth knowing, fr fr: the event timer provided by the driver is irrelevant to CPU power states πŸ’€ so don't go expecting it to have opinions about your power management. it does not.

🌈 SEE ALSO 🌈

go read those too, bestie, they're the friend group πŸ‘‘πŸ’œ


and that's the whole page, periodt πŸŽ€ this one came from Debian, dated May 26, 2014 β€” yes she's a 2014 queen and she's still holding it down ⭐ bye bestie, go configure your timers responsibly πŸ’–

πŸ“¦ where this page comes from