From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 19 08:03:23 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 6C23416A4CE for ; Sat, 19 Mar 2005 08:03:23 +0000 (GMT) Received: from smp500.sitetronics.com (sitetronics.com [82.192.77.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A18FB43D48 for ; Sat, 19 Mar 2005 08:03:22 +0000 (GMT) (envelope-from dodell@offmyserver.com) Received: from localhost.sitetronics.com ([127.0.0.1] helo=smp500.sitetronics.com) by smp500.sitetronics.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.50 (FreeBSD)) id 1DCYuW-000M1Y-9R for freebsd-hackers@freebsd.org; Sat, 19 Mar 2005 09:02:16 +0100 Received: (from dodell@localhost) by smp500.sitetronics.com (8.12.11/8.12.11/Submit) id j2J82FXv084663 for freebsd-hackers@freebsd.org; Sat, 19 Mar 2005 09:02:15 +0100 (CET) (envelope-from dodell@offmyserver.com) X-Authentication-Warning: smp500.sitetronics.com: dodell set sender to dodell@offmyserver.com using -f Date: Sat, 19 Mar 2005 09:02:15 +0100 From: "Devon H. O'Dell " To: freebsd-hackers@freebsd.org Message-ID: <20050319080215.GX51688@smp500.sitetronics.com> Mail-Followup-To: freebsd-hackers@freebsd.org References: <20050318160528.GQ51688@smp500.sitetronics.com> <20050318.155553.41699848.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="//h4sZKAxcnndsN6" Content-Disposition: inline In-Reply-To: <20050318.155553.41699848.imp@bsdimp.com> User-Agent: Mutt/1.5.8i 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: Sat, 19 Mar 2005 08:03:23 -0000 --//h4sZKAxcnndsN6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 18, 2005 at 03:55:53PM -0700, Warner Losh wrote: > > 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 Rather, I have no way to identify that the system has the device :). > > options ZT5503 >=20 > 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. >=20 > 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). OK. I don't know a hell of a lot about how the ISA bus works, though I suppose that I remember that things using the old SB 16 cards (Wolfenstein, anyone?) would simply probe various I/O ports. Unfortunately, in my case, there are really no board specific I/O registers that will give me information I can detect (or so it seems =66rom the manufacturer's manuals), though I am going to write a couple of tests today to read some of these registers and see if there is any useful information contained within them which I might use to probe. Assuming no useful information exists, is it enough to let the device attach regardless if the user has device zt5503 in the configuration file? Maxime suggested that I use device hints to gather the port and such. Where should I put these hints? NOTES? If I understand correctly, to hook this up into the build, I will still have a line in files which will look something like: dev/ziatech/zt5503.c optional zt5503 Hm, Ziatech is now Performance Technologies. Should that perhaps be dev/pt then instead? > > existing in the kernel configuration file. I have a couple of > > related questions: > >=20 > > 1) Where in the tree should my zt5503wd.c file be placed? >=20 > 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. Yeah, I figured I'd ask Matt or Joerg where it'd best go there :). I Think the preferred location was dev/misc/foo as you suggest. > > 2) Regarding watchdog.h; this device supports other times than those > > provided from between 250MS to 256S. Hope nobody minds this changing > > :). >=20 > Nope. :-) Ok then :) > > 3) To make sure I understand how this works: > > o The device is compiled in / loaded >=20 > 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. Another good reason to not write it as such. > > 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 >=20 > These don't look like questions... They're not stated as such; I've only taken a brief look around the=20 watchdog functionality and I just wanted to confirm that this is how the stuff works so I don't end up goofing it up :). >=20 > Warner Thanks for the help! --Devon --//h4sZKAxcnndsN6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCO9yHSkf3jVXOdl0RAgWeAJ9Xj/fNAFWyxapuEYFe5huf+rx1EQCeNGcq +pEol+Pc5c+XfWBYknPRflI= =kwXO -----END PGP SIGNATURE----- --//h4sZKAxcnndsN6--