From owner-freebsd-hackers Tue Apr 3 3:35:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mimer.webgiro.com (mimer.webgiro.com [213.162.128.50]) by hub.freebsd.org (Postfix) with ESMTP id 9492337B71A for ; Tue, 3 Apr 2001 03:35:16 -0700 (PDT) (envelope-from abial@webgiro.com) Received: by mimer.webgiro.com (Postfix, from userid 66) id 7322C2DC0E; Tue, 3 Apr 2001 12:40:09 +0200 (CEST) Received: by mx.webgiro.com (Postfix, from userid 1001) id 45B65781C; Tue, 3 Apr 2001 12:31:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mx.webgiro.com (Postfix) with ESMTP id 3807110E1E; Tue, 3 Apr 2001 12:31:58 +0200 (CEST) Date: Tue, 3 Apr 2001 12:31:56 +0200 (CEST) From: Andrzej Bialecki To: Graham Wheeler Cc: freebsd-hackers@freebsd.org Subject: Re: Getting ISA device settings from kernel In-Reply-To: <3AC4A5C9.35FE775B@cequrux.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 30 Mar 2001, Graham Wheeler wrote: > Hi all > > I had some code that worked on FreeBSD 3.4 to configure ISA devices. > In order to get the ISA device settings, I used the kvm library, and > started off by extracting the name lists for _isa_devtab_tty, > _isa_devtab_bio, and _isa_devtab_net. > > I used to just give up if kvm_nlist returned a non-zero number. On > FreeBSD 4.2 this is happening. Checking the manpage, I see that this > could be that there are invalid values, so I changed the check to > only give up of the return value is negative. The code now gets past the > kvm_nlist, but fails on the first kvm_read that follows (which uses the > n_value returned by kvm_nlist as the offset field). > > Is there a different mechanism in 4.2 to do the kind of stuff I'm > trying to do? Should the code still work? libkvm is being gradually deprecated - you don't have to use it to do what you want. Please take a look at the code in src/sbin/kget - it does something very similar. Andrzej // ---------------------------------------------------------------- // Andrzej Bialecki , Chief System Architect // WebGiro AB, Sweden (http://www.webgiro.com) // ---------------------------------------------------------------- // FreeBSD developer (http://www.freebsd.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message