DoubleSpace Overview

            TECH Help! covers these DoubleSpace and MRCI Topics:

  DoubleSpace API                INT 2fH 4a11H and IOCTL services
  Compressed Volume File Layout  (CVF internal structures)
  Mapping DOS FAT to MDFAT       For CVF spelunkers

  DBLSPACE.INI Commands          Boot-time configuration settings

  Using a Compressed RAM Disk    Just a tip for power users

  MRCI API                       (INT 2fH 4a12H Real-time Compression fns)

█▌Overview▐█
  DoubleSpace compression is implemented in levels:

  ■ The lowest level is the MRCI support which compresses and uncompresses
    data with a few simple API calls.  MRCI fns may be installed in a ROM
    module.

  ■ The next level is the DoubleSpace device driver (DBLSPACE.BIN) which is
    installed at boot time.  It emulates a disk drive by reading from and
    writing to a standard DOS file (i.e., a Compressed Volume File).

  ■ Finally, the program DBLSPACE.EXE is an external DOS command which
    installs DoubleSpace support, compresses disk volumes, and tweaks the
    DoubleSpace configuration file (DBLSPACE.INI).

█▌Boot Sequence▐█
  At system startup, the BIOS reads and executes the boot sector of the
  boot drive.  That reads and executes file IO.SYS which reads and executes
  MSDOS.SYS (all of this is the normal pre-DoubleSpace sequence).

  New with DOS 6.0: Before MSDOS.SYS begins processing CONFIG.SYS, it looks
  for DBLSPACE.BIN in the root of the boot drive.  If found, it is loaded
  into the highest part of conventional memory and executed.

  Next DBLSPACE.BIN looks in the root of the boot drive for DBLSPACE.INI.
  It reads this file to learn how it should configure itself (which CVFs to
  mount and which drive IDs to swap, etc.).

  After DBLSPACE.BIN is done mounting and swapping, it passes control back
  to MSDOS.SYS which finally reads CONFIG.SYS (from the root of the
  swapped-in drive C) and processes its commands.

  If the command, DEVICEHIGH=DBLSPACE.SYS, is found, then a small program
  (DBLSPACE.SYS) is executed.  All it does is find the DBLSPACE.BIN code
  (remember, it starts out high in conventional memory) and move it into a
  UMB if UMBs are available or to the lowest available addresses in
  conventional memory (if no UMBs exist).

  DOS 6.2 Notes:  DBLSPACE.SYS may move the 15K MRCI engine into the HMA
  if there is room.  The DOS 6.2 Mem /A command reveals how much HMA is
  free.

  This also has the effect of "locking-in" the DoubleSpace drive letters,
  including any "reserved IDs" needed for mounting compressed floppy
  diskettes.

  Note that DBLSPACE.BIN contains all of the drive-emulation code as well as
  the lower-level MRCI compression engine (about 15K of code).  However, it
  is possible for MRCI to install itself earlier in the boot sequence...

█▌Before the Boot Sequence▐█
  It is possible for an adapter card (a hard disk controller, most likely)
  to install its own MRCI engine.  It could do that by having ROM-based code
  in the ROM-Scan address range.  That code would intercept INT 1aH to
  provide the MRCI support API (presumably it would provide hardware-
  assisted compression support).

  In that case, DBLSPACE.BIN would use the ROM-based MRCI engine and discard
  its own internal version.

█▌DoubleSpace Compression▐█
  DoubleSpace uses a variation of the "Lempel-Ziv" compression scheme.  In
  simple terms, it works by keeping track of repeated sequences.  When the
  same sequence appears later, it just refers to the previous data rather
  than keeping duplicates.  For instance....

          The rain in Spain falls, mainly.

     ...is compressed to...

          The rain Spfalls, mly.
                             
                 3,3  9,4   12,3

  The codes 3,3, 9,4, and 12,3 identify repeated sequences.  The first code
  specifies the position of the original text (as a distance backward from
  the current position) and the second code specifies the length of the
  repeated text.  The actual algorithms (as well as library code to do the
  work) can be licensed from Microsoft for no fee.

  DoubleSpace compression is around 1.7 to 1 with "real world" data files.
  Other systems, such as PKZIP and LHARC get better compression, but only in
  "batch mode" where they can work with an entire file at once.  DoubleSpace
  is "real time" system which must work with data in 8K chunks (a 16-sector
  cluster).

█▌Accessing the APIs▐█

  See DoubleSpace API and MRCI API for information on how to use these
  services.

  Most application programs will have no need to access these services.
  Exceptions exist; for instance, a backup program can use MRCI Fn 0001H
  (compress data) to save disk space on the target disk.

  Another example: At this writing, there is no utility to perform simple
  DoubleSpace operations such as "Get Drive Info" while in a DOS session
  under Windows.  As you may know, the DOS Dblspace command aborts with the
  "Can't run under Windows" message (Note: fixed with DOS 6.2).

See Also: DoubleSpace API
          DBLSPACE.INI
          MRCI API
          DOS Functions
                                    -♦-