[DGD] Reclaiming kernel functions

Felix A. Croes felix at dworkin.nl
Tue Aug 26 13:39:22 CEST 2008


DGD 1.2.150 allows you to reclaim unused kernel functions.  This is
primarily intended for people who after having used some addon, such
as the networking package, want to switch back to vanilla DGD without
performing a cold boot.

Reclaiming kfuns is done through a debugger.  I have looked at ways
to automate this further, but that would involve a significant
administrative overhead for a feature which is unlikely to be used
more than once, and which most people will never use at all.

The procedure is as follows:

 - Within the mud, change your code to stop using the additional
   kfuns.
 - In the source code for your addon DGD functionality, modify the
   kfun names to include parenthesis.  For example:

    static DGD_EXTKFUN_T kf[1] = {
	"(lower_case)",
	lower_case_proto,
	&lower_case
    };

 - Attach a debugger to the driver process, and let it run.
 - Within the mud, recompile all objects.
 - From the debugger, interrupt, call kf_reclaim(), and continue.  This
   will produce output on stderr like:

    *** Preparing to reclaim unused kfun (compile_object)
    *** Preparing to reclaim unused kfun (hash_md5)
    *** Preparing to reclaim unused kfun (hash_sha1)
    *** Preparing to reclaim unused kfun (lower_case)

   The three extra kfuns were retired by DGD itself.  Don't worry, there
   is still a working version of compile_object().
 - Within the mud, recompile all objects again.
 - From the debugger, interrupt, call kf_reclaim(), and detach the
   debugger.  This will produce output on stderr like:

    *** Reclaimed 4 kernel functions

Any statedump created after this can be used by a driver lacking the
additional kfuns.

Regards,
Felix Croes



More information about the DGD mailing list