42

Was the SysRq key ever used on any common operating system?

Google tells me it wasn't. But then how did it end up on so many keyboards?

Kaz
  • 8,086
  • 2
  • 38
  • 81
TheAsh
  • 491
  • 4
  • 7
  • 1
    What do you mean by "popular"? That it's on all PC-based keyboards today? Or that it's used a lot by modern operating systems? – Jim Nelson Jul 28 '19 at 17:46
  • 1
    @JimNelson that its on nearly all keyboards, – TheAsh Jul 28 '19 at 17:47
  • You might consider editing your question to reflect that. Also notice you're asking two questions: (a) Was it ever used? and (b) How did it wind up on nearly all keyboards? – Jim Nelson Jul 28 '19 at 17:48
  • 13
    I believe its presence on the IBM PC keyboard descended from the 3270 mainframe terminal system, where for SNA-attached terminals it allowed you to send a command to the System Services Control Point. And once an IBM PC keyboard had it, the clones followed suit. – dave Jul 28 '19 at 17:52
  • 1
    I'm really asking only (b). Of course it was used at least once, and also in UNIX I think it may be used. I'm curious to how it spread. – TheAsh Jul 28 '19 at 17:54
  • 4
    The only piece of software I remember using SysRq was IBM TopView. Hardly anybody ever used TopView, so it didn't matter much. – Greg Hewgill Jul 28 '19 at 21:33
  • @another-dave I think your comment is the right answer to the question, as explained here. – DroidW Jul 29 '19 at 06:45
  • 6
    Does Linux qualify as "common"? Also note that the concept of a "Secure Attention Key" such as STOP on Sun was commonplace before the AT came around. – chrylis -cautiouslyoptimistic- Jul 29 '19 at 07:18
  • 4
    SysReq? On all my latest keyboards they dropped that name from the Print Screen button. – Mast Jul 29 '19 at 09:35
  • See a related question: https://superuser.com/questions/4461/what-does-the-sysrq-key-do – Kaz Jul 29 '19 at 15:20
  • @chrylis The sysrq-k command under Linux at least is not a genuine SAK implementation. – forest Jul 31 '19 at 06:07
  • 1
    @Mast And yet they do still seem to retain the Scroll Lock and Pause/Break keys for some reason. I know of exactly one mainstream program (Excel) that uses Scroll Lock for anything, and none which use Pause/Break - that seems to have been mostly supplanted by the Esc key... – Darrel Hoffman Jul 31 '19 at 17:10
  • 1
    @forest It's not a real SAK, but SysRq operates by directly causing a privileged processor exception, which the operating system can use to implement one. – chrylis -cautiouslyoptimistic- Jul 31 '19 at 17:19
  • @DarrelHoffman It's mighty useful on Excel and I vaguely recall other programs using it in a similar manner. The moment Excel drops it I expect the key to go the way of the dodo. – Mast Jul 31 '19 at 17:21
  • 1
    The most common usage I'm aware of for the Pause/Break key is the Windows+Pause shortcut, to quickly open the System Properties control panel applet. Apart from that, I've seen a few games that used it, but they were mainly really old ones (i.e., designed for DOS, not Windows). – Justin Time - Reinstate Monica Jul 31 '19 at 20:32

6 Answers6

40

Before IBM PC even existed, terminal keyboards for IBM Mainframes make extensive use of the SysRq or (System Request) key. I recall using SysReq key on IBM 5251 and 5291 terminals for IBM S/36. Probably the key (and function) was already present in the 1970s IBM 3270 terminal.

Its function was to suspend the current job and display the System Request Menu. The System Request Menu allows the user to send and display messages, transfer to a second job, or end the current job.

It was included in the first IBM PC 5150 just because it was used also as a mainframe terminal (with the appropiate card).

