Linking EXE and OVL files 
Author Message
 Linking EXE and OVL files

Hello everybody !
I know how to link an .OBJ file into a Pascal program.
But is possible to link also a .EXE file ?
is possible to link also an overlay file ?

With BP7, if I compile a program in protect mode, after i need
RTM.EXE and DPMI16BI.OVL to run it.
Is possible to include these files into my program, so if I want to
distribute it, I need only to give one file ?

Thank you in advance.



Wed, 18 Jun 1902 08:00:00 GMT  
 Linking EXE and OVL files

Quote:

> Hello everybody !
> I know how to link an .OBJ file into a pascal program.
> But is possible to link also a .EXE file ?

I don't want to be provocative, but there is a method for _dynamicaly_
linking an .EXE : Exec() it !

Of course, this doesn't work for static link, but who can do the best...

Quote:
> is possible to link also an overlay file ?

This is a little more difficult, you have to go into the arcanes of INT
$21 AX=$4B03 (see a good book about DOS-programming or Ralf Brown's
interrupt list).

Quote:

> With BP7, if I compile a program in protect mode, after i need
> RTM.EXE and DPMI16BI.OVL to run it.
> Is possible to include these files into my program, so if I want to
> distribute it, I need only to give one file ?

> Thank you in advance.

Oh oh.  What your really want is not _linking_ an .EXE, but including it
in another .EXE.

First of all, in the example you give, I see a _big_ problem: Copyright!
I don't have the license right in the hands, but I think the right to
redistribute a file doesn't signify the right to modify it to be
included in an file.

OK, let be positive: you can do that, but you have to merge the
relocation tables together and to rewrite the loader code (the one who
load DPMI16BI.OVL and RTM.EXE _if they are not there_).

The first isn't that difficult: your compute the paragraph offset of the
second .EXE relative to the base of the .EXE, you read the relocation
table for the second .EXE, you add the delta in bytes for all entries,
you adjust all the entries required to be fixed with the delta, and you
append this at the end of the relocation table of the first .EXE.

The second would be a little more difficult, as you will have to write a
short program to detect DPMI then RTM.EXE and to load them if necessary.
Take a look at Ralf Brown's interrupt list to learn how to detect them.
To actually load them, you have to simulate a EXEC system call. Again,
RB's int list would be usefull, and/or a book describing the debug way
of launching a program (Unauthorized DOS is perfect for that).


can fail, in particular if one of the included .EXE _request_ to be
loaded just after the PSP...

Hope this helps.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Linking EXE and OVL files

2. BGI file linked in EXE file?

3. Protected Mode mit dpmi16bi.ovl und rtm.exe

4. Borland Pascal 7.0/protected mode/rtm.exe/dpmi16bi.ovl

5. Borland Pascal 7.0/protected mode/rtm.exe/dpmi16bi.ovl

6. RTM.EXE + DPMI16BI.OVL

7. Help needed to find latest RTM.EXE + DPMI16BI.OVL

8. Link 2 exe and/or com files

9. How to link a .GIF file into the .EXE

10. Linking BGI driver into .exe file.???????????

11. Linking an .EXE file in my program

12. Linking several exe-files

 

 
Powered by phpBB® Forum Software