From owner-freebsd-small Tue Apr 24 9: 7: 6 2001 Delivered-To: freebsd-small@freebsd.org Received: from mimer.webgiro.com (mimer.webgiro.com [213.162.131.14]) by hub.freebsd.org (Postfix) with ESMTP id 913C937B423 for ; Tue, 24 Apr 2001 09:06:59 -0700 (PDT) (envelope-from abial@webgiro.com) Received: from mx.webgiro.com (unknown [192.168.10.2]) by mimer.webgiro.com (Postfix) with ESMTP id C85C11003EE; Tue, 24 Apr 2001 19:19:32 +0200 (CEST) Received: by mx.webgiro.com (Postfix, from userid 1001) id D07BC7817; Tue, 24 Apr 2001 18:06:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mx.webgiro.com (Postfix) with ESMTP id CAF2010E1E; Tue, 24 Apr 2001 18:06:44 +0200 (CEST) Date: Tue, 24 Apr 2001 18:06:38 +0200 (CEST) From: Andrzej Bialecki To: Gunther Schadow Cc: freebsd-small@freebsd.org Subject: Re: PicoBSD's kernel, /dev/kmem, and the kernfs In-Reply-To: <3AE59808.E1CC8B49@aurora.regenstrief.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 24 Apr 2001, Gunther Schadow wrote: > Hi, > > trying to use the ipfilter suite with PicoBSD poses problems. Ipfstat > uses /kernel and /dev/kmem to read the filter statistics and this seems > not available on PicoBSD. Sure this is because the PicoBSD kernel is > without any symbols and is gzipped, and is not even in the root file > system. There are all good reasons why this is so (even if PicoBSD is > used from a flash ROM instead of a floppy.) But could one not make > kernel and kmem available anyway using the kernfs virtual file system? > I could imagine that we need not absolutely strip the kernel from its > symbol table. We could still gzip the kernel. Given that the kernel > is loaded into physical memory, could it not be accessible from there > to the kernfs virtual file system? Or mapped into the mfs root file > system? How hard would it be? > > There are a number of system tools that use kernel and kmem, moving ********* "a rapidly decreasing number"... > all of them to something like sps and vm etc. would be a lot of > repetitive work, there should be a more fundamental solution... > > Any thoughts? > -Gunther Well, the general trend in FreeBSD kernel development is to phase out all /dev/kmem access, even when wrapped with libkvm calls, using sysctl(9) instead. Groping through kernel memory is Bad. Sysctl(9) presents consistent, safe, and well-defined interface. The utilities like vm, ns, and others are in fact now much closer to the standard utilities, because recently most (if not all) kvm_* calls in the latter have been replaced with sysctl calls. So, the fundamental solution is to move everything that needs to access from user-space any internal kernel data structures either to a device or a sysctl. Consequently, my POV on this is: if ipfilter uses /dev/kmem, then it should be fixed. 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-small" in the body of the message