roetnig
  • 511
  • 3
  • 4
  • 2
    I believe the mainframe association is correct, but I can't see any sign of SysRq on this 5150 keyboard: https://commons.wikimedia.org/wiki/File:IBM_5150_PC.JPG – Kaz Jul 29 '19 at 13:26
  • http://minuszerodegrees.net/keyboard/IBM%20PC%20family%20-%2084-key%20keyboard.jpg – roetnig Jul 29 '19 at 13:38
  • 2
    the logo in the top left of that keyboard reads "IBM Personal Computer AT". That layout was used with the PC-AT from 1984, not the original 5150 PC of 1981. See https://en.m.wikipedia.org/wiki/Model_F_keyboard#Variations – Kaz Jul 29 '19 at 14:35
  • IBM F-84 keyboard was sold in Europe with the IBM-PC 5150 and later with the XT-5160 and the PC-3270 (with card for 3270 terminal emulation) – roetnig Jul 29 '19 at 18:13
  • 12
    Windows NT ended up needing to reinvent this. There is a key combination guaranteed to take you directly to an OS menu where you can log out, start the task manager to kill a frozen program, shut down, etc. It always guarantees that you are getting the OS; it cannot be intercepted or spoofed. However, on Windows, that is Crtl-Alt-Delete, not SysRq. – Davislor Jul 30 '19 at 07:07
  • @roetnig that's interesting. I wouldn't expect the 5150 PC's BIOS to have the routine for handling the SysRq key, though. – Kaz Jul 31 '19 at 11:40
  • @Davislor: Ars has some nice history about this choice. – Igor Skochinsky Jul 31 '19 at 19:01
28

SysRq is popular because the PC AT was popular, and its clones were too. PC clone manufacturers copied all the features of the computers they were cloning, with the exception of BASIC in ROM, and that included SysRq — both the physical key, and its associated handling in ROM (interrupt 0x15 function 0x85).

Any OS or software running on the AT could end up relying on SysRq, so it became entrenched, even though in practice it wasn’t used much.

Stephen Kitt
  • 121,835
  • 17
  • 505
  • 462
19

I think you're coming at this kind of backwards. The commonly used keys are commonly used because they're on keyboards and are widely available. Software follows hardware in this instance. The system request key was put there because the hardware designers thought it would be useful, and even if they were wrong, removing keys from the standard keyboard as dictated by whatever IBM was doing would mean introducing potential incompatibilities.

Serentty
  • 476
  • 2
  • 6
16

As other answers and comments have already said, the SysRq key was first introduced with the keyboard of the PC/AT of 1984, and had parallels to similar keys on IBM mainframe keyboards.

Even if it was rarely used, keyboard manufacturers kept including it, as removing it would make their keyboard incompatible with the few pieces of software that did use it. Only in recent years have manufacturers started to drop it and other little-used keys, chiefly on laptops where space is at a premium.

So why was this key so rarely used on the home PC, rare enough that you ask whether any OS ever used it?

In the mid 1980s, only the brand-new AT (and compatibles) would have the SysRq key. If a software developer wanted to support the older XT and PC machines, they'd have to stick to using keys that existed on both keyboard variants. New versions of MS-DOS, for example, couldn't use it without losing backward compatibility with earlier machines.

As described on Wikipedia's page about the SysRq* key, it behaves differently to all other keys on the keyboard, and bypasses the keyboard buffer and the OS' usual input processing. Pressing SysRq can only be detected with a dedicated BIOS function (int. 0x15, function 0x85). Under DOS, any user application could access the BIOS functions directly, but that was no longer possible under Windows. For good or ill, the developers of Windows saw no need to make special use of this special key, other than some specialist debugging purposes.

Linux, however, does use it. The 'magic SysRq key' can be used to issue simple commands to an unresponsive computer: remounting filesystems, terminating processes, or restarting the machine. This uses SysRq's ability to bypass the normal keyboard-handling interface, and issue signals directly to the underlying operating system.

*Note: At the time of writing, the SysRq article on Wikipedia includes a weakly sourced claim that the key was meant for switching between operating systems on the PC/AT

Kaz
  • 8,086
  • 2
  • 38
  • 81
  • 2
    I might be mistaken, but I think I might remember it being used in DesqView, maybe? That was years ago, so my memory of that is fuzzy. – riffraff169 Jul 30 '19 at 22:25
  • 2
    SysRq's "ability to bypass the normal keyboard-handling interface" is restricted to the PC BIOS. Other operating systems like Linux that drive the hardware directly can treat it specially if they choose, but are not required to. – john_e Sep 25 '19 at 08:39
