Reputation: 1326
Is it possible to intentionally crash the kernel at specific point during the course of its execution (by inserting some C statement there Or otherwise) and then collect the corefile for analysis using normal gdb program ? Can somebody pls share the steps and what needs to be done.
Upvotes: 1
Views: 200
Reputation: 213385
Is it possible to intentionally crash the kernel
Sure: just insert a call to panic()
in desired place.
The easiest way to do this is using user-mode linux. The kernel becomes just a regular program, and you can execute it under GDB the usual way, setting breakpoints, looking at variables, etc.
If you need to do "bare metal" execution, you should probably start here or here.
Upvotes: 2