home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / acc / utility / dcache / dcache.doc < prev    next >
Encoding:
Text File  |  1988-06-22  |  11.8 KB  |  362 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                          Documentation 
  7.  
  8.  
  9.                              DCACHE
  10.  
  11.  
  12.  
  13.                         by Atze Dijkstra
  14.  
  15.  
  16.  
  17.  
  18. DCACHE 
  19.  
  20.  
  21.     Notice: This  software  is  shareware  and may only be copied
  22.             with  all  the  files mentioned below together. Files
  23.             may  not  be changed.  Users of this package who like
  24.             it  and  judge  it to be worth the value of fl. 25.--
  25.             (or  equivalent,  or  more)  and  also  like  to  see
  26.             updates  of the package, are kindly requested to send
  27.             this  amount  of  money to the author.  Comments with
  28.             respect  to  failures  and  possible enhancements can
  29.             also be sent to the author and are most welcome.  
  30.  
  31.     Disclaimer: "I  make no warranty with respect to this manual,
  32.             or  the   program  it  describes,  and  disclaim  any
  33.             implied/explicit   suggestions  of usefulness for any
  34.             particular  purpose.   Use   this program only if you
  35.             are  willing  to  assume  all risks,  and damages, if
  36.             any,  arising  as  a result, even if it is  caused by
  37.             negligence or other fault." 
  38.  
  39.  
  40.     DCACHE   is  a  disk  cache  and  as  such  keeps  copies  of
  41.     transferred  disk  blocks  in  memory.  Generally speaking, a
  42.     cache  can  be  a  good  and  more  flexible  alternative for
  43.     ramdisks.   DCACHE  is  probably  one  of  many  disk  caches
  44.     available  but  can  be  configured  in  several  ways.  It's
  45.     behaviour  can  also  be  influenced after the cache has been
  46.     installed. In these respects it differs from other caches.  
  47.  
  48.     When  you  are  reading  this,  you should have the following
  49.     files: 
  50.  
  51.       DCACHE.TTP    : disk cache
  52.       DCACHA.ACC    : disk cache manipulation accesory
  53.       DCACHE.DOC    : this file
  54.  
  55.     DCACHE  executes commands when it is invoked.  These commands
  56.     may  either  be specified as arguments on a command line from
  57.     a  shell, or, if not specified in this way, they will be read
  58.  
  59.  
  60. DCACHE V1.0f                  - 1 -                  19 June 1988
  61.  
  62.  
  63.  
  64.  
  65.  
  66.     from  the file DCACHE.INF or \AUTO\DCACHE.INF.  If DCACHE.TTP
  67.     is  renamed  to  DCACHE.PRG  and  put in the \AUTO folder the
  68.     cache  it  will automatically be started and configured using
  69.     the  DCACHE.INF  file.   If  DCACHE  does not make a cache it
  70.     will  exit  like  a  normal  program,  otherwise it will stay
  71.     resident  and  consume  some memory for the cache.  After the
  72.     caches  have been created several commands may be  applied to
  73.     them.   Commands  which  influence options do not have effect
  74.     on  the  existence  of  the cache, but commands like 'remove'
  75.     and 'quit' are irreversible.  
  76.  
  77.  
  78.     DCACHE.TTP   accepts  commands  which  follow  the  following
  79.     syntax: 
  80.  
  81.     /* SEQ: sequence, repetition. OPT: optional */
  82.     <commands-sequence>     :: <commands> LIST <blanks>
  83.     <blanks>                :: <blank> SEQ
  84.     <blank>                 :: space, tab, newline
  85.     <commands>              :: <driveset> '=' <cmds>
  86.     <driveset>              :: <driveletter> SEQ OPT
  87.     <driveletter>           :: letter in the range 'a'..'p'
  88.     <cmds>                  :: <cmd> SEQ OPT
  89.     <cmd>                   :: <letter> <param> OPT 
  90.     <param>                 :: integer
  91.  
  92.     Commands   have  two  parts:  a  sequence  of  single  letter
  93.     commands  and  a set of drives to which these commands apply.
  94.     However,  if  the <driveset> is empty the commands will apply
  95.     to all drives.  The following commands are implemented: 
  96.  
  97.         c<size>: Create  cache of <size> Kb.  Only allowed during
  98.                 initialization.  
  99.  
  100.         m<size>: Only  requests  for  contiguous  blocks  smaller
  101.                 than  <size>  are  cached.   Default  is half the
  102.                 size  of  the cache.  Smaller values prohibit the
  103.                 removal  of  small,  more  often  used, pieces of
  104.                 cached disk (by large, contiguous blocks).  
  105.  
  106.         w, W:   Disable   resp.   enable  writethrough  of  write
  107.                 requests  to disk. Default is W.  If W is invoked
  108.                 all entries are flushed.  
  109.  
  110.         b<size>: <size>  Kb.  are reserved to optimize flushes to
  111.                 disk.  This  buffer is used for all caches and is
  112.                 not  used  for  the specified driveset only.  See
  113.                 also   remarks  on  writethrough.   Only  allowed
  114.                 during initialization.  
  115.  
  116.         f: Flush contents of unwritten cache entries.  
  117.  
  118.  
  119.  
  120. DCACHE V1.0f                  - 2 -                  19 June 1988
  121.  
  122.  
  123.  
  124.  
  125.  
  126.         i: Invalidate,  i.e. first flush, then remove all entries
  127.                 from the administration.  
  128.  
  129.         r: Remove  cache,  i.e.  first invalidate and then remove
  130.                 caching.   If  no  cache  is  left,  the  caching
  131.                 routine  will  be  removed  from the system.  All
  132.                 these actions are irreversible.  
  133.  
  134.         q: Quit  cache,  i.e.  remove  all  caches, regardless of
  135.                 which  driveset  is  specified.   Memory used for
  136.                 the  cache is not returned  to the system (due to
  137.                 the   (non)structure   of   Atari   ST's   memory
  138.                 management).  
  139.  
  140.         s, S:  Stop resp. continue cache usage, first invalidate,
  141.                 then  mark  as  out  of  use  until continuation.
  142.                 Default is S.  
  143.  
  144.  
  145.     Some examples: 
  146.  
  147.         a=c100: Create cache of 100Kb on drive a.  
  148.  
  149.         ac=c100w: Create  a  cache  of  100Kb  for  both a and c.
  150.                 Written   entries  are  not  immediately  written
  151.                 through.  
  152.  
  153.         a=c20 c=c200: Create seperate caches for a and c.  
  154.  
  155.         =i: Invalidate caches for all drives.  
  156.  
  157.  
  158.     All  the abovementioned commands, except 'c' and 'b' can also
  159.     be  executed from the desktop if the deskaccessory DCACHA.ACC
  160.     is  installed.  Though the accessory provides the same set of
  161.     commands,  it  is  more convenient to use if one is using the
  162.     desktop  only.   It  also  offers the possibility to get some
  163.     information  about  the  cache:  is the drive mounted, cached
  164.     and  if  so,  what  are  the  sizes  (in Kb) and what are the
  165.     number  of  cached and unflushed entries (in sectors).  If it
  166.     fails  to  access the installed cache handler for information
  167.     the  accessory  will  come with a message concerning the fact
  168.     that the  cache  is  not installed. Commands will be executed
  169.     if selected and a set of drives has been specified and the OK
  170.     button is selected.
  171.  
  172.     One  is  advised to invalidate a drive before putting another
  173.     disk  in  it.   See  also the remarks on writethrough for the
  174.     risks involved in using non-writethroug mode.  
  175.  
  176.  
  177. IMPLEMENTATION 
  178.  
  179.  
  180. DCACHE V1.0f                  - 3 -                  19 June 1988
  181.  
  182.  
  183.  
  184.  
  185.  
  186.     In  order  to  be  able to cache, the vector which is used by
  187.     the  BIOS routine Rwabs (read/write sector from/to a disk) is
  188.     replaced  by  DCACHE  with a caching read/write routine,  the
  189.     old  routine  is  used for requests which cannot be satisfied
  190.     by  the  cache  itself.   Other  packages  might also do this
  191.     (e.g.  the  shell  I  normally work with), so be aware of the
  192.     possible  interactions  with  other  stuff  running  on  your
  193.     machine.   Drives  'a'  and 'b' can also be accessed via some
  194.     other  'Extended  BIOS'  routines and circumvent the cache in
  195.     this  way.   GEMDOS doesn't seem to use these routines, other
  196.     packages (Disk copiers ?) may.  
  197.  
  198.     Changes  to  the  settings  of  the cache are accomplished by
  199.     calling   Rwabs  with  some  parameters  for  a  non-existing
  200.     drive.    This  command  acts  as  some  kind  of  an  escape
  201.     mechanism or UNIX IOctrl call.  
  202.  
  203.     The  entries  will be removed in a LRU order, searching takes
  204.     place by hashing, so is reasonably fast.  
  205.  
  206.     DCACHE  has  been tested on an Atari 1040ST with hard disk, I
  207.     don't know if it will work on Mega ST's.  
  208.  
  209.  
  210. TO WRITETHROUGH OR NOT TO WRITETHROUGH 
  211.  
  212.  
  213.     The   possibility   to  delay  writes  can  have  some  funny
  214.     aspects.   If  you remove your floppy while unwritten entries
  215.     are  still  in the cache, this can give you a corrupted disk.
  216.     The  nice thing however, is that copying and deletion to/from
  217.     floppy  can  sometimes  go fast.  The catch in this case lies
  218.     in  the  fact  that  if a file is copied to a disk configured
  219.     for   non-writethrough  and  deleted  afterwards,  still  has
  220.     entries  in  the  cache which correspond to data once written
  221.     to  the  disk.  This facility is therefore the most useful if
  222.     lots  of  copies  en  deletes  take place and the sectors are
  223.     re-used before flushed to disk.  
  224.  
  225.     Flushed  and  unflushed  entries  are kept in seperate queues
  226.     and  entries  which are dirty are only flushed when the queue
  227.     containing  unflushed  entries is full.  If this is the case,
  228.     all  unflushed  entries  are  written  to  disk, just as if a
  229.     flush  command  has  been given.  This writing can be speeded
  230.     up  a  little by allocating a  buffer with the 'b' command at
  231.     initialization,   which  will  be  used  to  put  consecutive
  232.     unflushed  sectors  in  and write them with one write command
  233.     to disk.  
  234.  
  235.     In  any  case:  know  the risks involved when you have turned
  236.     off writethrough !! 
  237.  
  238.  
  239.  
  240. DCACHE V1.0f                  - 4 -                  19 June 1988
  241.  
  242.  
  243.  
  244.  
  245.  
  246. SPEED 
  247.  
  248.  
  249.     I  ran  several  small  tests  on  my harddisk (SH204), cache
  250.     installed  in  writethrough  mode,  size 300Kb and achieved a
  251.     speedup  of  approx. 1.5 with the startup of my shell and 1st
  252.     wordplus  compared to a situation without a cache at all.  On
  253.     a  floppy drive only system speed up was far more and I think
  254.     DCACHE to be a good alternative for a ramdisk.  
  255.  
  256.  
  257. REMARKS & KNOWN BUGS 
  258.  
  259.  
  260.     If  DCACHE  is  executed  from  the desktop, the desktop will
  261.     convert  all  characters  to  uppercase,  which  will then be
  262.     misinterpreted by DCACHE.  
  263.  
  264.     DCACHE  will  only  read  the  first  128 bytes from the file
  265.     DCACHE.INF.  Comments are not implemented.  
  266.  
  267.     Non  writethrough  is not really supported.  The cache should
  268.     be  reset-resistant  and/or  should  flush  now and then some
  269.     unflushed entries.  
  270.  
  271.     It  is  not  taken into account whether a drive is mounted or
  272.     not.  
  273.  
  274.     If  a  floppy  is  write  protected a possible mediachange is
  275.     detected.   This  will  cause the cache to try to find out if
  276.     another  floppy  has  been put in by reading from the floppy.
  277.     This  costs  extra  time, so if you want to have full profit,
  278.     use your floppies without write protection.  
  279.  
  280.     Disk  changing  while  still  having  unwritten  cacheentries
  281.     should give some error messages or prompts.  
  282.  
  283.     For  reasons  yet  unclear  the  'info'  menu  entry from the
  284.     desktop  reads  from  disk into a buffer with address 0 (yes,
  285.     it's  true !).  A check on this situation is build in but ..?
  286.     .  
  287.  
  288.     DCACHE was written with Mark Williams C.  
  289.  
  290.  
  291. AUTHOR 
  292.  
  293.  
  294.                             Atze Dijkstra
  295.             private:        Pr. Irenelaan 37
  296.                             3832 CA  Leusden-Z
  297.                             The Netherlands
  298.  
  299.  
  300. DCACHE V1.0f                  - 5 -                  19 June 1988
  301.  
  302.  
  303.  
  304.  
  305.  
  306.             work:           Dept. of Computer Science
  307.                             State University of Utrecht
  308.                             P.O. Box 80.089
  309.                             3508 TB  Utrecht.
  310.                             UUCP: .. mcvax!ruuinf!atze
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360. DCACHE V1.0f                  - 6 -                  19 June 1988
  361.  
  362.