8

As for how it got on keyboards, I'd assume that's because the basic 104+ key IBM style keyboard had it.

Though you might not use it often, it's still got a purpose. On linux, hitting alt+sysreq allows you to send messages to the kernel even if everything else is locked up. https://en.wikipedia.org/wiki/Magic_SysRq_key I've had to use it to reboot a number of times.

bobsburner
  • 199
  • 4
0

History. It was on the original IBM keyboard for the IBM PC. Later, IBM rearranged the keys on the keyboard, but they kept the original keys. Most keyboard manufacturers copied the IBM layout because "IBM compatibility" was a big deal back then.

There are lots of useless keys on standard keyboards. There's the entire "numeric keypad" with the number-key arrangement upside down. (OK, accountants probably use it.) There's the Caps Lock key, whose existence is an annoying nuisance for most people.

For a really annoying keyboard, take a look at the Swiss keyboard. There's a key devoted to § and ° , and in order to make room for ü and some accented letters, it sacrifices | and ~ while also requiring awkward alt-key combinations for {}.

Roger
  • 33
  • 1
  • 2
    “It was on the original IBM keyboard for the IBM PC.” Not quite, it was introduced with the AT. – Stephen Kitt Jul 29 '19 at 11:11
  • 10
    The rest seems to be opinion, not an actual answer. – dave Jul 29 '19 at 11:48
  • 7
    Actually, the number-key arrangement on phones is the one that is "upside down". The first keypads were on mechanical adding machines, and computer keyboards copy that arrangement. When touch-tone (DTMF) was invented, the arrangement was intentionally inverted because some users would otherwise type too fast for the tone-recognizing circuitry. – DrSheldon Jul 29 '19 at 13:40
  • 9
    THE CAPS LOCK KEY IS NOT AN ANNOYING NUISANCE FOR ME. – TheAsh Jul 29 '19 at 14:01
  • 2
    @DrSheldon Do you have a source for the DTMF inversion? – Thorbjørn Ravn Andersen Jul 29 '19 at 14:21
  • 1
    CapsLock is great for switching keyboard language :) – Edheldil Jul 29 '19 at 16:40
  • 3
    If you find a key on the keyboard to be useless, are you sure you're using the machine correctly? – Chenmunka Jul 29 '19 at 16:42
  • 8
    Apart from the first paragraph, this answer just reads as a rant. – Chenmunka Jul 29 '19 at 16:43
  • 6
    The numeric keypad is extremely useful if you're doing a lot of numerical data entry. – David Richerby Jul 29 '19 at 16:57
  • I remember doing soft keyboard remapping to switch my caps lock and Ctrl keys to match sun keyboards, because I used that more often...for a while, anyway. – riffraff169 Jul 30 '19 at 22:27
  • 2
    And the caps-lock key is extremely useful if you are typing with the Neo2 keyboard layout. True, it's not used for the caps-lock function, Neo2 repurposes it to provide all the ASCII symbols (…_[]^!<>=&\/{}*?()-:#$|~+%"';) on the main keyboard. For me as a programmer, that's pure joy. In the end, each key on the keyboard is just a physical switch that software can put to any use it like, be it good or bad. – cmaster - reinstate monica Jul 31 '19 at 15:45
  • 1
    Caps Lock is extremely useful in any context where you want to capitalise more than ~1-3 letters at a time, and the numeric keypad is extremely useful for typing anything longer than ~1-3 digits. This... is highly inaccurate as an answer, both because it ignores common use cases for keys, and because the first paragraph is factually incorrect (as stated in another comment). I'm sorry. – Justin Time - Reinstate Monica Aug 02 '19 at 01:39
  • 1
    @DrSheldon The "type too fast" story is incorrect as far as I'm aware. Bell has a paper on the research they did when designing the telephone keypad: https://archive.org/details/bstj39-4-995 Their goals seems to have been to increase entry speed and reduce errors. – camerondm9 Aug 05 '19 at 18:15
  • ° is not a useless character at all – Oskar Skog Jun 09 '21 at 09:22