Manual kernel panic

How do I intentionally make kernel into panicing by using some cmd or key combination as a root? :stud
 
crsd said:
Code:
> sysctl -d debug.kdb.panic
debug.kdb.panic: set to panic the kernel

Nothing happens, even after reboot.
I have GENERIC kernel.

Is it true, that I have to compile ddb as aragon said?
 
Seeker said:
Nothing happens, even after reboot.
I have GENERIC kernel.

Is it true, that I have to compile ddb as aragon said?
Read ddb(4):
In order to enable kernel debugging facilities include:
options KDB
options DDB

Do you see any of these options in the GENERIC kernel configuration /usr/src/sys/i386/conf/GENERIC?
 
AFAIK the ctrl-alt-esc key combination invokes the debugger. This isn't really a panic. If you want a 'real' panic this should probably do:
C:
#include <sys/types.h>
#include <sys/systm.h>

main() {
panic("Danger Will Robinson, danger!");
}

See panic(9).
 
Last edited by a moderator:
Hey guys! I just found something. :stud

So... Theory is to do something, at the lowest layer possible and then get rid of all surplus layers.

First we need to do:
Rich (BB code):
# sysctl machdep.enable_panic_key=1

Now we need to create panic keyboard binding, which doesn't exist with default FreeBSD's setup - "us"

To this list:
Code:
kbdmap -p
I need to add panic, which is activated (As I have choosen), by pressing Esc + p

So to the current kbd layout, I need to append just this one panic button

Now, how do I add and where: (I got to run now, so)
Code:
panic 'esc' ( 'p' )

Then panic would be achieved by pressing Esc+p
 
Last edited by a moderator:
Back
Top