Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 May 2000 16:08:06 +0200
From:      Alexander Langer <alex@big.endian.de>
To:        hackers@freebsd.org, doc@freebsd.org
Subject:   controlled panic - kernel-module
Message-ID:  <20000507160806.A421@cichlids.cichlids.com>

next in thread | raw e-mail | index | archive | help

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii

Hello!

Just happened to write this kernel-module, which panics the machine.

It is, if you just set up your savecore-setup, you have to wait for a
panic to test, if it works. If this is a panic you would have liked to
savecore, and it didn't work, this can be annoying.

(At least that was my problem when setting up the savecore setup back
then) :)

Maybe something _like_ this (it depends on pci, which is not quite
useful) can be integrated to the save-core documentation in the
handbook, to make clear how to test your setup.

Comments?

Alex
-- 
I need a new ~/.sig.

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="panic.c"

/*
 * $FreeBSD$
 */

/* #include <machine/bus.h> */
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/uio.h>
#include <machine/bus.h>
#include <machine/clock.h>
#include <sys/rman.h>

/* -------------------------------------------------------------------- */

static int
panic_probe(device_t dev)
{
	panic("Controlled panic() by panic.ko");
	return(ENXIO);
}

static device_method_t panic_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		panic_probe),
	{ 0, 0 }
};

static driver_t panic_driver = {
	"panic",
	panic_methods,
	0,
};

static devclass_t panic_devclass;

DRIVER_MODULE(panic, pci, panic_driver, panic_devclass, 0, 0);

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=Makefile

# $FreeBSD$

KMOD=	panic
SRCS=	panic.c bus_if.h device_if.h

.include <bsd.kmod.mk>

--nFreZHaLTZJo0R7j--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000507160806.A421>