This procedure is called from a number of locations in the operating system. (e.g. line 1605). When circumstances exist under which continued operation of the system seems undesirable.
UNIX does not profess to be a “fault tolerant” or “fail soft” system, and in many cases the call on “panic” can be interpreted as a fairly unsophisticated response to a straightforward problem.
However more complicated responses require additional code, lots of it, and this is contrary to the general UNIX philosophy of “keep it simple”.
The reason for this statement is given in the comment beginning at line 2323;
“update” causes all the large block buffers to be written out. See Chapter Twenty;
“printf” is called with a format string and one parameter, which was passed to “panic”;
This “for” statement defines an infinite loop in which the only action is a call on the assembly language procedure “idle” (1284).
“idle” drops the processor priority to zero, and performs a “wait”. This is a “do nothing” instruction of indefinite duration. It terminates when a hardware interrupt occurs.
An infinite set of calls on “idle” is better than the execution of a “halt” instruction, since any i/o activities which were under way can be allowed to complete and the system clock can keep ticking.
The only way for the operator to recover from a “panic” is to reinitialise the system, (after taking a core dump, if desired).