home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 441.lha / ChipCache_v1.12 / ChipCache.txt < prev    next >
Encoding:
Text File  |  1990-11-13  |  10.5 KB  |  288 lines

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