Command: lbacache

  LBACACHE is a disk read cache for XMS + 386. It supports up to 8
  harddisks, 2 floppy disks, LBA / CHS. It improves drive performance.
  It requires XMS memory, and at least a 386 computer.

Syntax:

  To load:      LBACACHE  [size] [DRV drivelist] [FLOP] [TUNA] [TUNW]
                          [TUNS]
  When loaded:  LBACACHE  [INFO] [SYNC] [STOP] [STAT] [ZERO]
  To get help:  LBACACHE  HELP|/HELP|/?

Options:

  size      Specifies the buffer size. Default: 2048k. If 1-2 digits,
  BUF size  unit is 256k (in XMS), so default is to use 2 MB XMS.
            If > 2 digits, unit is simply 1 kilobyte. Example:
            'LBACACHE 8192'. Other possible syntax: "BUF size" instead
            of "size".
  FLOP      Enable the floppy cache (A: and B:, autodetected). To speed
            up floppy use, load TICKLE, too! Please report if FLOP has
            bugs. A bug can e.g. mean that the cache makes wrong
            assumptions on floppy geometry which can lead to data
            corruption on the disk or in files copied from disk. If you
            only use 1.44 MB disks in an 1.44 MB drive, bugs are
            extremely unlikely, though...
  DRV list  Selects which harddisks are cached. NONE means none
  DRV NONE  (DRV NONE)
 (DRV NULL) It is strongly recommended to let LBAcache autodetect all
            cacheable harddisks instead of using this option!
            List consists of digits in 0..7, for BIOS drives 80h+x.
            E.g.:
            023   caches BIOS drives 80h, 82h, 83h - first, third and
                  fourth harddisk (hda, hdc, hdd in Linux terminology).
            Important: First BIOS harddisk means ALL drive letters which
            are on the first physical harddisk.
            Older versions used the syntax DRV NULL instead of DRV NONE.
  TUNA      Fully associative cache: Search whole cache for a sector or
            for free space in worst case. Slower for big caches but can
            give more cache hits than the new (6/2004) default of
            searching only up to N (current setting: 16) cache elements
            (current size of an element: 8kB). Please TELL ME how much
            this changes speed and cache hit percentages for YOUR own
            test scenario, thanks. First tests suggest: slightly more
            cache hits but lower speed!
  TUNW      Allocate on write: When data is written to disk, store a copy
            in cache, EVEN if that means allocating new space in cache,
            in anticipation of reading the data back later. Was the
            default until 7/2004. Makes writes "consume" more cache, but
            is useful for tasks which work with temp files a lot. If
            data was cached anyway, the copy in cache is updated
            regardless of this option.
  TUNS      Allocate 384 bytes of low DOS RAM for stacks (new 7/2004).
            Use this option if you want to load LBAcache into JEMM386's
            UMB or otherwise "not very DMA friendly UMB" and have a SCSI
            system. SCSI BIOSes seem to use DMA to stack for geometry
            check calls! Note that this memory is *not* freed by
            LBAcache STOP, as the unloading protocol would have to be
            changed too much for that.
NON-LOAD options:
  INFO      Shows cache statistics and details about resident LBAcaches.
            Useful for debugging purposes, but somehow hard to
            understand.
  STAT      Shows easier to understand cache statistics only.
  ZERO      Reset the cache statistics counters to zero.
  SYNC      Synchronizes all running LBAcache buffers for all drives.
            As LBAcache never delays writes, SYNC is just forget cached
            data. This is done by calling int 13.46 (BIOS disk: eject)
            for all cacheable drives (0, 1, 0x80 .. 0x87). Let me know
            if you get unwanted side effects such as ejecting BIOS-driven
            CD-ROM. It is recommeded to do LBACACHE ZERO after LBACACHE
            SYNC, will make the statistics more intuitive to read.
  STOP      Shuts down all running LBAcache instances and frees the XMS
            and DOS RAM which they had allocated (removes them from RAM).
            If the interrupt chain cannot be restored, LBAcache instances
            are left in DOS RAM, but at a reduced size of < 500 bytes.
            The XMS memory is always freed. When a single LBAcache is
            loaded as last disk related resident program, complete unload
            should work most of the time. When loading several LBAcache
            instances, often only the last instance can be fully
            unloaded.
  COOL      Puts the cache into "cool" mode: accessed sectors are frozen
            into the cache (as much as possible - use TUNA to enhance the
            effect). See the BINSEL explanations to find out whether this
            experimental (9/2004) mode is useful for you.
  MELT OR   Puts the cache into "melt" mode: accessed sectors are
  HEAT      unfrozen (defrosted? :-)) from the cache. See above. (9/2004)
 (WARM)     Note: WARM, COOL and TEMP all display a diagnostic status
            value for debugging, e.g. the current "locked element
            count". After that, the normal STAT output is shown.
            Older versions used the keyword WARM instead of the current
            MELT or HEAT keyword.
  TEMP      Restores the cache to "normal temperature" mode: The frozen-
            ness state of the current contents is preserved as far as
            possible (if the cache gets really full, things will melt).
            Now you have reserved part of the cache for frozen / locked
            data and the rest of the cache space in classic mode.
            (9/2004)
  The NON-LOAD options affect only other LBAcache instances which are
  already in RAM. LBAcache will not create a new instance when a NON-
  LOAD option is used: e.g. "LBAcache STAT" displays statistics of a
  copy of LBAcache which you have loaded before. Then it returns to the
  prompt.
  LBAcache uses a local stack, as the global DOS stacks might be too
  small. [As there is no .sys version anymore, the problem that you
  could not free the DOS RAM which gets allocated by .sys instances is
  gone now, 5/2004.]

Comments:

  For more information see:
  https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/
  packet: lbacache, section: DOC  OR:
  https://gitlab.com/FreeDOS/base/lbacache/-/tree/master/DOC/LBACACHE
  OR: C:\FREEDOS\DOC\LBACACHE\

Examples:

  In CONFIG.SYS / FDCONFIG.SYS:
    INSTALL=LBACACHE.COM [arguments]
  or
    INSTALLHIGH=LBACACHE.COM [arguments]
  or from command line or AUTOEXEC.BAT:
    LBACACHE [arguments]
  or
    LOADHIGH LBACACHE.COM [arguments]

    LBACACHE              Just running the command without options will
                          read cache all your hard disks (if available
                          through the BIOS) with the default cache
                          buffer size.
    LBACACHE buf 20 flop  This will read cache all hard disks and
                          floppy disks, with 20 x 256 kB = 5MB of memory
                          for the cache buffer.
    LBACACHE info         Shows information about your caches.

See also:

  autoexec.bat/fdauto.bat
  cdrcache.sys
  config.sys/fdconfig.sys
  device/devicehigh
  devload
 (fdxms)
 (fdxms286)
  himemx
  install/installhigh
  jemmex
  tickle
  xmgr

  Copyright © 2004 Robert Platt, updated 2011 and 2022 by W. Spiegl.

  This file is derived from the FreeDOS Spec Command HOWTO.
  See the file H2Cpying for copying conditions.