home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / chipcach.lzh / ChipCache.txt next >
Encoding:
Text File  |  1990-09-03  |  9.6 KB  |  256 lines

  1.  
  2. !!!!!!   P R E L I M I N A R Y    R E L E A S E    !!!!!!
  3.  
  4. *************************************************************************
  5. *                                                                       *
  6. *       AMICOM'S  A3000 MMU PATCH   VERSION 1.08 (1990-08-15)           *
  7. *                                                                       *
  8. *************************************************************************
  9.  
  10.  
  11.  
  12.       ChipCache V1.08  Description
  13. -------------------------------------------------------------------------
  14.  
  15. This is a small tool that can improve the performance of certain
  16. A3000 configurations by turning on Instruction Cache in Chip-Memory.
  17. Furthermore, it allows you to make use of an additional 200kB of
  18. Fast Memory when running under Kickstart 1.3.
  19.  
  20. It is rather hacky and will probably not work on future releases of the
  21. A3000 Operating System. To prevent crashes, a number of checks are done.
  22.  
  23.  
  24.  
  25.       ChipCache V1.08  Introduction
  26. -------------------------------------------------------------------------
  27.  
  28. Let me first explain how I came to the idea for this tool.
  29. Of course one of the first things I did with my new A3000 was to check out
  30. some graphics software to see the speed-improvements.
  31. Thereby I made an interesting observation: A demo that did not work on
  32. the A2620 unless you turned-off Instruction Cache worked perfectly
  33. with the Instruction Cache turned on!  I started to investigate on that
  34. until I finally came across a line of text in the 68030 manual that says:
  35. 'The CI bit will disable both caches in the corresponding pages'.
  36.  
  37. The problem is the following: you MUST disable the Data Cache in all
  38. locations where other bus masters can alter memory. Imagine a word of data
  39. being read from memory by the CPU. This word is stored in the Data Cache.
  40. The next time the program reads the same memory location, the word is
  41. fetched from Data Cache instead from memory, to increase speed.
  42. However, if the same memory location has been written to by disk DMA
  43. for example, then the value in the cache is not valid and incorrect data
  44. is being used by the processor.
  45. Treating of such memory regions is done by means of either the MMU
  46. translation table (which in the A3000 is also used to map the Kickstart
  47. into the correct place), or by the memory controlling hardware.
  48. Hardware Cache disable is done on a cycle-by-cycle basis through a pin
  49. on the 68030. Software Cache disable uses a special bit named Cache
  50. Inhibit in the MMU tree structure. On the 68020/68851, this would only
  51. disable Data Cache. On the 68030, this same bit also disables Instruction
  52. Cache. Why this is, I cannot tell and I'm afraid there is no sense in
  53. it. Under no circumstances, neither graphics DMA data, nor hardware
  54. registers will ever be used as program (Assembler instructions).
  55. [ There is one big exception to that: Harddisk DMA. BUT: that problem is
  56. resolved by a different means: The Instruction Cache is flushed after
  57. every harddisk DMA load. So that point can be left in the discussion. ]
  58.  
  59. With a standard A3000 using the disk-Kickstart you have about 300Kb of
  60. FAST memory after boot-up. Therefore you will very soon end up without
  61. FAST mem and code gets loaded into CHIP memory, causing heavy performane
  62. degradation. This degradation results from two sources:
  63.  
  64.     - The Chip memory access clock is only 7.1 MHz
  65.        compared to 12.5 / 25Mhz in FAST memory.
  66.  
  67.     - There is no Instruction Cache in Chip Memory
  68.  
  69. The latter can now be fixed using ChipCache at the cost of complete
  70. renounce of the Data Cache.
  71. Note that this is by no means a general improvement to the A3000.
  72. It does in fact REDUCE the performance of a well-equiped A3000 that has
  73. lots of FAST memory, because it disables the Data Cache.
  74.  
  75.  
  76.  
  77.       ChipCache V1.08  Description
  78. -------------------------------------------------------------------------
  79.  
  80. Chipcache lets you
  81.  
  82.     1. help the no-Cache-in-Chipmemory problem
  83.     2. find out how much Kickstart-memory is unused and can
  84.         be used otherwise
  85.     3. remove the write protection of that memory
  86.  
  87.  
  88.  
  89.       ChipCache V1.08  Options
  90. -------------------------------------------------------------------------
  91.  
  92. Usage: ChipCache [-DATA=D] [-NOWPRO=NP] [-RESET=R] [-NOCHIPCACHE=NC]
  93.                  [-SHOWMEM=S]
  94.  
  95. -DATA = D
  96. This option causes the Data Cache not to be turned off.
  97. The state your machine goes into using this option is not guaranteed
  98. to be stable. Use this option AT YOUR OWN RISK and be careful!
  99. The best thing is to start a low-level application immediately
  100. after activating ChipCache with Data Cache.
  101.  
  102. -RESET = R
  103. This option resets the chipmemory Cache (inhibts it) to normal mode.
  104. It will also turn on the Data Cache and set the write protection
  105. of the translation table memory.
  106.  
  107. -NOWPRO = NP
  108. This option causes the write protection of the top 256kb of FAST RAM
  109. (from $07fc0000 to $08000000) to be removed.
  110. You are able then to alter the translation table, or use some free
  111. memory for your own purposes.
  112.  
  113. -SHOWMEM = S
  114. This option will tell you the address range (if any) in the top FAST
  115. memory region that is unused and can be gained using AddMem.
  116. NOTE: This option will only work if you did not use the extra memory
  117.  region before, because it simply scans for the beginning of the region
  118.  containing only zeros.
  119.  
  120. -NOCHIPCACHE = NC
  121. This option reverts the chipcache function. Chipmemory Cache will
  122. be turned off.
  123.  
  124.  
  125.       ChipCache V1.08  Instructions
  126. -------------------------------------------------------------------------
  127.  
  128. As mentioned before, ChipCache has two basic functions:
  129.  
  130.   - enable instruction cache in Chip Memory (default)
  131.   - turn off writeprotection of top 256kB Fast Memory
  132.  
  133. * The CHIPMEMORY CACHE FUNCTION is completely undangerous and so you
  134.   may enter without risk:
  135.   
  136.       ChipCache
  137.   
  138.   which will present you an overview of the former and the new
  139.   system status.
  140.   Two parameters are changed: The Chipmemory Cache is turned on and the
  141.   Data Cache is turned off (see Introduction).
  142.   The Chipmemory Cache function is of equal usefulness in both
  143.   Kickstart / AmigaDOS 1.3 and 2.0
  144.   
  145. * If you want to go BACK TO THE INITIAL STATE, just enter
  146.   
  147.       ChipCache -RESET
  148.   
  149.   You need not use capital letters for options and you may take advantage
  150.   of the abbreviations stated after the options names presented by
  151.   
  152.       ChipCache ?
  153.   
  154. * Extensive experimenting showed me that despite the considerations about
  155.   Data Cache in Chip Memory, the machine may actually work ok.
  156.   THIS DOES NOT MEAN THAT I GUARANTEE THAT IT WORKS!
  157.   To allow you to experiment for yourself, I built-in option DATA.
  158.   USE IT AT YOUR OWN RISK! System crashs can cause 'Key already set' problems!
  159.   It is quite safe to use it with low-level (non-multitasking) software
  160.   like Starglider and other games. Here, a speed increase can be stated.
  161.   To enable both Chipmemory and Data Cache enter
  162.   
  163.       ChipCache -DATA
  164.   
  165. * Since the Kickstart 1.3 uses only about 270kB of the 512kB that
  166.   are allocated for it, and we are very short of Fast Memory on the
  167.   standard A3000, I came to the idea to use free space as system
  168.   memory. Unfortunately, this region is write protected by MMU code
  169.   that is set-up by the boot-rom.
  170.   Therefore, I built a tool that removes this write protection and
  171.   fitted it into ChipCache, too.
  172.   To take advantage of this also, you need first to find out where
  173.   exactly that usable memory is located.
  174.   To do so, enter
  175.   
  176.       ChipCache -SHOWMEM
  177.   
  178.   This will most probably give you the answer:
  179.   
  180.       Usable memory from $07fc5000 to $07ffffff.
  181.   
  182.   Note that this inquiry cannot be repeated after you used that
  183.   memory as system memory. It works only as long as this memory
  184.   has never been touched.
  185.   Then, you need to remove the writeprotection by entering
  186.   
  187.       ChipCache -NOWPRO
  188.   
  189.   As you can see now, the status of the write protection has changed
  190.   to inactive. Now you may add that memory to the system using
  191.   the AddMem tool. Enter
  192.   
  193.       AddMem $7fc5000 $7ffffff
  194.   
  195.   CAUTION: -    Attempting to AddMem to a region that does not contain
  196.           usable memory will instantly result in a crash.
  197.          -    From now on, you must pay attention to NOT use option
  198.           RESET since this would reinstall the writeprotection
  199.           and therefore crash the machine.
  200.   
  201.   Note: To overcome the problem that option RESET may not be used while
  202.   the additional memory is being used, option NOCHIPCACHE lets you
  203.   remove just the Chipmemory Cache, without touching the writeprotection.
  204.   
  205.   
  206. * The memory part that is usually write-protected contains
  207.     - the new libraries, devices and resources the A3000 Kick '1.3'
  208.         needs
  209.       - the system MMU translation table
  210.   Be careful not to overwrite any of these!
  211.   
  212.   If you want to look at the translation table, use CINFO (by me!)
  213.   to locate it.
  214.   If know what you're doing, you can change the translation table
  215.   after removing the write-protection!
  216.   Note also that the translation table is reset-proof, so you end up
  217.   in a reboot-crash-loop if you trash it!
  218.   
  219.   Have Fun!
  220.   
  221.   
  222.   
  223.   
  224.   
  225.   
  226.       ChipCache V1.08  Error messages
  227. -------------------------------------------------------------------------
  228. If ChipCache fails because either
  229.  - you gave invalid options / parameters
  230.  - there was an internal problem (e.g. incompatible OS version)
  231.  - you used it on a system it does not apply to
  232. then it returns an error code of 20.
  233. You may use this for script files like the Add200k tool supplied with
  234. ChipCache.
  235.  
  236.  
  237. Here is a list of all ChipCache error messages:
  238.  
  239. *** This is not an A3000!
  240.  
  241. *** Cannot recognize the A3000 translation table!
  242.     Either you have a different A3000 Boot-ROM than I, or
  243.     you are cheating and using ChipCache on a GVP-Board or so.
  244.  
  245. *** The translation table is somehow strange.
  246.     Hmmm... strange!
  247.  
  248. *** Input line too long!
  249.     
  250.  
  251. *** Got unexpected argument.
  252.     Check for '-' before options.
  253.  
  254. *** Option RESET must be used alone!
  255.  
  256.