Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Kernel commands are special key combinations that allow direct communication with the operating system's kernel, the core part of the system that manages hardware and software interactions. These commands let users perform important tasks like forcing reboots, ending unresponsive processes, and running memory diagnostics. They are mostly used for system recovery and debugging when the operating system becomes unresponsive. However, because they operate at such a low level, improper use can result in data loss or system damage and should be used with caution.

The SysReq (System Request) Key[1]

The SysReq key was first introduced by IBM with the PC/AT and was originally meant to handle low-level operating system functions. In computing, "low-level" refers to processes that interact more directly with hardware.[2] For example, the programming language C is commonly used to develop operating systems because it allows efficient communication with hardware components.

At first, the SysRq key was designed to prevent software conflicts by allowing system-level commands to run without interference from active applications. However, as operating systems advanced, its role changed across different platforms.[3]

Use of the SysRq Key in Different Operating Systems

  • Linux: The kernel can use the SysReq key to execute important commands, often for system recovery and debugging. The Magic SysRq key combinations allow users to restart the system, kill unresponsive processes, or recover from crashes without using the standard user interface.[4]
  • Windows: In modern versions of Windows, the SysReq key is mostly unused. However, it was once used for system debugging and, in some cases, has been repurposed by software like remote desktop tools or virtualization platforms to send special key commands.[5]

While the SysRq key is no longer widely used in mainstream computing, it remains relevant for system administrators, developers, and users of certain non-mainstream operating systems who need a way to interact with the system at a low level.

Linux SysReq Information Table

To begin a kernel command, press & hold the ALT, then press PrtSc (You are not required to hold the key down). Then press on of the keys below:[6]

Letter Use:
b Will immediately begin rebooting the system without attempting to unmount any drives [This may corrupt data during a write operation; it is best to mount all drivers as R only (Read-only) after any writing operation using u then to reboot.
c
Crashes the system using a NULL pointer dereference -> can return a crash dump to file if configured to send/touch a file.
d Shows all locks that are held.
e Kernel sends a SIGTERM signal to all active processes, terminating them. This does not apply to the init process.
f Calls an OOM (Out-of-memory) killer to attempt to kill any processes taking too much memory, but does not panic if nothing can be killed.
g Used for the Kernel-Debugger (kgdb).
h Kernel outputs possible commands; if you don't press a key with a corresponding command, it'll just output this instead, just in case!!
i Kernel sends a SIGKILL signal to all active processes, killing them. This does not apply to the init process.
j Kernel forcibly "thaws" any filesystem frozen by the FIFREEZE ioctl. (A system call to freeze a file system.)
k Kills all programs on a current virtual console. Secure Access Key (SAK).
... This table is a work in progress.

References

  1. Ralf Brown's Interrupt List - Callout or Callback (usually hooked rather than called)
  2. The IBM Archives: Product Fact Sheet - Wayback Machine: IBM
  3. System request - Wikipedia: The Free Encyclopedia
  4. Linux Magic System Request Key Hacks - What is the magic SysRq key?
  5. Returning Control to Codeview - Microsoft @2008
  6. Linux Magic System Request Key Hacks — What are the 'command' Keys, Documentation for sysrq.c