From: chip@chinacat.unicom.com (Chip Rosenthal)
Subject: Re: crashing SVR4 i386
Organization: Unicom Systems Development, Austin, TX
Date: Fri, 06 Nov 1992 05:54:24 GMT

In article <1992Oct29.203840.15893@bradley.bradley.edu>
	brad@bradley.bradley.edu (Bradley E. Smith) writes:
>does anyone know how to make a machine panic at will? from the console?

Some folks have always believed I'm a bit twisted.  Here is proof
positive.

Attached is a device driver for /dev/panic.  Just say "cat /dev/panic"
and your system will come tumbling down.  This is for a V3.2 system.
I'm not sure if it would be applicable to your machine.  If so, you
should be able to just unbundle this somewhere and then type "sh
doinstall i".

I guess the normal disclaimer on freeware sources doesn't apply.
This *will* break your system!

#! /bin/sh
# this is a "shar" archive - run through "/bin/sh" to extract 6 files:
#   Driver.c Makefile Master Node System doinstall
# Wrapped by chip@chinacat on Thu Nov 05 23:44:30 CST 1992
# Unpacking this archive requires:  sed test wc (possibly mkdir)
# Existing files will not be clobbered unless "-c" is specified on the cmd line.
if test -f Driver.c -a "$1" != "-c" ; then
    echo "Driver.c: file exists - will not be overwritten"
else
    echo "x - Driver.c (file 1 of 6, 85 chars)"
    sed -e 's/^X//' << 'END_OF_FILE_Driver.c' > Driver.c
X#include <sys/errno.h>
Xpncopen()
X{
X	panic("user-requested panic");
X	seterror(EIO);
X}
END_OF_FILE_Driver.c
    size="`wc -c < Driver.c`"
    if test 85 -ne "$size" ; then
	echo "Driver.c: extraction error - got $size chars"
    fi
fi
if test -f Makefile -a "$1" != "-c" ; then
    echo "Makefile: file exists - will not be overwritten"
else
    echo "x - Makefile (file 2 of 6, 68 chars)"
    sed -e 's/^X//' << 'END_OF_FILE_Makefile' > Makefile
XSHELL = /bin/sh
XCC = cc
XCFLAGS = -K -Zp4 -DINKERNEL
X
Xall:	Driver.o
X
END_OF_FILE_Makefile
    size="`wc -c < Makefile`"
    if test 68 -ne "$size" ; then
	echo "Makefile: extraction error - got $size chars"
    fi
fi
if test -f Master -a "$1" != "-c" ; then
    echo "Master: file exists - will not be overwritten"
else
    echo "x - Master (file 3 of 6, 27 chars)"
    sed -e 's/^X//' << 'END_OF_FILE_Master' > Master
Xpanic	o	ico	pnc	0	0	1	1	-1
END_OF_FILE_Master
    size="`wc -c < Master`"
    if test 27 -ne "$size" ; then
	echo "Master: extraction error - got $size chars"
    fi
fi
if test -f Node -a "$1" != "-c" ; then
    echo "Node: file exists - will not be overwritten"
else
    echo "x - Node (file 4 of 6, 16 chars)"
    sed -e 's/^X//' << 'END_OF_FILE_Node' > Node
Xpanic	panic	c	0
END_OF_FILE_Node
    size="`wc -c < Node`"
    if test 16 -ne "$size" ; then
	echo "Node: extraction error - got $size chars"
    fi
fi
if test -f System -a "$1" != "-c" ; then
    echo "System: file exists - will not be overwritten"
else
    echo "x - System (file 5 of 6, 24 chars)"
    sed -e 's/^X//' << 'END_OF_FILE_System' > System
Xpanic	Y	1	0	0	0	0	0	0	0
END_OF_FILE_System
    size="`wc -c < System`"
    if test 24 -ne "$size" ; then
	echo "System: extraction error - got $size chars"
    fi
fi
if test -f doinstall -a "$1" != "-c" ; then
    echo "doinstall: file exists - will not be overwritten"
else
    echo "x - doinstall (file 6 of 6, 528 chars)"
    sed -e 's/^X//' << 'END_OF_FILE_doinstall' > doinstall
X:
X
Xcase "$1" in
X
Xu*)
X	(
X		set -x
X		/etc/conf/bin/idinstall -d panic 
X		rmdir /etc/conf/pack.d/panic
X		rm /dev/panic
X	)
X	;;
X
Xi*)
X	(
X		if [ -f /etc/conf/pack.d/panic/Driver.o ] ; then
X			echo "$0: please perform uninstall first" 1>&2
X			exit 1
X		fi
X		if [ ! -f Driver.o ] ; then
X			make Driver.o
X		fi
X		set -xe
X		mkdir panic$$
X		cp Driver.o Master Node System panic$$
X		cd panic$$
X		/etc/conf/bin/idinstall -a panic 
X		cd ..
X		rmdir panic$$
X	)
X	;;
X
X*)
X	echo "usage: $0 { i[nstall] | u[ninstall] }" 1>&2
X	exit 1
X	;;
X
Xesac
X
Xexit 0
X
END_OF_FILE_doinstall
    size="`wc -c < doinstall`"
    if test 528 -ne "$size" ; then
	echo "doinstall: extraction error - got $size chars"
    fi
fi
echo "done - 6 files extracted"
exit 0

-- 
Chip Rosenthal  512-482-8260 | I got the blues so bad one time
Unicom Systems Development   | it put my face in a permanent frown.
<chip@chinacat.Unicom.COM>   |   - Taj Mahal
Newsgroups: comp.unix.sysv386