Contents of the SHROOM.DOC file
shroom.doc- readme file for Shell Room Utility
Copyright (C) Davis Augustine 1990-1992. All rights reserved.
Last Modified:12jan93. Version 2.2d
SHROOM.COM- The program.
SHROOM.DOC- This documentation file.
SHROOM is a utility that gives a DOS application's shells more
room. It does this by intercepting the shell operation,
swapping out the application program, freeing up the memory,
and then performing the shell operation. It also intercepts
the exit from the shell, so that it can swap the application
back in before returning to it. The program is none the wiser.
oEasy to use.
oDetects swap file overflow (disk full) and asks whether you want
to abort back to the application or continue with a partial swap.
oDetects TSR loading and unloading during the shell. Frees
the TSR's resources and puts a warning message.
oSmall resident size (about 6k). Frees nearly all of the memory.
oAllows you to increase COMMAND.COM's environment size.
oWorks with all major DOS applications.
oFully user specifiable swap file path.Ie., you can put
it on a virtual disk.
oSwaps allocated memory only, avoiding unnecessary writes
and reads of free memory.
oIntelligent command line parsing. Searches DOS's PATH
for program to load, allows passing of args to the program.
Automatically tries .COM and .EXE extensions if not
specified by user.
oVerbose mode for inquisitive users.
oQuiet mode for apathetic users.
oUses DOS "make temp file" facility to prevent network clashes.
Installation and Operation
oTo install, just copy SHROOM.COM into a directory in your PATH
or the directory from which you will run the application.
oFor help, use the question mark switch, eg. "shroom -?".
oTo load, just type the normal command used to invoke the
application, with "shroom " prepended. Eg, if the application
is called "edit", then you would use the command "shroom edit".
Arguments are passed to the application just as before, so eg.
you can say "shroom edit letter.doc".
oTo shell out, use whatever shell command is provided by the
application. You will see a message from Shroom saying that it
is swapping the program out, after which the normal shell prompt
and actions will appear. When you exit the shell, you will
again see the "swapping" message from Shroom and then be
deposited back into the application as usual.
Help Screen - Displayed by the "-?" switch:
Usage: shroom [Switches] [@SwitchFile] Program [Args]
-?h : Print this help message.
-L : Display shareware license.
-n : Display program notes (more detailed help).
-p : Proceed (without asking) with partial swap if disk full.
-q : Quiet mode - display error messages only.
-v : Verbose mode - provide running commentary.
-w : Netware workaround - prevent Novell from closing files.
-x : Exclude targets (don't swap if shell is in target list).
-e # : Set ERRORLEVEL returned if unable to load prog (default = 254).
-m # : Swap a maximum of # kbytes.
-o File : Specify file to direct Shroom output messages to.
-s Path : Specify DRIVE:DIR in which to create swap file.
-t List : Specify which shell programs cause swapping.
-z # : Specify environment size for COMMAND.COM.
SwitchFile can hold switches that don't fit on the DOS command line.
Program and Args are your application and the command line passed to it.
Example: shroom -p -e 99 -s E:\ -z 800 wp letter
Notes Screen - Displayed by the "-n" switch:
********** NOTES **********
'k' is used by Shroom as decimal 1000, not 1024. E.g., "Swapping 4k"
means swapping 4000 bytes, not 4096 bytes.
The application must be a .EXE or .COM file. You can leave off the
file extension and Shroom will try to find a matching .COM or .EXE file.
Shroom searches for the application program first in the current directory,
then in Shroom's home directory, and finally in the directories of the
PATH environment string.
SHROOM SWITCHES AND ARGUMENTS:
All text surrounded by square brackets, as in "[-hnv]", is optional.
Switches can be given in any order, and can be in upper or lower case,
and may be separated by spaces (or not). The space between a switch and
its argument is optional, ie. you can say "-z800" or "-z 800".
Although all our examples use dashes as the switch character, a slash
can also be used: e.g. "Shroom /v /p ...".
EXTENDING THE COMMAND LINE WITH @SWITCHFILE:
The DOS command line is normally limited to a paltry 127 characters.
If that's not enough room to say what you want to say, then you can use
the "switch" file to hold additional switches and arguments for Shroom.
Shroom reads the switch file just as if it were part of the command line.
If file FOO contains: -t shell1, shell2 -p
Then the DOS command: shroom -v @foo yourprog
Is equivalent to: shroom -v -t shell1, shell2 -p yourprog
The switch file can contain multiple lines. End-of-lines are treated
as space characters. You can use multiple switch files on the command
line (eg Shroom @sf1 @sf2) but you cannot call one switch file from
within another (ie, no nesting).
Please note: This feature is for extending Shroom's command line, not
your application's. Unfortunately the application program's command
line is still limited to 127 or so characters (unless it supports its
own method of getting around the limitation).
If you are using Novell Netware, then you may also need to use the "-w"
switch with Shroom, as in "shroom -w prog". Many versions of Netware
seem to close files unexpectedly if they see that there is free memory
where there used to be a program. When Shroom swaps out the appli-
cation, Netware notices the memory is free and closes the network files
that that application had open. The "-w" switch causes Shroom to make
a special call to Netware that disables the "file cleanup feature"
during shell operations, thus keeping your network files open.
Many people have run into the following problem: you type the command
"SET MYVAR=WHATEVER" and get back the message "Out of environment space."
This occurs when a TSR is loaded or while a .BAT file is running. You get
around this by adding a line like "SHELL=C:\COMMAND.COM /E:2000" to your
CONFIG.SYS file, thus increasing the minimum environment space to 2000
bytes. However, when you shell out from an application and then run a
.BAT file, you find that the environment size has again been restricted
and the CONFIG.SYS line has no effect.
What you need is the amazing new "-z #" switch from Shroom. It causes
Shroom to append the string " /E:#" to COMMAND.COM's command line, thus
setting the desired minimum environment space for the new shell. Note
that in DOS 3.0, # is the size in paragraphs. In later versions it is
Unless you give the -q switch, Shroom puts out a "Swapping..." message when
shells occur. If you give the -v switch, Shroom puts out even more lines.
By default, both Shroom's output and the application's will go to the screen.
If you say "Shroom -o File App" then the application's output still goes
to the screen but Shroom sends its output to the specified file. If you say
"Shroom App > File" then both shroom and the application will send their output
to the specified File. If you want Shroom's output to go to the screen and
the app's to a file, you can say "Shroom -o CON App > File".
Note: with the "-o File" switch, if the file already exists then Shroom's
output is appended to it. We do not delete the previous file data.
EXIT RETURN CODES:
Shroom exits immediately if it cannot load the application, returning
an ERRORLEVEL of 254, unless you have changed the value with the "-e #"
switch. If it can load the application, then Shroom exits when the
application does, and returns the application's exit code.
Shroom stores the application in a temporary swap file during the
shell. The swap file always has extension ".OOM". The main part of
its name is derived from the application name followed by some digits.
E.g., "WP_000.OOM". When you exit from the shell, Shroom reads the
file back in and then deletes it. Obviously, you should not delete,
rename or otherwise modify the swap file while you are in the shell.
If you crash the system while in the shell, then the swap file will
still be there after you reboot (unless you were using a ram disk),
and it is a good idea to delete it then. The file is readonly so
you will need to run attrib -r on it first.
Shroom (among many other programs) looks for the environment variable
TEMP at startup. If TEMP is defined, then Shroom takes its definition
as the default location of the swap file. If TEMP is not defined, then
the current directory becomes the default swap file location. If you
give the -s DRIVE:DIR switch on the command line, then that overrides
the default location. The swap file location is determined only once,
during Shroom's startup. Changing your current drive or directory while
in the application or a shell will not affect where the swap file goes.
Finally, if you have a ram disk with enough room, it makes an excellent
home for the Shroom swap file. It is fast and "self-deleting" if you
crash the PC.
SWAP FILE SIZE:
By default Shroom attempts to free up all memory "above" it in the
DOS 640K. Typical swap file sizes are 200K to 500K. If the swap file
is too big to fit on the disk, Shroom asks whether you want to perform
the Shell operation anyway or cancel it. Or you can use the "-p" option
which tells Shroom to proceed with all Shell operations even if it can
only do a partial swap. If you want to limit the swap file size you
can use the -m N switch. For example, the command "shroom -m 125 prog"
will limit the swap file size to 125000 bytes.
(Most people don't need to worry about this.) When Shroom notices
that a program is being shelled, it checks the name of that program
against the target list. If it is in the list, then Shroom goes ahead
and does its thing, swapping the application and freeing its memory.
If the shelled program is not in the target list, then Shroom lets the
program load and execute normally without any swapping.
The purpose of the target list is to prevent unwanted swapping. There
are a few applications which "shell" their own overlays, and if Shroom
swapped them then the overlays wouldn't have anyone to talk to!
The default target list contains just your command shell, as defined
by the COMSPEC environment string. The -t switch is used to change the
target list. It takes a list of filenames separated by commas. The file
names are case independent and should not have drive or directory paths.
The ~ (tilde) string can be used to refer to the COMSPEC definition.
For example, "shroom -t ~, SUBPROG.EXE ..." would cause swappping on
the default shell and when SUBPROG.EXE is spawned. Typical shells are
COMMAND.COM, 4DOS.COM, NDOS.COM and SH.EXE.
Another special string is * (asterisk). It is the wildcard target
list, which causes Shroom to spawn on all shell operations. It should
be the only -t argument, as in: "shroom -p -t * -v ...".
If the -x switch is given, then the target list is used to exclude
rather than to include. Eg, "shroom -x -t myshell.exe myprog" tells
Shroom to swap on all shell programs except myshell.exe.
APPLICATIONS THAT DO "BACKGROUND PROCESSING":
You may have a communications package which allows you to initiate a
file transfer and then shell out to do other things. This will probably
not work if the package was Shroom'ed, because the application is actually
unloaded from memory (and from the interrupt vector table) during the
shell. The background processing code will not be there anymore!
Shroom is processor (8086, 286, 386, etc) independent. It does not do
any floating point. It doesn't care about or use expanded or extended
memory (a future version will be able to swap to extended mem). It works
with DOS Extender (e.g. Pharlap) based applications. It may work in the
Windows, Desqview and other pseudo or real multi-tasking environments, but
you're basically on your own (caveat sharer).
LOADING TSR'S INSIDE SHELLS:
In general, it is not safe to load a TSR while shelled out of an
application, unless you delete the TSR before exiting the shell. A
variety of memory and interrupt handling problems can occur. This
is true even when you are not using Shroom. If you are using Shroom,
then any TSR's that were loaded during the shell will be automatically
unloaded when you return to the application. If a TSR was loaded "high",
then it will stay loaded high but may cause problems if it uses any
interrupts that the application uses. Shroom displays the message:
"WARNING: Interrupt ## used by application, changed in shell." if that
UNLOADING TSR'S INSIDE SHELLS:
The sequence in mind is: You Load a TSR, enter an application,
shell out, then unload the TSR. The main danger in doing this is that
unloading the TSR may restore interrupt vectors that the application
had remapped. The chain would be changed from TABLE->APP->TSR->SYSTEM
to TABLE->SYSTEM, thus "cutting out" the app. Fortunately, Shroom is
able to detect when this occurs. If you see the message "WARNING:
Interrupt ## used by application, changed in shell", then that is what
happened. You should probably save your changes to a new temp file if
possible, and exit the application. You're not guaranteed to be able
to do this, so be sure to hold your breath.
You don't really need to know what interrupts are or understand any
of the above. The bottom line is: don't play with TSR's when shelled
out of an application. If you can't resist the urge to, then at least
Shroom will provide some insurance by catching and attempting to deal
with conflicts when they occur.
If Shroom is not working as advertised for you, please tell me about
it and I'll try to fix it. Shroom problems are usually due to conflicts
with other software packages. You should send a problem report via
regular or electronic mail with a description of the malfunction and
a listing of your CONFIG.SYS and AUTOEXEC.BAT files. Use the switches
"-v -o FILE" to create a log of the malfunctioning session. You may
also be asked to send a copy of the misbehaving application so that I
can debug with it. (It usually takes more time to obtain the software
and/or reproduce the bug than it does to fix it.)
Shareware License - Displayed by the "-L" switch:
********** SHROOM SHAREWARE LICENSE **********
This is a copyrighted software work which is distributed as shareware.
Under this license agreement you are granted the right to use Shroom
on all machines and environments that it supports. You are also
free (and encouraged) to pass copies of this shareware on to others
as long as it is not for payment and not bundled with anything else
that is for payment.
The shareware registration fee is $25 for single users, $95 for groups
(up to 12 users). To receive a diskette, please add $15 for shipping
and handling and specify diskette type. Send check or money order to:
Davis Augustine (Shroom Shareware)
P.O. Box 610
Sausalito, CA. 94966-0610
Please include your name and postal or email address. Also please mention
the Shroom version you are registering and how you obtained it.
Commercial distribution licenses, source code and customized versions are
also available at reasonable rates. Please write to the above address or
send me email at CompuServe id 72230,3053. I would also appreciate any
comments, questions, suggestions or bug reports. The latest Shroom release
can usually be found in CompuServe forums IBMSYS, lib 3 and TAPCIS, lib 2.
| REVISION HISTORY |
Changes in v2.2d (12jan93)
Add @file switch to allow command line extension. (Thanks to
users RTI and ML).
Add -x switch for excluding shell programs from the swap list.
(Thanks to user ML).
Improve error detection when figuring what to swap (not a bug).
Changes in v2.1a (30aug92)
Add help notes on stdout redirection.
Say "swapping in" or "swapping out", not just "swapping".
Have application (rather than Shroom) spawn the shell, if
possible. Allows i/o redirection and exit code checking
by app to work better.
Changes in v2.0a (24jun92)
Add -w switch for Novell Netware workaround. Keeps Novell from
closing network files that were opened by the swapped application(s).
Add -m N switch to set maximimum swap file size to Nk. (Thanks
to user MGZ).
Change 'k' to mean 1000x, not 1024x.
On partial swap, show actual size swapped back in, not the
Changes in v1.9d (26may92)
Change to new mailing address. Lower diskette shipping charges
from $25 to $15.
Changes in v1.9c (7mar92)
Change nonsensical swap file names to app_###.OOM. (Thanks to
users ML and RMB).
Make swap file readonly. (Thanks to users JB, ML, et al).
Show DOS error codes in decimal instead of hex.
Changes in v1.8k (15dec91)
Fix shroom's exit code when -v switch used. Was always exiting
with ERRORLEVEL 0 when -v was given. (Thanks to user B).
Changes in v1.8j (30oct91)
Allow tilde in target list to indicate COMSPEC file.
Add -o F switch to redirect output to a file. (Thanks to user RE).
Changes in v1.8g (14sep91)
Use TEMP environment string as default swap file location.
Previously we used the current directory. You still use the "-s PATH"
switch to override the default. (Thanks to users LC, ML).
Start application with full path name, not just command name
given (eg. C:\BIN\COOLPROG.EXE, not COOLPROG.EXE). Makes Clipper
work (was giving "overlay not found" error). (Thanks to user LM).
Make it work better with systems (such as MKS) where / (slash)
is the path separator, instead of backslash. Wasn't finding app if
it was in same dir as Shroom.
Detect and warn user when interrupts used by the application
have been changed in the Shell, apparently by unloading a TSR. Improve
TSR detection and deciding when to unload it and when not.
Changes to interrupt handling to work better with PC NFS and
some other software.
Fix application startup so it is not fooled by APPEND. If a
directory containing app was APPENDED, Shroom would think app was in
the current directory. (Thanks to user DG).
Add sections on TSR's and reporting bugs to notes.
Make -q suppress startup message, too. (For user ML).
Show command being passed to app, besides app name (unless -q).
If verbose, show exit codes from shells and from app. Also
if verbose, show swap file location at startup.
Changes in v1.7d (14aug91)
Fix problem with -z # switch when comline is not empty. Was
overwriting existing comline instead of inserting in front of it.
(Thanks to user LH).
Changes in v1.7b (6aug91)
Fix problem with Fortran programs. Was causing "Floating point
not loaded" error at application load time. Hey, don't blame me, the
bug is in the Fortran startup code! (Thanks to users RS and DF).
Disable control-C during swapping. Would cause system hang and
other strange behavior (especially by the user!).
Bring back group shareware registration, by popular demand.
Changes in v1.6d (21jul91)
Fix state saving and restoring to work better with other TSR's.
With a few TSR's, system would reliably hang when you exited the
application back to DOS, if a shroom swap occurred in the application.
(Thanks to user ML)
Changes in v1.6c (22jun91)
Get default target list from the COMSPEC environment string. So, if
you use a shell other than COMMAND.COM, Shroom will automatically recognize
it. (Thanks to user MB)
Fix problem in 1.6b, where swapping may have not been done with
some applications. Was failing to handle lowercase shell names correctly.
Changes in v1.6b (14jun91)
Only swap out specified shell programs. Default list is COMMAND.COM.
Add -t switch to specify others. (Thanks to user LH)
Add -z switch to allow increasing the environment space of
COMMAND.COM. (Thanks to user DM)
The -v switch as part of its verbosity shows the shell program being
executed and its command line.
Changes in v1.5d (3may91)
Search for the application in Shroom's home directory, too.
(Thanks to user CS)
Changes in v1.5c (26apr91)
Fix a bug in 1.5b, when checking for unswappable blocks. Caused
some applications to swap zero bytes. (Thanks to user JG)
Mention CompuServe home library in license.
Changes in v1.5b (29mar91)
Fix a bug in swapping.Leave alone any high blocks that are
allocated by TSR's. This caused shells to hang when Shroom was used
with some software (such as QCache). (Thanks to user RM)
Changes in v1.5a (24mar91)
Add -q switch for quiet mode. Suppresses the "SHROOM: swapping..."
messages but still lets error messages through.
Add -p switch to force partial swaps. If Shroom is unable to
swap all of the application out, it normally asks you whether you want
to proceed with the shell or return to the application. With the -p
switch, it always proceeds with the shell without asking you.
Add -e errorlevel switch to allow you to specify the exit value
returned by Shroom if it is unable to load the application. This allows
you to choose a value which does not conflict with those returned by
your other applications. This feature is only useful to those who make
serious use of "if ERRORLEVEL..." statements in DOS batch files.
(Thanks to user WB)
Add -n switch to show program notes, and add more information
to the notes. There is now a help screen (-h), a shareware license
screen (-l) and a notes screen (-n).
Properly delete the temporary swap file when the user aborts
the shell on disk full error (ie. when you pick 'A' to return to the
application). In previous versions of Shroom, the file was never
deleted, thus leaving temporary files with names like "0A982331" lying
Changes in v1.4d (14mar91)
Shroom returns the ERRORLEVEL of the application program which
was executed. If the application fails to execute, then Shroom returns
an ERRORLEVEL of 2. Previously, Shroom always returned ERRORLEVEL 0
if the application was successfully executed.