Reputation: 1027
Is there any way I can crash a kernel on purpose (e.g., kernel panic, blue screen, black screen, or whatever). Assume I can change any registers and have administrative privilege of the system. I would like to demonstrate this on both Windows and Linux platforms.
Thanks for any inputs!
Upvotes: 2
Views: 1935
Reputation: 6768
There are several ways to do this:
BUG()
or BUG_ON()
.echo c > /proc/sysrq-trigger
, with this make sure to install kdump if you are interested in capturing a vmcore file.Upvotes: 2
Reputation: 180010
In Linux, you must compile the kernel with the CONFIG_MAGIC_SYSRQ option, then you can crash the kernel by writing the crash command into /proc/sysrq-trigger
, or by pressing Alt+SysRq+C.
See the documentation for details.
In Windows, you must set the CrashOnCtrlScroll
registry key for the keyboard driver, and reboot, then you can press Ctrl+Scroll Lock to crash the kernel.
See the documentation for details.
Upvotes: 2