Specifications

D
evice Driver Programming
15-16
#0>
#0>bk all
#0>r
00:
00: The system is coming up. Please wait.
00:
00: hsa: Adapter 8 configured in slot 10.
00: SCSI disk @ID 0 on hsa adapter 8.
00: hsa: Adapter 9 configured in slot 11.
00: SCSI disk @ID 0 on hsa adapter 9.
00: hs8 scsi id 0: Generic Fujitsu settings established.
Checking root filesystem
Node: betsy
Checking /var filesystem
INIT: :option: boot to single user mode.
INIT: :SINGLE USER MODE
Type Ctrl-d to proceed with normal startup,
(or give root password for Single User Mode):
Using crash to Debug a Driver 15
The crash(1M) utility allows you to analyze how your driver interacts with the core
image of the operating system. It is most frequently used in postmortem analysis of a
system panic, but can also be run on an active system. The output from crash can help
you identify such driver errors as corrupted data structures and pointers to the wrong
address. Its shortcoming as a debugging tool is that it is difficult to freeze the core image at
exactly the point where the error occurred; even if the error causes a system panic, the core
image might be far beyond the point of actual error. This is especially true when debug-
ging an intelligent board, because an autonomous intelligent controller continues process-
ing even though you have halted kernel-level processing on the main memory. Moreover,
for intelligent boards, the crash dump cannot get at the onboard data structures.
NOTE
Using the crash command requires a thorough knowledge of
assembler, of reading core dumps, and of systems programming
concepts. The need to know assembler cannot be overemphasized.
The crash output is displayed in assembler mnemonics and as
strings of hex numbers that must be translated into address loca-
tions, stack frames, and memory offsets.
Saving the Core Image of Memory 15
To run crash as a postmortem analysis on a panicked system, you must save the core
image of memory before rebooting the system and have a copy of the bootable kernel
image (/stand/unix file) that was running.