From owner-freebsd-arch@FreeBSD.ORG Sat May 10 07:21:42 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7786537B417 for ; Sat, 10 May 2003 07:21:42 -0700 (PDT) Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [193.162.153.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E2F343FCB for ; Sat, 10 May 2003 07:21:41 -0700 (PDT) (envelope-from nicolai@catpipe.net) Received: from 80.164.85.206 (unknown [80.164.85.206]) by pfepa.post.tele.dk (Postfix) with ESMTP id 1352647FFBE for ; Sat, 10 May 2003 16:21:39 +0200 (CEST) From: Nicolai Petri Organization: catpipe Systems ApS To: freebsd-arch@freebsd.org Date: Sat, 10 May 2003 16:21:34 +0200 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200305101621.34478.nicolai@catpipe.net> Subject: kld-framework suggestions. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2003 14:21:42 -0000 I'm currently trying to do some kernel hacking with focus on the KLD-framework. My goals is to come up with some bugfixes for 5.X and some new ideas and patches for 6.X. I have created a site at http://hobbes.bsd-dk.dk/~npp/ where I put my current work. I also uploaded my ongoing kld-todo.txt draft that I update each time I get a new idea or rm's some of the old ideas. My current goal is to get some new macros into the src-tree for associating sysctls and sysinits with a module instead of a .ko file. Below I pasted in some lines from my todo that quite well explains what I propose (I hope) For a bit more detailed text please look at the above mentioned website. Comments are welcome : The future ---------- * A state storing framework * A future goal would be to extend the kld framework to be a core part of the "reload or upgrade kernel without booting or losing state" project. First phase would be to allow real-time updates of modules without losing state. (this could be used for eg. disk drivers and similar). Generation of a state-storing framework for doing dynamic RT (runtime) upgrades. It could be a mechanism like : RTStoreValueInt(rtobj, BLAH_RING_BUFFER_SIZE, 1234); RTGetValueInt(newrtobj, BLAH_RING_BUFFER_SIZE. &bufsize); if (bufsize < MIN_NEW_BUF_SIZE) realloc(buffer); blah. and if (RTGetDSVersion(ifnet) != 2) goto abort; The above is a quick "it-could-maybe-be-done-like-this-if-the-wind -blows-from-east-and-we-all-agree", it's NOT a well thought idea in any way. * Adding new macros for registering SYSCTL's and SYSINIT's * To be able to associate SYSCTL's and SYSINITS with modules instead of .ko files, I propose to add some new macros named MODULE_*. These should be used for registering sysctl's and sysinit's where it is relevent. In the sysctl case it should be possible to give a flag that defines how to handle conflicts while loading (eg. should the sysctl be replaced or ignored). * Other ideas * Addition of MOD_ISLOADABLE to mod_event(). Addition of MOD_RTUPDATE and MOD_RTUPDATEABLE (Maybe this should be done like SYSINIT's)