Index: [thread] [date] [subject] [author]
  From: teunis <teunis@computersupportcentre.com>
  To  : Salvador Eduardo Tropea (SET) <salvador@inti.gov.ar>
  Date: Wed, 16 Sep 1998 18:43:38 -0700 (MST)

Re: DJGPP - LibDL anywhere ?

On Wed, 16 Sep 1998, Salvador Eduardo Tropea (SET) wrote:

> teunis <teunis@computersupportcentre.com> wrote:
> 
> > On Wed, 16 Sep 1998, Salvador Eduardo Tropea (SET) wrote:
> > 
> > [clip]
> > > Cool! If you just need to load a KGI driver in memory perhaps you don't need 
> > > a whole dynamic loader. Allegro uses VBE/AF drivers, they are binary images 
> > > and the loading process is easy. But our VBE/AF drivers have a relocation 
> > > table so we can load the code at any address, what's the format of the KGI 
> > > driver?
> > 
> > KGI drivers are in relocatable static ELF format usually
> > (ELF binaries incompletely compiled.  Imported objects are listed in
> > dynamic-data section (canna remember) and the object requires relocating
> > to where it runs).
> > 
> > Actually IMHO should be easy to port, say, 'insmod' to DOS to handle the
> > linking *grin*
> > (modutils is what handle linking drivers into the kernel)
> 
> Hmmm... I'm not familiar with modutils so I can't tell, but ELF isn't 
> supported but the precompiled tools used by djgpp.
> VBE/AF drivers are just binary files generated with ld and a tool to add the 
> relocation table (a simple C program).

Okay - a better description:
	To load, say, Linux KGI drivers into a DOS app, one would have to
link the KGI driver into said app, providing what kernel-hooks the KGI
driver requires with equivalents from the app.  This may not be possible
but should be in DOS anyways.
	To link said driver together requires being able to read and link
together an ELF relocatable object.  ld can do this but isn't very nice
about the whole thing (it won't do it dynamically).  libdl does not
support these binaries.

The only linker used in linux is in the modutils package - the kernel
module loaders.  Which ARE a more-or-less complete dynamic-ELF linker.

Of course, none of this matters if you can recompile the KGI drivers...

G'day, eh? :)
	- Teunis

PS: sorry if this message sounds hoopy.  I can
rewrite/erase/apologize for/explain anything in this message here.... (at
least the part i wrote)

Index: [thread] [date] [subject] [author]