Tag Info

Hot answers tagged

8

I found the solution myself just after asking this question. To switch back the console in which X is running (usually tty7), from ASCII mode to RAW mode execute the following command: sudo kbd_mode -s -C /dev/tty7 And now everything works as expected again. :) More information available in the question: What does raw/unraw keyboard mode mean?


8

When you press a key on your keyboard, it sends a numeric code to the computer, called a scan code. The scan code tells the computer which key was pressed; for example, on a typical US keyboard, the A key sends the scan code 30 when you press it (and 158 when you release it). The keyboard driver reports these codes directly to applications when the keyboard ...


5

Forget about REISUB. I don't know who invented this, but it's overly complicated: half the steps are junk. If you're going to unmount and reboot, you only need two steps: U and B. At most three steps E, U, B. Alt+SysRq+R resets the keyboard mode to cooked mode (where typing a character inserts that character). That's useful if a program died and left the ...


5

Assuming you have a kernel with the debugger option compiled in you can use ControlAltEscape. From there you can call boot(0) or panic. Chapter 10 of the FreeBSD developers handbook explains this in a lot more detail. So much for more or less the same as SysReq via a keyboard. On the serial console, you need to send the break signal and have the options ...


4

You can define which type of code your keyboard sends. This is done via the keyboard mode. You can change the mode of a keyboard with kbd_mode. These are the options from the manpage: -s: scancode mode (RAW), -k: keycode mode (MEDIUMRAW), -a: ASCII mode (XLATE), -u: UTF-8 mode (UNICODE). Its much easier for a developer to catch key events ...


4

On a typical laptop, you need to press the Fn key to press SysRq. If you also press the letter in the same movement, you end up pressing Fn+Alt+SysRq+letter. But several letters are mapped to numeric keypad keys when combined with Fn. For example, if you try to press Alt+SysRq+U, you end up pressing Alt+SysRq+Num4 instead. To avoid this pitfall, press and ...


3

Apparently, it can be enabled/disabled using /proc/sys/kernel/sysrq if the kernel supports it, i.e., CONFIG_MAGIC_SYSRQ is enabled in the kernel config what should be the case for Slackware, according to this.


2

This should work if sysrq is enabled in the kernel (tested live on my machine): # echo "h" > /proc/sysrq-trigger Requires root access. The SysRq keys are not regular keys handled by X, thus xdotool can't trigger the magic keys because it interacts with Xorg itself, not the kernel. Thankfully the kernel provides a special file to trigger them from ...


2

The documentation for sysrq is in the linux source code (https://github.com/torvalds/linux/blob/master/Documentation/sysrq.txt). I very highly recommend that you read it. Is SysRq key enabled? First, please ensure that the use of the magic SysRq key is enabled: $ cat /proc/sys/kernel/sysrq 1 If it says 0 then SysRq is disabled. You can enable it with: ...


1

I was curious to see if you could inject the SysRq keypress using the Linux uinput device, so I added some code to another small project and it seems to be possible. But as was already noted, of course you need to have root access for this as well. For this particular key combination, I'd have to execute: ./sendevtkeys /dev/uinput 56 99 35 where 56 ...


1

Here you go. It's in the kernel mainline, selectable by config. Basically, sysrq enables/disables the physical magic, the others are for programmed control. The doc's pretty straightforward.



Only top voted, non community-wiki answers of a minimum length are eligible