From owner-freebsd-current Wed May 12 1:46: 4 1999 Delivered-To: freebsd-current@freebsd.org Received: from eagle.phc.igs.net (eagle.phc.igs.net [207.210.17.201]) by hub.freebsd.org (Postfix) with ESMTP id 1CABA14C12 for ; Wed, 12 May 1999 01:46:00 -0700 (PDT) (envelope-from eagle@eagle.phc.igs.net) Received: by eagle.phc.igs.net (Postfix, from userid 1003) id 0017B189D; Wed, 12 May 1999 03:45:29 +0000 (GMT) Date: Wed, 12 May 1999 03:45:29 +0000 From: Robert Garrett To: Poul-Henning Kamp Cc: current@FreeBSD.ORG Subject: Re: simple (but important) task for junior kernel hacker Message-ID: <19990512034529.A5516@phc.igs.net> References: <19990512033344.E21016@phc.igs.net> <3916.926498321@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <3916.926498321@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 12 May 1999 at 10:38:41 +0200, Poul-Henning Kamp wrote: > In message <19990512033344.E21016@phc.igs.net>, Robert Garrett writes: > >On Wed, 12 May 1999 at 10:04:09 +0200, Poul-Henning Kamp wrote: > >> > >> I don't have time just now to attend this particular detail, which > >> manifests itself by swapinfo/pstat -p showing "/dev/(null)" for > >> device name. > >> > >> The problem in short is that libkvm:kvm_getswapinfo.c has it's > >> fingers in the kernels memory and pulls out a dev_t without knowing > >> how to (and it shouldn't be taught this!) convert it to a udev_t. > >> > >> The Right Way to solve this problem is to rewrite libkvm:kvm_getswapinfo.c > >> to pick up the information using some (for this purpose constructed) > >> sysctl variables (sysctlbyname(3) please!), and let the kernel convert > >> the dev_t to udev_t before passing it out to userland. > >> > >> So for any aspiring kernel hackers out there: have at it. Patches > >> accepted. > >> > >> In general libkvm should not grovel around in a running kernel but > >> only use sysctlbyname(3). > >> > >> -- > >the only place in the entire libkvm where a dev_t is used is > >kvm_proc.c line 230 this particular section completely looses me > > There is a dev_t passed out to pstat -s in a datastructure. Right and thats where it comes from kvm_proc.c is responsible for dealing with pstat at least the way I read that file Rob > > -- > Poul-Henning Kamp FreeBSD coreteam member > phk@FreeBSD.ORG "Real hackers run -current on their laptop." > FreeBSD -- It will take a long time before progress goes too far! > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message