All the preceding APIs and helpers work on all hardware interrupts except for the non-maskable interrupt (NMI). The NMI is an arch-specific interrupt and is used to implement stuff such as hardware watchdogs and debug features (for example, an unconditional kernel stack dump for all cores; we'll show an example of this very shortly). Also, NMI interrupt lines cannot be shared.
A quick example of exploiting the NMI can be shown with the kernel's so-called magic SysRq facility. To see the keyboard hotkeys that are assigned for magic SysRq, you must invoke or trigger it by typing in the [Alt][SysRq][letter] key combination.Â
magic SysRq triggering: Instead of getting your fingers all twisted typing [Alt][SysRq][letter], there's an easier – and more importantly non-interactive – way to do so: just echo the relevant letter to a proc pseudofile (as root, of course): echo letter/proc/sysrq-trigger.
But...