ATKBD(4)

🌸 ATKBD(4) 🌸

okay bestie, we're doing the Kernel Interfaces Manual today and this one is literally about your keyboard. yes, that keyboard. the one you're typing on rn. iconic behavior. πŸ‘‘


✨ NAME ✨

atkbd β€” the AT keyboard interface. that's it, that's the whole girl. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

options ATKBD_DFLT_KEYMAP
makeoptions ATKBD_DFLT_KEYMAP=_keymap_name_
options KBD_DISABLE_KEYMAP_LOAD
device atkbd

and over in /boot/device.hints:

hint.atkbd.0.at="atkbdc"
hint.atkbd.0.irq="1"

πŸ’– DESCRIPTION πŸ’–

so, the atkbd driver, holding hands with the atkbdc driver, is your access point to the AT 84 keyboard or the AT enhanced keyboard β€” whichever one is plugged into the AT keyboard controller. they're a package deal, no solo careers here. 🫢

this driver is required if you want the console driver syscons(4) or vt(4) to work. like, non-negotiable. it's giving essential personnel. ✨

there can be only one atkbd device defined in the kernel configuration file. one. singular. don't be greedy. πŸ™ˆ

also this device needs the atkbdc keyboard controller to actually be present, so no controller = no vibes. and the irq number must always be 1 β€” there is literally no provision for changing that number. it's 1. forever. periodt. πŸ’€

🌈 Function Keys 🌈

the AT keyboard has a whole lil squad of function keys. they're numbered like this, and you can associate strings with them using the kbdcontrol(1) command. you can also use a keyboard map file (peep kbdmap(5)) to map them to whatever arbitrary keys you want β€” especially the functions in the range from 65 to 96, which nobody uses by default. free real estate. πŸ¦‹

  • 1, 2,...12 β€” F1, F2,... F12
  • 13, 14,...24 β€” Shift+F1, Shift+F2,... Shift+F12
  • 25, 26,...36 β€” Ctl+F1, Ctl+F2,... Ctl+F12
  • 37, 38,...48 β€” Shift+Ctl+F1, Shift+Ctl+F2,... Shift+Ctl+F12
  • 49 β€” Home and Numpad 7 (without NumLock)
  • 50 β€” Up Arrow and Numpad 8 (without NumLock)
  • 51 β€” Page Up and Numpad 9 (without NumLock)
  • 52 β€” Numpad -
  • 53 β€” Left Arrow and Numpad 4 (without NumLock)
  • 54 β€” Numpad 5 (without NumLock)
  • 55 β€” Right Arrow and Numpad 6 (without NumLock)
  • 56 β€” Numpad +
  • 57 β€” End and Numpad 1 (without NumLock)
  • 58 β€” Down Arrow and Numpad 2 (without NumLock)
  • 59 β€” Page Down and Numpad 3 (without NumLock)
  • 60 β€” Ins and Numpad 0 (without NumLock)
  • 61 β€” Del
  • 62 β€” Left GUI Key
  • 63 β€” Right GUI Key
  • 64 β€” Menu
  • 65, 66,...96 β€” free (not used by default)

if you wanna know how to actually assign a string to a function key, go read the man page for kbdcontrol(1). it's all in there, iykyk. πŸ“–


πŸ› οΈ DRIVER CONFIGURATION πŸ› οΈ

🧚 Kernel Configuration Options 🧚

these kernel configuration options are the ones running the atkbd driver's whole life:

  • ATKBD_DFLT_KEYMAP β€” this option sets the default, built-in keymap of the atkbd driver to the named keymap. see the EXAMPLES section below, bestie. ✨
  • KBD_DISABLE_KEYMAP_LOAD β€” normally the keymap can be modified by the kbdcontrol(1) command. this option disables that feature and stops the user from changing key assignment. no takebacks. 🚫

πŸŽ›οΈ Driver Flags πŸŽ›οΈ

the atkbd driver accepts the following driver flags, and you can set them either in /boot/device.hints or from inside the boot loader (see loader(8)):

  • bit 0 (FAIL_IF_NO_KBD) β€” by default the atkbd driver will install even if a keyboard isn't actually connected to the system. this option prevents the driver from being installed in that situation. no keyboard, no entry. πŸ’€
  • bit 1 (NO_RESET) β€” with this option, the atkbd driver will not reset the keyboard when initializing it. lowkey useful for laptop computers whose function keys have special functions and those functions get forgotten when the keyboard is reset. we've all been there. 😭
  • bit 2 (ALT_SCANCODESET) β€” certain keyboards, like the ones on some ThinkPad models, behave like the old XT keyboard and require this option. they're quirky like that. πŸŽ€
  • bit 3 (NO_PROBE_TEST) β€” with this option, the atkbd driver will not test the keyboard port during the probe routine. some machines hang during boot when that test is performed. so, yeah, this one saves lives. πŸ™

🌟 EXAMPLES 🌟

the atkbd driver requires the keyboard controller atkbdc. so your kernel configuration file should contain these lines:

device atkbdc
device atkbd

and here's how you set the default, built-in keymap to jp.106.kbd:

device atkbdc
options ATKBD_DFLT_KEYMAP
makeoptions ATKBD_DFLT_KEYMAP=jp.106
device atkbd

in both cases, you also need to have the following lines in /boot/device.hints:

hint.atkbdc.0.at="isa"
hint.atkbdc.0.port="0x060"
hint.atkbd.0.at="atkbdc"
hint.atkbd.0.irq="1"

πŸ‘€ SEE ALSO πŸ‘€

kbdcontrol(1), atkbdc(4), psm(4), syscons(4), vt(4), kbdmap(5), loader(8)


πŸ“œ HISTORY πŸ“œ

the atkbd driver first appeared in FreeBSD 3.1. a legend from the start, fr fr. ⭐


πŸ’œ AUTHORS πŸ’œ

the atkbd driver was written by SΓΈren Schmidt <sos@FreeBSD.org> and Kazutaka Yokota <yokota@FreeBSD.org>. this manual page was written by Kazutaka Yokota. absolute icons, we stan. πŸ‘‘


and that's the whole page bestie!! πŸŽ€ this was the Debian release from January 29, 2008, filed under ATKBD(4) β€” go forth and keyboard responsibly. mwah. πŸ’–βœ¨πŸ¦‹
πŸ“¦ where this page comes from