From owner-freebsd-arch Wed Jul 12 18:17:48 2000 Delivered-To: freebsd-arch@freebsd.org Received: from relay.butya.kz (butya-gw.butya.kz [212.154.129.94]) by hub.freebsd.org (Postfix) with ESMTP id 2672E37BDB5 for ; Wed, 12 Jul 2000 18:17:44 -0700 (PDT) (envelope-from bp@butya.kz) Received: from bp (helo=localhost) by relay.butya.kz with local-esmtp (Exim 3.15 #1) id 13CXd4-0004Ar-00; Thu, 13 Jul 2000 08:17:30 +0700 Date: Thu, 13 Jul 2000 08:17:30 +0700 (ALMST) From: Boris Popov To: Andrzej Bialecki Cc: freebsd-arch@freebsd.org Subject: Re: SysctlFS In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 12 Jul 2000, Andrzej Bialecki wrote: > I've been tweaking the sysctls here and there for some time now, and I'd > like to see what is the current opinion on implementing sysctl tree as a > filesystem. Most of the work I've done with dynamic sysctls is very > similar to what happens with filesystem. Also, filesystem model allows for > much more fine-grained access control. I've played a bit with this and have reference implementation at http://www.butya.kz/~bp/scfs.tar.gz (it hasn't been updated for recent -current and may require some tweaks). This FS does nothing more than representing existing sysctl tree as a file system. On a side note: many things in the kernel can be represented (and they are) as 'tree' structure. Nodes of that tree can have 'file' like attributes etc. At first sight VFS suit for it, but new file system will require a mount point which might be not available during kernel initialization. This can be solved by having two root vnodes - one is for 'normal' filesystems and second for internal kernel file system. So, internal fs can have structure like that: /bus - newbus tree /dev - device templates (instead of flat space provided by kern_conf.c) /sysctl - sysctl tree /nsmb - SMB/CIFS requester tree but I don't think that the existing VFS implementation can be used because it too superfluous for this task and vnode structure is too large. -- Boris Popov http://www.butya.kz/~bp/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message