
|
84799 packages online
|
|
 |
|
|
|
No screenshot available
|
Short: | Safely?! remove sytem patches (sample code) |
Author: | llucius millcomm.com (L.Lucius) |
Uploader: | llucius millcomm com (L Lucius) |
Type: | dev/src |
Version: | 1.2 |
Architecture: | m68k-amigaos |
Date: | 1995-11-01 |
Download: | dev/src/spr12.lha - View contents | Readme: | dev/src/spr12.readme |
Downloads: | 628 |
|
Safe?! Patch Removal
By Leland Lucius
v1.2
IMPORTANT!!!!
=============
The code contained in this archive is only an example. It is not complete and
has never been executed (it does compile though). Additional error checking
should be added and customized to fit an individual's needs.
WHAT IS THIS?
=============
If you frequent the c.s.a.p newsgroup, you have probably noticed that the
subject of safely removing AND freeing memory occupied by a system patch comes
up quite a bit. And that there are some that believe it to be impossible,
while others (like me) keep thinking that there just has to be a way to do it.
Well, I THINK I've found THAT way (actually two).
The first, found in files "remove1.c" and "patch1.asm", is an implementation
that is suitable for frequently called routines since it does not use any
additional CPU to track callers. It however CAN'T call any other routines
outside of the patch (see code).
The second, found in files "remove2.c" and "patch2.asm", is only slightly
different than the first. It keeps track of the callers of the routine and
thus uses slightly more CPU, but it CAN call any other routines.
Both implementations SHOULD be callable from interrupts.
Both implementations allow for memory deallocation.
Both implementations are position independent.
NOTICE
======
This code is released to the public domain. Hell, I'm not even sure if it'll
work! B-)
DISCUSSION?
===========
If you find that the code isn't safe (or is), let's discuss it on c.s.a.p so
that everyone interested can remark. Besides another thread about patch removal
is inevitable anyway, right? B-)
Leland
CHANGES
=======
Corrected the vector checks.
Changed to just free the patch if there are no current users.
Corrected patch exit during removal.
|
Contents of dev/src/spr12.lha
PERMSSN UID GID PACKED SIZE RATIO CRC STAMP NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic] 979 3272 29.9% -lh5- 11b8 Oct 31 1995 patch1.asm
[generic] 929 3351 27.7% -lh5- 7d69 Oct 31 1995 patch2.asm
[generic] 1148 4246 27.0% -lh5- 120e Oct 31 1995 remove1.c
[generic] 1189 4449 26.7% -lh5- 572f Oct 31 1995 remove2.c
[generic] 1018 2053 49.6% -lh5- d0da Oct 31 1995 spr.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
Total 5 files 5263 17371 30.3% Oct 31 1995
|
|
|
 |
Page generated in 0.01 seconds |
Aminet © 1992-2024 Urban
Müller and the Aminet team.
Aminet contact address: <aminet aminet net> |