lkml.org 
[lkml]   [1999]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: QUESTION: modifying kernel functions in a running kernel
Date
> > There was a comment about this a few months ago. Basically
> > someone wanted to change a basic function. They changed all
> references to
> > the function to be calls to a function address. The function address was
> set
> > at init time to the common usage. From a module, they could reach in an
> put a
> > different address, which everyone would then call. john
>
> This is starting to remind me of a function call that existed in AmigaOS
> called
> SetFunction(). It allowed runtime patching of operating system functions,
> which
> was all well and good. The only problem with it was that would be perhaps
> many
> different patches for the same routine. One fixes one bug, one
> fixes another
> etc..
>
> The only way around this problem is nesting patches (ie, calling the
> previous
> function) This can be real ugly, and in many cases caused crashes
> as patches
> were
> not written to comply with each other.
>

In fact, there were many cases for which this worked. Patch nesting was
supported directly by SetFunction(), which returned address to jump on, when
your patch is finished. Everithing worked pretty well, if patches were
written carefully (i.e. they left input and output to/from function legal).
The only problem was with removing patches. This is also what was managers
used for. Some of them patched SetPatch() by the way :-)

As a result, I see this approach best of all possible. It is very dangerous
to scan binary code and replace one code (or part of it) with another, as
you are never sure, that this is really this instruction. Even if it works
now, it will not work forever....

> So the end result is that if you have >1 bug fix patch you'd need
> to reboot
> anyway, nullifying the reason for the whole mechanism.
>

This is not really true. Of course there are problems with poorly written
patches, but it is possible to chain them.

> I'm aware that there were some 'managers' that handled patch
> nesting better
> than
> the default, but I never saw a perfect one in the many years that
> I used an
> Amiga.

That's because none of them was wide standard, so not all patches supported
them (which was usually necessary). If they would exist from the beginning
of Amiga, things would be different (slightly :-)

>
> (The machine may be a memory, but the OS lives on in my mind :-)
>

I undertand it very well. Real hackers OS. We will never more have such a
toy to play with.

Rudla Kudla


-
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.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.105 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site