From: "Paul Derbyshire" Newsgroups: comp.os.msdos.djgpp References: <9805190821 DOT AA00045 AT gcef DOT gc DOT maricopa DOT edu> Subject: Re: Threading Lines: 38 Organization: The Chaos Zone MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 19 May 1998 14:23:02 GMT NNTP-Posting-Host: 206.172.228.152 NNTP-Posting-Date: Tue, 19 May 1998 10:23:02 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk So a 'fake' SIGSEGV is used? 1. Is there a way to diddle a hardware interrupt(timer) to return to an altered address using assembly under DPMI? 2. Is it possible to make a disk file containing relocatable compiled C++ code that can be dynamically loaded into memory and linked-to? How would one accomplish this? The most obvious way would be to package individual dynamically-loading classes that will have a common interface (e.g. plugin architecture), write an "abstract base class" with function pointers that look and act like virtual function members implementing the interface, and load specific plugin classes at runtime into some allocated memory, locate the entry points (their offsets in the file/data presumably have been extracted and recorded in an additional data structure in the files) and put their relocated addresses in the function pointers of an instance of the interface class, and at other offsets in the plugin replace placeholder 0x00000000's with the addresses of methods it calls from the standard library (if library use is made available to the modules at all, which it should be ideally). -- .*. "Clouds are not spheres, mountains are not cones, coastlines are not -() < circles, and bark is not smooth, nor does lightning travel in a `*' straight line." ------------------------------------------------- -- B. Mandelbrot |http://www3.sympatico.ca/bob.beland/indexn2f.html _____________________ ____|________ Paul Derbyshire pderbysh AT usa DOT net Programmer & Humanist|ICQ: 10423848|