[comp.sys.ibm.pc.misc] Putting a large Program on DOS.

satam@ecs.umass.edu (Kirtikumar Satam, ECE, UMASS Amherst) (08/23/90)

Hi!
I'm new to this newsgroup. Thus, the question that I'm posing now
might have been discussed previoulsy. Therefore, I urge you to
send the replies to my e-mail address and I'll post a summary based
on the responses.
Now, let me define my problem.

I have a program which allows network simulations. It has been written
for VAX/VMS operating system using PASCAL. It has following properties.
1. It runs as a single task on VMS, but it simulates concurrent execution
of Network Software (the OSI layers) on various nodes of the network.
It achieves this by maintaining separate stacks for each process and the
corresponding procedure is executed on the current process' stack. Thus,
a single procedure when run on differenet stacks gives an impression of
same software being run on multiple nodes having disjoint threads of
execution.
2. The variables for the software local to each process are automatically
declared as local thru' a proper declarations so that these variable
will be created on each process' stack and thus will have different copies.
3. The program actually creats the stacks for each process in its "data"
area and when it executes in that process' context, it copies that process'
stack from its data area into its own stack area (the default stack of
the task, the simulator, as seen by the VMS). Thus, VMS is oblivious of 
the fact that a context switch is occuring within the task itself. Also,
the context switch part takes care of CPU registers' integrity.

Now, since VAX provides for almost umlimited virtual memory, this simulation
can easily be run. Note that this require a very huge data area as various
processes' stacks reside in that. 
Now. let us have a look at the size of the code,data and stack requirement
of this program.
The code section is around 64 Kbytes.
Now, consider the stack requirement of each "process". Since all variable are
on stack, a typical process has around 4k of stack (required to store frames,
packets etc.). Thus, for a 64 node simulation the data area is around
64 * 6 * 4 =   1536 Kbytes.
the program stack is around say 8 k or so.

Now, the problem is of putting this software on PC/386AT with 4 Mbytes of
memory and using DOS 4.0 or above.
Also, I want minimal changes in the code (preferably none) except for the
part where context switching takes place. Other's are plain PASCAL modules
and should need only recompiling.

Using overlays is out of question as I need huge data area rather than
huge code area. Also, I need to rewrite the code so that I should explicitly
state what should overlay what and when. The efforts for such a
task is not worth considering.

I can use raw EMS thru' its driver, but then I have to do memory management
all by myself (using INT 61H, I guess) which again means rewriting the
code to do that. So, this option is also ruled out.

The only way is to have something in between DOS and my program which
gives a unified and virtual access to all underlying 4 MB of memory. That
is, I need a platform which gives an illusion to the application that it
has 4MB at its disposal just like VMS or UNIX gives an impression of
"virtual memory". I have been told that WINDOWS 3.0 does something of this
sort, but I'm unable to get  specific information. 

Anybody in this netland knows the ways? 
Please refrain from suggesting SCO XENIX or UNIX on PC/386 as 
I'm interested only in putting it on DOS.

Thanks in advance. Hope to see a spate of replies.

-satam. 
Graduate Student, University of Massachusetts at Amherst.
------------------------------------------------------------------------
Kirtikumar "Mumbaichaa" Satam
INTERNET : satam@jambo.ecs.umass.edu
BITNET : satam@umaecs.bitnet
19 Puffton Village, Amherst, MA 01002   Tel# 413-549-0848
------------------------------------------------------------------------