Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 2003 16:21:34 +0200
From:      Nicolai Petri <nicolai@catpipe.net>
To:        freebsd-arch@freebsd.org
Subject:   kld-framework suggestions.
Message-ID:  <200305101621.34478.nicolai@catpipe.net>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305101621.34478.nicolai>