From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 18 22:57:29 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7FB816A4CE for ; Fri, 18 Mar 2005 22:57:29 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 367D543D1F for ; Fri, 18 Mar 2005 22:57:29 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j2IMtrpt068544; Fri, 18 Mar 2005 15:55:54 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 18 Mar 2005 15:55:53 -0700 (MST) Message-Id: <20050318.155553.41699848.imp@bsdimp.com> To: dodell@offmyserver.com From: Warner Losh In-Reply-To: <20050318160528.GQ51688@smp500.sitetronics.com> References: <20050318160528.GQ51688@smp500.sitetronics.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: hackers@freebsd.org Subject: Re: Ziatech 5503 watchdog driver X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2005 22:57:29 -0000 > I'm busy writing a Ziatech 5503 watchdog driver for FreeBSD (and > porting all the watchdog stuff to DragonFly BSD) and Plan 9. For my > driver, I have no way to identify that the system has the driver, so > I wanted to make it conditional on > > options ZT5503 That's not a good enough reason to make it an option, it should really be a device. Users that want it can add it to their kernel config. In fact, they'd have to add it either way, so why make it weird for them. Put this device on the ISA bus, give it an identify routine that always adds it (this isn't GENERIC safe, but since there's no way to know the device is there, you are stuck with that). > existing in the kernel configuration file. I have a couple of > related questions: > > 1) Where in the tree should my zt5503wd.c file be placed? usually these thigns go in dev/foo/foo.c. However FreeBSD and DragonFly have differeing layouts. FreeBSD has a modules subtree to build modules, while DF has it in the dev tree. The dev tree is also partitioned so it would be in dev/misc/foo/foo.c. > 2) Regarding watchdog.h; this device supports other times than those > provided from between 250MS to 256S. Hope nobody minds this changing > :). Nope. :-) > 3) To make sure I understand how this works: > o The device is compiled in / loaded You'll need to make it a real device if you want loading to work. The alternative is to make it a pseudo-device, but that's more hassle than it is worth since you need to access resources. An option definitely won't work. > o watchdogd is used to tell the system to start the timer > o I get a bunch of flags in my eventhandler function's 2nd > argument that I can then use to write to my device's > registers with the proper information These don't look like questions... Warner