🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5804

EXEC question

#5804
From: Where there is darkness, light
Date: Wed, 17 Apr 1991 00:31
38 lines
2219 bytes
Hi,

I'm writing an application from which I want to be able to run other DOS apps.
This is easy enough to do using the EXEC function, but unfortunately the
programs get read from disk each time.

What I really want to be able to do is load a program from disk, put it
in far memory somewhere, and then execute it later using a far call.

I tried to do this by allocating a piece of memory, calling the Create New
Program Segment Prefix function to make a psp in it, reading a .COM file
into it starting at offset 100h, reseting some values such as memory
size and the command line parameter area in the new PSP, saving all current
critical values like the stack regs in code segment variables, loading
all registers properly for the .COM program, and finally performing a far
call to offset 100h in the segment into which it was loaded.  Then I
restored the parent program's stack etc. from the code segment variables.
This method actually provided moderate success....some programs run fine, 
but not others.

Any ideas??  

I also thought about using the EXEC function, but it doesn't appear to be
set up properly for this, at least not the documented portion of it.

The DOS Technical Reference for version 4.0 lists calls to EXEC
with al=0 for a normal exec, and al=3 for an overlay.  Does anyone know what
functions are performed if al = 1 or 2?  Maybe just what I'm looking for?

I'm working in a mixture of MSC 6.0 and assembly.

Thanks for any suggestions.

Kris.
-- 
Kriston M. Bruland          |    . .         . .      . . .      .       . .
n8541751@unicorn.cc.wwu.edu |    .   .     . .        .        . .       .   .
8541751@nessie.cc.wwu.edu   |    .             .         .     .   .     .
Technical Details
Message-ID: <1991Apr17.003141.357@unicorn.cc.wwu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uwm.edu!ogicse!unicorn!n8541751

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uwm.edu!ogicse!unicorn!n8541751
From: n8541751@unicorn.cc.wwu.edu (Where there is darkness, light)
Newsgroups: comp.os.msdos.programmer
Subject: EXEC question
Summary: EXEC of a program already in memory
Keywords: EXEC
Message-ID: <1991Apr17.003141.357@unicorn.cc.wwu.edu>
Date: 17 Apr 91 00:31:41 GMT
Organization: Monkey Tree Computer Services
Lines: 38