What you can do is instead of trying to replace the kernel with a new
kernel, you can add a fixed function to the kernel while retaining the
old function. For code-changes I can imagine you could do something
like the following:
You have one running kernel and a set of patches to that kernel. Each
patch is defined as a code-segment with one entry-point and a set of
entry-points in the kernel that should be replaced by the entry-point
in the patch. You pack each patch into a separate kernel-module, and
when loaded, they overwrite the first instruction of each of the
defined entry-points in the kernel with a jump-instruction to the
entry-point in the module. On unload, you write back the saved
contents of the first instructions of the entry-points in the
kernel.
You won't have any trouble with pointers to functions and in many
(most?) cases, patching the kernel can be done with _one_ atomic write
operation which makes it unnecessary to "take down" the kernel at all.
astor
-- Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway http://www.guardian.no/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html