Subject: Re: how do I patch running kernel ?
To: None <current-users@netbsd.org>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 11/25/1994 07:39:17
> Is there a standard utility I can use to patch variables in the
> running kernel ?  sort of like
> 	echo foo/w1 | adb -k /vmunix /dev/kmem

In general, I think, the answer is no.  The prevailing philosophy seems
to be that one should use sysctl for such things, but that requires
that one has already compiled in the ability to change the specific
variable in question.  (I discovered this when I wanted to patch
tickadj at runtime; I added it to kernfs, and when I offered the
patches (which are quite small) I was told sysctl was the `correct'
way.  What's incorrect about /kern was never quite explained; the
closest anyone came was to invoke internationalization concerns.  Of
course, using /kern also requires having compiled in support for
tweaking the variable you want to change.)

Besides, unless you've patched securelevel, I don't think there is any
good way to twiddle variables in the running kernel.  /dev/{,k}mem are,
I believe, read-only once init sets securelevel to 1

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu