[comp.sys.laptops] DESQview Multitasking on PC-6220

gjs@inmet.inmet.com (02/05/91)

It is possible to multitask normal DOS applications on the Sharp PC-6220. 
The very existence of a 4.5 pound multitasking computer is remarkable, and
finding configurations to make it work has been something of an adventure. 
Since the PC-6220 / TravelMate is so popular, I thought others might profit
from a summary.

My original goal was simply to do background Kermit file transfers through
the serial port and/or modem, while running another DOS program in the
foreground.  This is also possible, but the hardware limits how much
multitasking can be done at the same time.

One result of this exercise has been to teach me more about PC memory
management than I ever wanted to know.  It's like a maze of twisty little
passages, all different.


CONFIGURATION
-------------
I am using a Sharp PC-6220 with 3 MB memory and DOS 4.01.  The motherboard
revision is C0.  I use DESQview, which can competently multitask normal DOS
applications even on a 286, and PC-Kwik's SUPERPCK disk cache.  My
communications programs are MS-Kermit and LapLink.  Other programs I have
run concurrently include FinalWord II, Borland Sprint, Lotus 123,
Quarterdeck Manifest, FractInt and various other public domain games.  TSRs
I run in windows include CED and ProKey Plus.

The tasking capabilities of a 286 depend primarily on the characteristics
of the expanded memory hardware and software (manager).  The PC-6220
supports EMS 4.0 and can map 384K below 640K, but can only handle 64K (the
page frame) between 640K and 1024K, and can only page 64K at a time because
it has no hardware alternate map (see note 1).  The EMS driver is Version
4.0J (Release 1.32 Version 1.0A).


APPROACHES
----------
Three major strategies (memory configurations) are possible on this system, 
each with different merits:

1. Run programs in main memory, swap to expanded.
2. Run programs in main and expanded memory.
3. Run programs in main and expanded, with TSRs in high DOS memory.

For each of these schemes, the following table lists the commands needed in
config.sys, an example command in autoexec.bat to install a disk cache,
memory configuration parameters for the PC-6220 setup screen, and the
amounts of memory available in DESQview as shown by its Memory Status
program.  For simplicity, I have omitted pathnames.

----------------------------------------------------------------------------
              1. Swap to EM        2. Run in EM         3. Use High DOS
              -------------------  -------------------  --------------------
CONFIG.SYS                                                     
   device =   emm4j.sys /nl        emm4j.sys /nl /o     emm4j.sys /nl /o    
   device =   qext.sys             qext.sys             qram.sys fl=0 fems  
   device =                                             loadhi.sys qext.sys 

AUTOEXEC.BAT  superpck /a /s:1024  superpck /a /s:1024  loadhi superpck     
                                                                 /em /s:1024
HW SETUP                                                       
Main Memory      640                  640                  640 
Expanded        2368                 2368                 1152 
Extended          64                   64                 1280 
Total           3072                 3072                 3072 

DESQVIEW       NORMAL VIDRAM        NORMAL VIDRAM        NORMAL VIDRAM
Main Memory      470    590           470    590           485    604 
Expanded        2336   2336          2336   2336          1120   1120 
   Free         1280   1280          1280   1280          1056   1056 
   Largest         0      0           384    384           384    384 
----------------------------------------------------------------------------

EMM4J is the expanded memory manager supplied with the PC-6220.  The
description of /NL in the manual is rather vague, but without it DESQview
hangs more often.  QEXT.SYS is the extended memory manager supplied with
DESQview.  It allows DESQview to run up to 60K of itself in extended
memory, leaving more main memory space available (which is why I set up at
least 64K as extended memory).

I use the SUPERPCK disk cache as an example of a substantial TSR which uses
both main memory (16K) and expanded memory (1M).  Substitute your own
favorite cache, RAM disk, network driver, etc.

Under DESQview, Main Memory is the size of the largest program you can run
in conventional DOS memory.  Expanded/Largest is the size of the largest
program you can run in expanded memory.

If you run only text programs, you can use VIDRAM (part of Quarterdeck's
QRAM package) to allocate the PC-6220's VGA graphics memory to DOS,
increasing the memory available for programs by 96K (from 640 to 736).  You
still get gray scales (I assume CGA), but unfortunately not VGA 50 line
text mode.


1. SWAPPING TO EXPANDED MEMORY
------------------------------
The most straightforward scheme is to run concurrently only those programs
which will fit in main memory (the 470 or 590K below 1 MB).  As you open
new windows, DESQview makes space for them by suspending and swapping out
other windows to available expanded memory.  This is very fast - swapping
one window out and another in takes about half a second.  If insufficient
expanded memory is free, DESQview will swap to disk, which can take about
five seconds.

This configuration limits the number of programs I can run concurrently to
two or three (expanded memory can hold at least three more suspended). 
However, it also limits the load on the CPU.  Using this configuration, I
have successfully done interactive communications and file transfers at
both 9600 and 2400 baud, concurrently with moderate CPU and disk activity
(editing, spelling checking, reading and writing files of a few thousand
lines).  Even LapLink works in a window up to 57.6K baud, but I haven't
tried it with significant concurrent activity.

Swapping out may have unexpected effects on an apparently idle program. 
For example, Sprint and FinalWord automatically save work after a period of
keyboard inactivity.  To keep the save file up to date, you must not let
the program be swapped out until this period has elapsed.


