home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / utilitys / 184 / lutils / l-utils.doc < prev   
Encoding:
Text File  |  1988-05-10  |  8.4 KB  |  188 lines

  1.  
  2.  
  3.                                 L-Utils
  4.  
  5.                    L-Ram    The ST recoverable RAMdisk
  6.                    L-Cache  The ST disk-caching system
  7.  
  8.               Shareware Software (c) 1988 by Keith Ledbettter
  9.               -----------------------------------------------
  10.  
  11.  
  12.    Welcome to L-RAM and L-CACHE for your Atari ST.  I wrote these programs
  13. about 8 months ago for my own use in my software development.  These programs
  14. were originally going to be part of a commercial product, but I have since
  15. decided to offer them through the "share-ware" market.   So, these programs
  16. are well-tested and bullet-proof.  I have been using both daily for the last
  17. 8 months, and they have both been running non-stop on the Midnight Express!
  18. bulletin board (804-379-4156) for about the last 6 months.   Both of these
  19. programs are written in assembler, so they perform at a very high rate of
  20. speed.   I hope you enjoy them!
  21.  
  22.  
  23.  
  24.                         What's in the ARC file.
  25.                         -----------------------
  26.  
  27.       The following programs are present in the LUTILS.ARC file:
  28.  
  29.         L-UTILS.DOC     -   The file you are reading now.
  30.  
  31.         L-CONFIG.PRG    -   The configuration program for both the
  32.                             cache and the RAMdisk.
  33.  
  34.         L-CONFIG.RSC    -   The resource file for the configuration program.
  35.  
  36.         L-RAM.PRG       -   The RAMdisk program.
  37.  
  38.         L-CACHE.PRG     -   The disk cache program.
  39.  
  40.         L-STATS.TOS     -   Shows disk-cache statistics.
  41.  
  42.  
  43.  
  44.                         L-RAM, The Recoverable RAMdisk
  45.                         ------------------------------
  46.  
  47.  
  48.    L-RAM was written mainly for the extra memory available in the new MegaST
  49. machines, but it functions just as well on a 520ST as it does a 4-MEG Mega.
  50. L-RAM takes advantage of the large memory-model machines by allocating much
  51. more directory storage than most ST Ramdisks do.   L-RAM allows up to 256
  52. directory entries in the main (root) directory.    L-RAM is also reset-proof,
  53. so your RAMdisk data will be restored if you press the reset button on the
  54. back of your machine.  This is invaluable to people doing software development.
  55.  
  56.  
  57.  
  58.                         L-CACHE, The ST Disk Cache
  59.                         --------------------------
  60.  
  61.  
  62.   What is a disk cache?  Well, a disk cache can be thought of as kind of a
  63. "RAMdisk hybrid".   A disk cache allocates a portion of the memory in your
  64. machine for its use, and then "stores" recently accessed portions of disk data
  65. into this area.  The next time a disk access is requested, the cache looks in
  66. its buffers in memory to see if that information is already in memory.   If it
  67. is, then the cache acts just like a RAMdisk and sends the data from memory to
  68. the requestor of the data, just as though it had been read from disk.
  69.  
  70.  
  71.   If the data is not currently in memory, then the cache program reads the
  72. data from the disk, saves it in its buffers, and then returns the data to the
  73. requestor (which can be a program, GemDOS, etc.).
  74.  
  75.  
  76.   Once the disk cache buffers fill up, and new data must be stored, the cache
  77. must "purge" some data out of the buffers to make way for the new data to be
  78. stored.   L-CACHE uses the very-popular "LRU" method for buffer management.
  79. In layman terms, it simply replaces the data that has been in the buffer
  80. (without being accessed) for the longest period of time.
  81.  
  82.  
  83.   L-CACHE is a "write-through" cache, which means that any WRITES to disks get
  84. performed IMMEDIATELY, so there is no chance of you losing any data.  It would
  85. be nice to cache writes and then write them to the disk at pre-determined
  86. times, but it's just too dangerous in a small-computer environment.
  87.  
  88.  
  89.   A unique feature of L-CACHE is that you can specify (a) what drives you want
  90. to be cached and what drives you don't want to be cached, and (b) whether you
  91. want to do "read-only" caching or "read-write" caching on a particular drive.
  92. What??  You just told me L-RAM didn't cache writes!  Well, what I mean by
  93. "write caching" is "do you want L-CACHE to save writes into its buffers after
  94. writing the information to the disk?".
  95.  
  96.  
  97.   It's a little hard to understand, so let's take an example.  Let's assume
  98. that you have L-CACHE set up for a 100K cache.   Now, let's say you do a COPY
  99. of a 50,000 byte program (A.PRG) from drive C: to drive D:.   If you had drive
  100. D: set up as a "write caching" drive, that single copy command would flush the
  101. ENTIRE 100,000 byte cache buffer.  This is because as the source file got read
  102. it would be put into the cache buffers (thereby occupying 50K), and as the
  103. destination file got written, that data would also be placed into the cache
  104. buffers, thereby occupying the other 50K of the cache.
  105.  
  106.  
  107.   If you had drive D: set up as a "read-only" cache, then the above COPY
  108. command would cause only half of the cache buffers to get purged.  This is
  109. because only the reading of the source file would get buffered;  writes to
  110. the file on drive D: would simply be passed through and ignored.
  111.  
  112.  
  113.   If you have a drive set up as "read-cache", and a write occurs to that drive,
  114. then L-CACHE will check to see if the sector being written is currently in
  115. memory.  If it is, then L-CACHE will update that buffer in memory prior to
  116. passing the write on to the disk.
  117.  
  118.  
  119.   L-CACHE will cache both single-sector and multi-sector reads.
  120.  
  121.  
  122.  
  123.                 Using and configuring L-RAM and L-CACHE
  124.                 ---------------------------------------
  125.  
  126.  
  127.   L-RAM.PRG and L-CACHE.PRG must be placed in your \auto\ folder on your
  128. boot drive.  *** L-RAM.PRG MUST BE LOADED BEFORE L-RCACHE.PRG ***.  This
  129. simply means copy L-RAM to your auto folder, then copy L-CACHE.
  130.  
  131.   After placing these two programs in the \auto\ folder, copy the L-CONFIG.PRG
  132. and L-CONFIG.RSC files to the root (main) directory of the drive.  Now, click
  133. on L-CONFIG.PRG to configure the programs.
  134.  
  135.   After loading L-CONFIG, you will be presented with the normal GEM menu-bar.
  136. Move the mouse to "Configure" and choose the "Configure cache" selection.
  137. The program will load in the current configuration from the \auto-\l-cache.prg
  138. file.   At the top of the screen is the area where you specify what caching
  139. action to perform on each drive.  Simply choose one of the selections "Read
  140. only", "Read/Write", or "Don't cache".   Then, use the slide bar at the bottom
  141. of the screen to specify how much memory you want to be allocated for the
  142. cache.   I usually use around 100K for this, but you'll need to tune it to
  143. your specific memory requirements.   When you are done, click on the "Save
  144. Configuration" box and the program will update the \auto\l-cache.prg file to
  145. reflect the new configurations.
  146.  
  147.  
  148.   Next, move the mouse to "Configure" and choose the "Configure Ramdisk"
  149. selection.  The program will load in the current configuration from the
  150. \auto-\l-ram.prg file.   At the top of the screen is the area where you
  151. specify which drive you want to be your RAMdisk drive.  Then, just as in the
  152. cache configuration, use the slide bar at the bottom of the screen to specify
  153. how memory you want to be allocated for the RAMdisk.  When you are done, click
  154. on the "Save Configuration" box and the program will update the
  155. \auto\l-cache.prg file to reflect the new configurations.
  156.  
  157.  
  158.   The last file on the disk is L-STATS.TOS.  This program will show you the
  159. current statistics on the disk cache.  These statistics include
  160.  
  161.                 -  The total disk accesses requested
  162.  
  163.                 -  The total number of cache "hits" (a hit is when
  164.                      a sector requested was found in memory).
  165.  
  166.                 -  The total number of cache "misses" (a miss is when
  167.                      a sector requested was not found in memory and
  168.                      had to be read from disk).
  169.  
  170.                 -  The percentage of disk accesses that were "hits".
  171.  
  172.   This program can be run periodically to help you "fine tune" the size of
  173. your disk cache.  For example, if you are continually showing a hit
  174. percentage of 10%, then you are probably wasting time even using the disk
  175. cache, or you should dramatically increase the memory allocated to it.
  176.  
  177.  
  178.   If you have any questions about these utilities, you can leave me Email at
  179. any of the following places:
  180.  
  181.                 CompuServe:   76701,124
  182.                 GEnie     :   K.LEDBETTER
  183.  
  184.                                         Enjoy!
  185.  
  186.                                           Keith Ledbetter
  187.  
  188.