home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / utility / system / rainbow / cachread.me < prev    next >
Text File  |  1990-01-26  |  6KB  |  124 lines

  1. CACHEnnn, by Ken Badertscher
  2. Copyright 1989, Atari Corp.
  3.  
  4. A program to add cache buffers to Rainbow TOS, and make your hard disk
  5. scream...
  6.  
  7. Why cache?
  8. ==========
  9. The advantage of having cache memory available for Rainbow TOS is that
  10. it means that the OS doesn't have to look on the disk every time it
  11. needs to know where to go to find a file or a bit of data.  It keeps as
  12. much information as it can in the cache memory you give it, so that
  13. frequently used directories and data can be quickly accessed.  Some
  14. caches use a method called "deferred writes" to keep even more stuff
  15. around in memory, but TOS does not do that.  The TOS cache is a "write
  16. through" cache, which means that there is never anything in the cache
  17. which isn't also on the disk.  Thus, CACHEnnn is both fast and safe.
  18. How fast?  CACHEnnn can increase the performance (read: decrease file
  19. access time) by as much as TEN TIMES what it would be without the cache.
  20.  
  21. Running CACHEnnn
  22. ================
  23. You can use CACHEnnn in several ways.  The easiest is to change its name
  24. and put it in your auto folder (or run it from the desktop).  It works
  25. like FOLDR100, in that its filename determines how much cache you get. 
  26. Technically, there are two kinds of cache buffers - one kind holds File
  27. Allocation Tables and root directories (we'll call these "F buffers")
  28. and the other kind holds data and subdirectories ("D buffers").  When
  29. you rename CACHEnnn, you tell it how many of each kind of buffer you
  30. want.  For example, if you rename CACHE.TTP to CACHE90.PRG, it will add
  31. 90 F buffers and 90 D buffers that TOS can use as a cache after it runs.
  32.  
  33. Command line usage
  34. ==================
  35. CACHEnnn can also be used from a command line (after all, it is called
  36. CACHE.TTP if you don't rename it...).  If you use a command line shell,
  37. and type CACHE -H, you will see a message similar to the following:
  38.  
  39. Usage:    cache [D]nnn [Fnnn] (nnn = 1 to 999)
  40.     D=Data/Dir buffers
  41.     F=FAT/Root Dir buffers
  42.     no letter=nnn of each
  43. `cache d10 F 20' adds 10 D, 20 F buffers.
  44.  
  45. Or, rename to CACHEnnn.PRG and run (equivalent to `cache nnn').
  46. CACHEnnn Copyright 1989, Atari Corp.
  47.  
  48. What all that means is that you have three ways of specifying on the
  49. command line what kind and how many cache buffers you want to add.  If
  50. you just give it a three digit numerical argument, it will add that
  51. many F _and_ D buffers.  This is the same as renaming it to
  52. CACHEnnn.PRG and running it from the desktop or auto folder. 
  53. Alternatively, you can specify how many F buffers and how many D
  54. buffers you want, by using the Fnnn and Dnnn arguments.  The letter
  55. part of these arguments can be in upper or lower case, and may be
  56. separated from the digits by spaces.  Any digits past the third are
  57. ignored, so if you say CACHE F1234, you'll only get 123 F buffers
  58. added.
  59.  
  60. How many buffers?
  61. =================
  62. I personally find it easiest to just put CACHEnnn in my auto folder,
  63. but performance nuts might want to tweak just the right buffer numbers
  64. for their setups.  90 each of F and D buffers seems to be a good number
  65. for a 20 megabyte hard disk (CACHE90.PRG in the auto folder).  You may
  66. want more if you have more storage.  Also, depending on how you set up
  67. your directory structure, you may want more F or D buffers.  Generally,
  68. if you have a lot of deeply nested subdirectories, you'll want more D
  69. buffers for optimum cache performance.  If you keep everything in the
  70. root directories on your hard disk partitions, you'll want a lot of F
  71. buffers.  The amount of memory taken up by cache buffers is another
  72. consideration.  Normally, each cache buffer (F or D) uses a little over
  73. 512 bytes, so if you're running CACHE90.PRG, you'll get about 90K of
  74. cache buffers.  If you are using AHDI 3.01, and have any partitions
  75. bigger than 16 megabytes, the cache buffers will be bigger (1K or more
  76. each).  CACHEnnn tells you the approximate amount of memory it uses for
  77. cache buffers when you run it, so you'll know if you're using an
  78. outrageous amount of cache memory. Experiment with different numbers -
  79. you won't hurt anything.
  80.  
  81. Error handling...
  82. =================
  83. CACHEnnn will abort with an informative error message if you give it no
  84. arguments and it is unable to find itself in the current directory or in
  85. the auto folder on your boot disk.  It will also check to make sure you
  86. aren't trying to add too many cache buffers, and it will refuse to add
  87. buffers if they leave less than 256K of free memory.  All that cache
  88. memory isn't going to help you much if you don't have any memory left to
  89. run programs!
  90.  
  91. CACHEnnn Caveats
  92. ================
  93. CACHEnnn is most useful on a system which has TOS version 1.4 (Rainbow
  94. TOS) or later, with a hard disk.  Cacheing will help with floppies too,
  95. but the performance increase is much more dramatic on a hard disk
  96. system.  Usually on a floppy based system, you're popping disks in and
  97. out frequently, and that invalidates the information in the cache. 
  98. Hard disks, on the other hand, are removed much less frequently, so
  99. information cached from hard disks is valid as long as your system is
  100. turned on.  You can use CACHEnnn with TOS versions previous to Rainbow
  101. TOS, but there isn't much point.  Older TOS versions will use the cache,
  102. but they will often ignore it and go to the disk instead of reading
  103. valid information from the cache.  If you don't have Rainbow TOS, you
  104. will see very little, if any, performance improvement using CACHEnnn.
  105.  
  106. Technical stuff
  107. ===============
  108. An earlier version of this cache program was distributed with early Beta
  109. releases of TOS 1.4.  THAT PROGRAM CAN NOT BE USED WITH AHDI 3.01!  The
  110. reason for this is that AHDI 3.01 (unreleased at the time the original
  111. cache program was written) requires variable size cache buffers.  This
  112. official release of CACHEnnn handles variable size buffers correctly.
  113.  
  114. If you're concerned about how much memory this program is wasting (after
  115. all, it is a whopping 1051 bytes long), don't be.  The program uses a
  116. psychotic method of installing itself which only leaves 128 bytes more
  117. than the actual cache memory requested after the program terminates.  I
  118. would have gotten rid of that 128 bytes if I could, but GEMDOS won't let me.
  119.  
  120. Developers who are interested in the technique of adding cache buffers
  121. to GEMDOS are referred to the Rainbow TOS release notes, where the
  122. subject is covered thoroughly.  All in all, it's just easier to use CACHEnnn.
  123.  
  124.