From owner-freebsd-hackers Thu Jul 23 12:23:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA13477 for freebsd-hackers-outgoing; Thu, 23 Jul 1998 12:23:04 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA13419 for ; Thu, 23 Jul 1998 12:22:37 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.8.8/8.8.5) with SMTP id UAA01792; Thu, 23 Jul 1998 20:22:15 +0100 (BST) Date: Thu, 23 Jul 1998 20:22:15 +0100 (BST) From: Doug Rabson To: wjw@IAEhv.nl cc: hackers@FreeBSD.ORG Subject: Re: SYSCTL ....... In-Reply-To: <199807231057.MAA10857@surf.IAE.nl> 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 Thu, 23 Jul 1998, Willem Jan Withagen wrote: > Hi, > > I was working on variant links ....... > Then I needed to expand the sysctl-naming space ...... > So I started looking into how to do that dynamicly ...... > > Turns out most of it is created by hardcoded structed which are > joined in what I consider a gruesome hack with linker-sets. The linker-set thing is certainly hard to understand but it does work very well for statically configured data. The linker does all the work of building the tree. As you have noticed, adding data dynamically is a challenge. > > I've already started thinking on what I would have build. > (and actually started desiging some of the code) > Until I just dicsussed some of the issues with some people here. > > And one of the questions is: > > Why did Mike Karels create such a difficult way of doing this? I believe that Poul Henning did the linker set thing. The original 4.4 code was even harder to extend... > > There has to be a reason for it! What I did has some complexity in it, but > it does require a PD to come up with a decend structure. > > Or question: > Are other people looking into this? > How far are they? > Am I free to redo the sysctl stuff as long as I can create > a glue function between the old and new systemcall? I have been avoiding doing this bit of work for literally years ;-). I will be happy to review any code which you produce. > > And the most important: > Any body with suggestions and/or pitfalls to avoid? Last time I was daydreaming about sysctl, I thought that using SYSINIT functions to build the tree would be a good idea. This would have the benefit of trivially adding in sysctl variables in kernel modules loaded using KLD since it runs SYSINITs in the loaded modules. To support unloading modules, a method of automatically disconnecting variables defined by the module is needed. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 951 1891 Fax: +44 181 381 1039 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message