This is a simple Linux kernel module that prints a message and then triggers a kernel panic after 5 seconds.
Tested on Ubuntu 24.04 with Linux kernel 6.14.0-24-generic, running under VirtualBox.
panic_module.c: The kernel module source.Makefile: For building the module.
make
sudo insmod panic_module.ko
# Wait for panic...
# After reboot, check logs:
journalctl -k -b -1 | grep panic_module