From owner-freebsd-drivers@FreeBSD.ORG Sun Jan 29 12:13:43 2012 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DAF8106564A for ; Sun, 29 Jan 2012 12:13:43 +0000 (UTC) (envelope-from g.s@arcor.de) Received: from mail-in-17.arcor-online.net (mail-in-17.arcor-online.net [151.189.21.57]) by mx1.freebsd.org (Postfix) with ESMTP id 236C38FC12 for ; Sun, 29 Jan 2012 12:13:42 +0000 (UTC) Received: from mail-in-16-z2.arcor-online.net (mail-in-16-z2.arcor-online.net [151.189.8.33]) by mx.arcor.de (Postfix) with ESMTP id 0F6D8CD199 for ; Sun, 29 Jan 2012 13:13:41 +0100 (CET) Received: from mail-in-18.arcor-online.net (mail-in-18.arcor-online.net [151.189.21.58]) by mail-in-16-z2.arcor-online.net (Postfix) with ESMTP id 0C7F13FE122 for ; Sun, 29 Jan 2012 13:13:41 +0100 (CET) Received: from [192.168.0.95] (178-27-25-16-dynip.superkabel.de [178.27.25.16]) (Authenticated sender: g.s@arcor.de) by mail-in-18.arcor-online.net (Postfix) with ESMTPSA id CC4DB15C00A for ; Sun, 29 Jan 2012 13:13:40 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-18.arcor-online.net CC4DB15C00A DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1327839221; bh=WiP8wMDLD3nidL3KK+pkV2jtWSWmyjKyZz+e530+6d4=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=O5DGNQMVf0GlJduEV6qtwDTLgWU6bJaSNecj01ovdRRQXwoa89xUthGDLUYfAmsxI SHE0tf8Cwqd60hfeZ0slx1HDcVOLMhEQRPGPtWmYu2yO0SL9xC2Zf6s2YjA29DTJTU 2gBsVvwFlv7alOspWR3Iaypguc/NVQEoR2KIxo0o= Message-ID: <4F2537E0.50907@arcor.de> Date: Sun, 29 Jan 2012 13:13:20 +0100 From: Gerhard Strangar User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1.24) Gecko/20100228 MIME-Version: 1.0 To: freebsd-drivers@freebsd.org References: <4F1BEE87.6080303@arcor.de> <20120122135703.15810f3f@davenulle.org> In-Reply-To: <20120122135703.15810f3f@davenulle.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Introduction to writing kernel modules X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:13:43 -0000 Patrick Lamaiziere wrote (2012-01-22 13:57): > There is a facility for watchdogs, you should use it. You only have to > register you watchdog in the kernel and watchdogd(8) is used to > control the watchdog from userland. I guess the character device is much easier to implement. However, my current problem is that a manged to compile something and all it does is crash the kernel. Is there a way of debugging this without going through reboot and fsck - maybe an intermediate kernel module, a kernel simluator? I mean, I can'T set up a virtual machine if a want to talk to real hardware. From owner-freebsd-drivers@FreeBSD.ORG Sun Jan 29 19:26:23 2012 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D18EE106564A for ; Sun, 29 Jan 2012 19:26:23 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id 775958FC0A for ; Sun, 29 Jan 2012 19:26:23 +0000 (UTC) Received: (qmail 6504 invoked by uid 0); 29 Jan 2012 19:26:22 -0000 Received: from 67.206.161.175 by rms-us007.v300.gmx.net with HTTP Content-Type: text/plain; charset="utf-8" Date: Sun, 29 Jan 2012 14:26:19 -0500 From: "Dieter BSD" Message-ID: <20120129192621.300970@gmx.com> MIME-Version: 1.0 To: freebsd-drivers@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: CvhXb/UU3zOlNR3dAHAhBrx+IGRvb4CQ Subject: Re: Introduction to writing kernel modules X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 19:26:23 -0000 > all it does is crash the kernel. Is there a way of debugging this > without going through reboot and fsck At the risk of pointing out the obvious, you can reduce/eliminate fsck by booting to single user mode, or you can umount or mount -u -r as many filesystems as possible before loading your module. > I can'T set up a virtual machine if a want to talk to > real hardware. It might be that the crash happens before it needs access to hardware? IIRC there is a way to allow bochs access to hardware, although I'd guess it is unlikely to have support for the device you're working on.