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.
/* * $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);
# $FreeBSD$ KMOD= panic SRCS= panic.c bus_if.h device_if.h .include <bsd.kmod.mk>