The panic() routine


Let's talk about how panic() actually works. The panic() routine abruptly interrupts all normal scheduling of processes. From the user 's point of view, the system is suddenly dead.

panic() copies the contents of the memory in use to a dump device. By default, the dump device is usually the primary swap device. It is rare to see a system that specifically has a separate chunk of disk set aside solely for dumps; however, it can be set up that way. On most UNIX systems, the dump device must be a disk partition. On some, a tape drive may be specified.

The dump image is written to the back end or high end of the dump device, unless a tape drive is in use. The beginning and end of this image contain a duplicated header record that includes a special code, called a magic number. The magic number simply identifies the current contents of the dump device as a system crash dump image. The duplication of the header record is used to identify whether the dump image has been partially overwritten by swap activity.

panic() records critical information about the current state of the Central Processing Unit, or CPU, that called panic() . This information includes the CPU registers, the stack pointer, and various state registers. We will be looking at these in greater detail later on.

We will talk about how to retrieve the system crash dump image of memory in Chapter 3, when we discuss using the savecore command. For now, it is important to note that unless you set aside a special dump device, if for no other reason than being prepared for a panic, your primary swap device should be large enough to hold a complete image of memory.

Once panic() has completed its task of dumping memory to the dump device, it initiates a reboot of the system.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net