2. RUNNING IN EXPANDED MEMORY
-----------------------------
If you want to run many programs concurrently, you can use the /O option to
EMM4J.  This allows it to map expanded memory into the 384K area between
256K and 640K (see note 2).  DESQview can then run programs in expanded
memory by paging (mapping) them into these main memory addresses.  You can
run one program up to 470K in main memory (590K with VIDRAM), and several
others each up to 384K.

This configuration avoids swapping out, and allows even faster switching
between windows.  It is probably the best configuration if you want to do
large spreadsheet calculations, large database sorts, and editing
simultaneously.

Unfortunately, this configuration does not work well with communications
programs.  The expanded memory hardware on the PC-6220 has no real
alternate map, which means that DESQview cannot switch quickly between a
communications program and a program running in expanded memory (see note
1).  In its round-robin scheduling, DESQview will skip background programs
that are truly idle; but a background program is "running" even if it is
just polling the keyboard.  The overhead of paging running programs causes
incoming communications interrupts to be missed, resulting in dropped
characters and/or transmission errors.  

This problem can be avoided if you FREEZE (manually suspend) or PUT ASIDE
(manually swap out) windows running in expanded memory during incoming
communications.  Or you can make sure every program runs in main memory by
PUTting ASIDE other windows before opening a new one.  It is much more
convenient just to use configuration 1.


3. USING HIGH DOS MEMORY
------------------------
The page frame, a 64K window used to access expanded memory, is normally
located at address D000 (832K).  If you're desperate to save space in main
memory, you can use Quarterdeck's QRAM.SYS to make this 64K available as
high DOS memory in which you can load drivers and TSRs.  No other high
memory is available to QRAM.SYS on the PC-6220.  When there is no page
frame, some programs which can use expanded memory (e.g. SUPERPCK and
Framework III) will be unable to do so.  DESQview can still work, because
it does not require a page frame below 1M.

Option FL=0 (FrameLength=0) tells QRAM.SYS not to allocate a page frame,
making this 64K available.  Option FEMS (ForceEMS) tells it to honor EMS
memory requests, allowing DESQview to access expanded memory. You can then
use QRAM's LOADHI.SYS to install drivers and LOADHI.COM to install TSRs in
high DOS memory.

Since SUPERPCK cannot use expanded memory in this configuration, I allocate
the disk cache in extended memory (as well as loading its code in high DOS
memory).  Unfortunately, DESQview and SUPERPCK seem to use more memory in
this configuration, so the net gain in main memory is only 15 or 16K, about
the space SUPERPCK occupied in main memory.  For me, such a small gain
isn't worth the trouble of changing CONFIG.SYS and rebooting when I want to
run another program that uses expanded memory.


OTHER OBSERVATIONS
------------------
I suspect that rebooting after changing expanded memory configuration
(setup or EMM4J parameters) does not completely initialize expanded memory,
because DESQview usually hangs shortly thereafter.  Cycling power seems
more reliable.  See note 1.

If the output of a TSR installation command is redirected to NUL (e.g.
"superpck /s:1024 > nul"), DOS leaves file NUL open until the next reboot. 
If you execute such a command in a DESQview window, e.g. in a .BAT
initialization file, NUL remains open after the window is closed.  Opening
the window again opens another NUL file.  If you open and close such a
window often enough, DOS will run out of files.  The symptom may be
nonspecific messages such as "Can't open overlay file" or "Initialization
failed" when you open a window or start a program.  Use Manifest's
DOS/Files command to see how many files are open.  The solution is either
to increase FILES= in config.sys to a ridiculous number, or to remove >NUL
from your TSR commands.

To save battery power, it is advantageous to read all files a program needs
at program start-up, then let the disk drive spin down.  Programs with
overlay files defeat this goal by reading parts only when needed.  One
solution is to keep such overlay files on a RAM disk.  With a large disk
cache, you can get nearly the same advantage by copying the overlay file to
NUL just before starting up the program, to guarantee that it is in the
cache.  The same applies to frequently executed DOS programs.


NOTES
-----
1.  The answer to all complaints about this machine is: "But it weighs only
    4.5 pounds and fits in a file folder."

2.  The /O option achieves what the DESQview manual calls "disconnecting" a
    portion of main memory.  The PC-6220's setup option to "disable" 256K
    of memory is unrelated (and useless, as far as I can tell).  Oddly,
    Quarterdeck Manifest counts the 384K of main memory which falls in this
    mappable area in the totals for both main memory and expanded memory.


QUESTIONS
---------
Questions or comments on the above are welcome.

Does anyone out there have better suggestions for running communications
under DESQview on the PC-6220?

Does the TI TravelMate 2000 have a different (better) expanded memory
manager?

Has anyone been able to run Framework III under DESQview on this machine? 
Or FastBack using DMA?

Is anyone running MS-Windows successfully on this system?  My understanding
is that it needs more memory, requires graphics mode, can't multitask
normal DOS applications on a 286, and is inconvenient without a mouse.

-- George Snyder        (617) 661-1840            Intermetrics, Inc.  --
-- gjs@inmet.inmet.com  (from internet/MILnet)    733 Concord Avenue  --
-- uunet!inmet!gjs      (from usenet)             Cambridge, MA 02138 --