When I first read this, I figured a call to panic() would likely bring down the system or set it in motion to abort before the frag explodes . Maaaybe I’ve just lived in a world where the Blue Screen Of Death (BSOD, a Microsoft copyright) is prevelent a little to long. The idea that it calls update(“which I have yet to disect”), prints an error message and calls the kernels idle() loop times infinty is neat. Rather then bringing the system to a screeching halt right then and there. At first glance I would’ve expected it to take down the system right bam’n’slam now.
/*
* Panic is called on unresolvable
* fatal errors.
* It syncs, prints "panic: mesg" and
* then loops.
*/
panic(s)
char *s;
{
panicstr = s;
update();
printf("panic: %sn", s);
for(;;)
idle();
}
Of course from the fine book for study. It seems the only way out of a panic() attack is a restart any way, but its not an instant ‘crash, have a nice foo&ing day, rebooting now sucker’ kind of thing. Which interestingly a lot of times my Windows machines have gone down, *cough*. Its kind of been to the BSOD what the expression ‘Do not pass go, do not collect $200’ is to monopoly. It dies, you get an error, but it kills itself before you get to read it. Then tells you it was *probably* a driver issue lol.
Note that the above code snippet is probably under the this license.
It is from UNIX Version 6 as viewed from here. File is /usr/src/sys/kern/prf.c