From owner-cvs-all Mon Nov 29 15:18:43 1999 Delivered-To: cvs-all@freebsd.org Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id 3310615531; Mon, 29 Nov 1999 15:18:36 -0800 (PST) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <40338>; Tue, 30 Nov 1999 10:11:04 +1100 Content-return: prohibited Date: Tue, 30 Nov 1999 10:18:17 +1100 From: Peter Jeremy Subject: Re: cvs commit: src/sys/i386/conf files.i386 src/sys/kern kern_fork.c src/sys/libkern arc4random.c src/sys/sys libkern.h In-reply-to: <23833.943913718@critter.freebsd.dk> To: Poul-Henning Kamp Cc: chris@calldei.com, Bill Fumerola , "Jordan K. Hubbard" , Dan Moschuk , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Reply-To: peter.jeremy@alcatel.com.au Message-Id: <99Nov30.101104est.40338@border.alcanet.com.au> MIME-version: 1.0 X-Mailer: Mutt 1.0pre3i Content-type: text/plain; charset=us-ascii References: <19991129160908.J2233@holly.calldei.com> <23833.943913718@critter.freebsd.dk> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On 1999-Nov-30 09:15:18 +1100, Poul-Henning Kamp wrote: > SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW, > &domainname, sizeof(domainname), "Name of the current YP/NIS domain"); > >The string in the last argument gets put in a "non-load" ELF section >in the kernel. This much is trivial. >It is not particular hard to do this. You need to figure out some >way to tell GCC to stick this string in the special section, >but otherwise it should be a pretty simple job (do I see any >hands ?) __attribute__((section(".sysctl_descriptions"))) >priority 2: > Make it possible to extract the strings sysctl -d I have been looking at this. What I want to do is expand struct sysctl_oid to include a `pointer' to the (non-resident) sysctl description (and a pointer to the loaded filename to support sysctl's in KLDs). A new "staff-function" (eg sysctl({0,6,...},...)) would return the description "pointer" and the filename. Given the filename and description "pointer", the userland can then find the actual description. I believe it should be possible to make the "pointer" be the offset within the file (which saves the userland having to convert it into one). I've come across two stumbling blocks so far: 1) Making the linker generate a non-loaded section that can be referenced from a loaded section without expanding the ELF header. 2) Convincing the linker to use an address which translates directly (or trivially) to the file offset. I'd also like to see the sysctl descriptions become more descriptive, but that can wait until we can display them. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message