From owner-freebsd-doc Sun May 7 7: 8:22 2000 Delivered-To: freebsd-doc@freebsd.org Received: from mail.surf1.de (mail.Surf1.de [194.25.165.21]) by hub.freebsd.org (Postfix) with ESMTP id 43E3237B655; Sun, 7 May 2000 07:08:12 -0700 (PDT) (envelope-from alex@cichlids.com) Received: from cichlids.com (p3E9D38D9.dip0.t-ipconnect.de [62.157.56.217]) by mail.surf1.de (8.9.3/8.9.3) with ESMTP id PAA09820; Sun, 7 May 2000 15:06:49 +0200 Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by cichlids.com (Postfix) with ESMTP id D5391AC2C; Sun, 7 May 2000 16:12:56 +0200 (CEST) Received: (from alex@localhost) by cichlids.cichlids.com (8.9.3/8.9.3) id QAA00473; Sun, 7 May 2000 16:08:06 +0200 (CEST) (envelope-from alex) Date: Sun, 7 May 2000 16:08:06 +0200 From: Alexander Langer To: hackers@freebsd.org, doc@freebsd.org Subject: controlled panic - kernel-module Message-ID: <20000507160806.A421@cichlids.cichlids.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nFreZHaLTZJo0R7j" X-Mailer: Mutt 1.0.1i X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --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 */ #include #include #include #include #include #include #include #include #include #include #include /* -------------------------------------------------------------------- */ 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 --nFreZHaLTZJo0R7j-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message