[comp.os.msdos.programmer] Swapping application to disk

s9023@gte.com (Paul Stubler) (02/21/91)

Many MSDOS applications are able to swap themselves to disk (or EMS)
when they enter a DOS shell.

Relying on an article by Nico Mak in Dr. Dobbs (April '89), I was
able to get the application to write its memory blocks to disk.
The article is for a swapper external to the application itself, though.
I want the swapper built in to my application.  Also, I'm trying to do it
in C rather than assembly, as much as possible.  The differences  
result in some subleties which escape me, and my application crashes.

Does anyone know of any  PD code which does this, or know of an article
which discusses swapping from within an application?

----
Paul Steckler
steck@corwin.ccs.northeastern.edu
s9023@bunny.gte.com

bright@nazgul.UUCP (Walter Bright) (02/28/91)

In article <10639@bunny.GTE.COM> s9023@gte.com (Paul Stubler) writes:
/Many MSDOS applications are able to swap themselves to disk (or EMS)
/when they enter a DOS shell.
/Does anyone know of any  PD code which does this, or know of an article
/which discusses swapping from within an application?

Zortech C/C++ comes with library routines to do just this. All you need
to do is link in a special .OBJ file, and then use system and spawn calls
normally. It is the same technique used by our own tools (ZWB).

Zortech can be reached at 800-848-8408. We have educational discounts.

ralf+@cs.cmu.edu (Ralf Brown) (03/02/91)

In article <274@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes:
}In article <10639@bunny.GTE.COM> s9023@gte.com (Paul Stubler) writes:
}/Many MSDOS applications are able to swap themselves to disk (or EMS)
}/when they enter a DOS shell.
}/Does anyone know of any  PD code which does this, or know of an article
}
}Zortech C/C++ comes with library routines to do just this. All you need
}to do is link in a special .OBJ file, and then use system and spawn calls
}normally. It is the same technique used by our own tools (ZWB).

If you already have a C or C++ compiler, you can save $$$ by grabbing the
free SPAWNO30.ZIP from SIMTEL20 (in PD1:<MSDOS.C>).  It's pretty much a
one-for-one replacement for the standard Turbo/MS C spawn..() functions
which leaves less than 500 bytes in memory while the child program runs.
In fact, it can be dropped into many existing programs by merely adding
an #include and two #define's.
--
{backbone}!cs.cmu.edu!ralf  ARPA: RALF@CS.CMU.EDU   FIDO: Ralf Brown 1:129/3.1
BITnet: RALF%CS.CMU.EDU@CMUCCVMA   AT&Tnet: (412)268-3053 (school)   FAX: ask
DISCLAIMER?  Did  | It isn't what we don't know that gives us trouble, it's
I claim something?| what we know that ain't so.  --Will Rogers

kaufman@delta.eecs.nwu.edu (Michael L. Kaufman) (03/03/91)

In article <10639@bunny.GTE.COM> s9023@gte.com (Paul Stubler) writes:
>Many MSDOS applications are able to swap themselves to disk (or EMS)
>when they enter a DOS shell. Does anyone know of any PD code which does this...

There are a number of programs that will do this.  The next three posts contain
a version that will swap to disk/ems/exp, supports all the memory models of a
few different compilers, is free, and most important, comes with all of it's
source code.

There is also one called (I think) Spawno30.zip that is also supposed to be
good.  I have not actually tried it since it doesn't come with source.

Enjoy,  Michael

-- 
Michael Kaufman | I've seen things you people wouldn't believe. Attack ships on
 kaufman        | fire off the shoulder of Orion. I watched C-beams glitter in
  @eecs.nwu.edu | the dark near the Tannhauser gate. All those moments will be
                | lost in time - like tears in rain. Time to die.     Roy Batty 

tcs@mailer.jhuapl.edu (Carl Schelin) (03/04/91)

In article <1991Mar2.042729.28534@cs.cmu.edu>, ralf+@cs.cmu.edu (Ralf Brown) says:
>
>In article <274@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes:
>}In article <10639@bunny.GTE.COM> s9023@gte.com (Paul Stubler) writes:
..
>If you already have a C or C++ compiler, you can save $$$ by grabbing the
>free SPAWNO30.ZIP from SIMTEL20 (in PD1:<MSDOS.C>).  It's pretty much a
>one-for-one replacement for the standard Turbo/MS C spawn..() functions
>which leaves less than 500 bytes in memory while the child program runs.
>In fact, it can be dropped into many existing programs by merely adding
>an #include and two #define's.

In SpawnO 3.0 is says in the docs that it may not work with msc 5.1. I am 
using 6.0 and it bombs horribly (not an inclusive test). I actually get to
dos (with many errors and no environment) and then when I attempt
to execute PMap (a memory lister), it just start dumping core.

Works great with TurboC++ 1.0 though.

Carl Schelin
tcs@mailer.jhuapl.edu