From owner-freebsd-questions Thu Nov 18 10:17:24 1999 Delivered-To: freebsd-questions@freebsd.org Received: from yana.lemis.com (yana.lemis.com [192.109.197.140]) by hub.freebsd.org (Postfix) with ESMTP id 4762214D82 for ; Thu, 18 Nov 1999 10:17:08 -0800 (PST) (envelope-from grog@mojave.sitaranetworks.com) Received: from mojave.sitaranetworks.com (mojave.sitaranetworks.com [199.103.141.157]) by yana.lemis.com (8.8.8/8.8.8) with ESMTP id EAA25184; Fri, 19 Nov 1999 04:46:54 +1030 (CST) (envelope-from grog@mojave.sitaranetworks.com) Message-ID: <19991118131620.50699@mojave.sitaranetworks.com> Date: Thu, 18 Nov 1999 13:16:20 -0500 From: Greg Lehey To: Cliff Addy , freebsd-questions@FreeBSD.ORG Subject: Re: Programming question Reply-To: Greg Lehey References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: ; from Cliff Addy on Thu, Nov 18, 1999 at 12:03:20PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thursday, 18 November 1999 at 12:03:20 -0500, Cliff Addy wrote: > I'm looking at a watchdog card to integrate into our servers here. To use > it, according to the docs, we need to write a C program that will "read > I/O register 180H." > > I'm a fairly experienced C programmer, but not sure how this would be > accomplished in FreeBSD. Any care to give me a code snippet that does > this? Well, to do it right, it's not a code snippet. You need a driver: userland shouldn't access I/O registers directly. There are ways around this restriction, but you shouldn't use them unless you have a *very* good reason. Having said that, the code itself is trivial: #include ... value = inb (0x180); This assumes that you're reading a byte; look at cpufunc.h for the gory details. Greg -- When replying to this message, please copy the original recipients. For more information, see http://www.lemis.com/questions.html Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message