Best way to handle crashes in an OS
Posted: Tue Feb 13, 2018 8:36 am
Hi folks
I have a hobby OS that boots and does some minimalistic stuff. During development I regularly have crashes or hit assert statements in my code. Currently my exception handler prints registers state and hangs.
I am looking a way to improve debuggability of my crashed system. In particular I would love to have
1) an easy way to see desymbolized stack trace at the OS console
2) an easy way to inspect memory of live/crashed system
As of 1) I believe the standard solution is to use libbacktrace. Does anybody have an experience integrating this library into kernel code? How well this library works with binaries compiled with Link-Time-Optimization?
As of 2), does anybody integrated "memory inspection" feature into their OS? I am looking for a [ur=https://github.com/crash-utility/crash]crash[/url]-like tool that would allow to inspect data structures of a running or crashed system. Does anybody have any pointers how it can be achieved? In particular does QEMU/you-virtual-machine allow to store memory dump to filesystem on exception? Is there any way to store memory dump for a system that runs on bare hardware?
Thank you in advance. Any pointers/additional information is welcome.
I have a hobby OS that boots and does some minimalistic stuff. During development I regularly have crashes or hit assert statements in my code. Currently my exception handler prints registers state and hangs.
I am looking a way to improve debuggability of my crashed system. In particular I would love to have
1) an easy way to see desymbolized stack trace at the OS console
2) an easy way to inspect memory of live/crashed system
As of 1) I believe the standard solution is to use libbacktrace. Does anybody have an experience integrating this library into kernel code? How well this library works with binaries compiled with Link-Time-Optimization?
As of 2), does anybody integrated "memory inspection" feature into their OS? I am looking for a [ur=https://github.com/crash-utility/crash]crash[/url]-like tool that would allow to inspect data structures of a running or crashed system. Does anybody have any pointers how it can be achieved? In particular does QEMU/you-virtual-machine allow to store memory dump to filesystem on exception? Is there any way to store memory dump for a system that runs on bare hardware?
Thank you in advance. Any pointers/additional information is welcome.