30

On my keyboard, the key the functions as the Print Screen key when the F-lock is on has "SysRq" below it (presumably to be used when F-lock is off). What is it and what does it do?

3
  • 2
    There is a Wikipedia page for the System Request key.
    – nik
    Jul 16, 2009 at 2:46
  • 4
    Any chance of choosing a correct answer? The question is almost 4 1/2 years old and answer pending for over 2 years. Thanks Oct 9, 2014 at 7:55
  • Post-bounty note: The bounty was given to a 5-year old answer that was relatively underappreciated until recently. Now that a newer answer has been posted, that may be another good choice for accepting an answer.
    – user109256
    Dec 26, 2019 at 10:37

4 Answers 4

19
+100

SysRq was introduced on IBM PC keyboards as a way to have a cross-platform way to initiate a low-level event. When typing the keys, they get put into a buffer and flushed periodically. If your machine locks up, the keyboard does not work.

The SysRq key was basically to force a command to be sent to the computer, bypassing the buffer, to trigger a low level call; usually a RESET event.

However, each OS ignores this key now, and uses a preferred combination keystroke to initiate some sort of 'Task Manager' like interface enabling the OS to remain running, rather than a reset the computer.

Its much more common to run applications from the host OS, rather than from the BIOS. It wasn't like that in the 1980's :-)

1
  • Still very much useful on Linux and definitely not ignored. Can save your file system from corruption.
    – oligofren
    Oct 16, 2020 at 14:56
7

The SysRq key was invented in the early days of personal computers, when low-level Terminate and Stay Resident (TSR) programs could directly access and modify the keyboard buffer. This key bypassed the buffer and gave direct access to the MSDOS operating system.

Today this key is ignored by the BIOS and by Windows. It has been relegated to the Prt Scn key and is activated by Alt+Prt Scn. Some manufactures, for example Lenovo, no longer mark it on the keyboard, although it can still be accessed as above.

Some older debuggers used this key as the break-execution key, but this no longer exists.

Under Linux the key is still present, requiring that the CONFIG_MAGIC_SYSRQ kernel option was specified when the kernel was built. This can be checked by entering the command:

$ cat /proc/sys/kernel/sysrq
176

The command will most often return the value of 176, where each bit stands for one function:

0 - disable sysrq completely
1 - enable all functions of sysrq
2 - enable control of console logging level
4 - enable control of keyboard (SAK, unraw)
8 - enable debugging dumps of processes etc.
16 - enable sync command
32 - enable remount read-only
64 - enable signaling of processes (term, kill, oom-kill)
128 - allow reboot/poweroff
256 - allow nicing of all RT tasks

A value of 0 disables all SysRq functions and a value of 1 enables all of them. The running value can be changed for example by the command:

echo "1" > /proc/sys/kernel/sysrq

Of all command key sequences, REISUB is the most famous, when holding the Alt+Prt Scn keys and pressing the following keys in sequence:

  • r : switches the keyboard from raw to XLATE mode
  • e : sends a SIGTERM signal to all processes, to close gracefully if possible
  • i : sends a SIGKILL signal to terminate processes which didn't respond
  • s : sync all mounted filesystems and flush all cached disk changes
  • u : remount all filesystems in read-only
  • b : system reboot.

References:

3

It is a programmable key which can be made to do a variety of things, depends.

I remember it having some uses on old ibm terminals, and some DOS programs used it for a form of soft resetting.

2

On linux it still serves a very useful function:

https://en.wikipedia.org/wiki/Magic_SysRq_key

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .