Mail Archives: djgpp/1998/10/13/13:01:32
Hello there!
Black Phantom wrote:
> >
> > I'm interested in creating some sort of DLL (Dynamic Link Library)
> More likely it will be harder than you describe: you'll write a TSR that
[ skipped ]
IMHO the world is much brighter than you described. The Ultimate DOS
Dynamic
Load Library Which Will Deal With Any DOS Programs - yes, it's a beast
hard
to implement. But if we are speaking of a particular compiler and
library
to dynamicaly load code - I see not so much problems. At first you
should
see, that one can safely call DATA in DOS environment - so you can
simply
alloc some memory, load DLL image into it, then get symbol address
(somehow -
depends on the DLL layout and your goals) and call the pointer. That is
how
it was done in Windows DLL system - you ask to load dll, then ask for
pointer
to function and then just call it via pointer. Import lib funcs are just
wrappers to this scheme.
Another way is to create a wrap to the whole program - as it was done in
my DLM engine. Special stub starts before all your code and creates the
dynamic environment. What it actually load are object files. It resolves
symbols and call the main. It also export LoadDLM and other API
functions
for modules to be able to access DLM engine features.
As you see no TSR or DOS hacking required.
> The whole thing is utterly inefficient since dynamic linking was
> designed for sharing one copy of library among different address spaces.
> In DOS there is a single-tasking environment so DLL system will eat up a
> lot of memory, saving nothing. What do you need it for, what is the
> design goal?
There are much more reasons to use dynamic linking/loading than you
mentioned.
They include :
- loading drivers - are you going to link in your exe ALL possible
drivers and
thus make you program unextendable ? Or you prefer to make several
DRV/DLL/DLM's
which share interface and contain code specific for the device ?
- plugins - common object interface will help you to create installable
plugins
- overlays. In low memory environment you can load/unload parts of you
program as
needed.
- there are some more. anyone can easely continue the list.
============================
Ilya P. Ryzhenkov aka Orangy
Fido : 2:5000/120.7
E-mail : orangy AT inetlab DOT com
ICQ : 17942172
- Raw text -