home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff187.lzh / SetCPU / SetCPU.txt < prev    next >
Text File  |  1989-02-26  |  7KB  |  157 lines

  1.  
  2.             SetCPU V1.4
  3.                by Dave Haynie 
  4.         (released to the public domain)
  5.  
  6.  
  7.     This program is designed to allow the user to detect and modify
  8. various parameters related to 32 bit CPUs in Amiga computers.  This program
  9. began life as "WhatCPU", which did little more than read the proper place
  10. in ExecBase and report what kind of CPU/FPU was in the system.  The first
  11. version of SetCPU added the capability to identify a 68030 and to change the 
  12. cache parameters of the 68020 and 68030 systems.  The recently released SetCPU
  13. V1.3 also did tests for 68882 vs. 68881, and for the presence of an MMU.  It
  14. was supposed to allow for checking of a particular thing in a startup 
  15. sequence, but unfortunately the CHECK code in V1.3 was broken.
  16.  
  17.     That brings us up to V1.4.  As well as fixing and extending the CHECK
  18. code, SetCPU V1.4 also has some simple MMU code to allow 32 bit systems with
  19. MMUs to copy ROM into RAM and then relocate this RAM as ROM, thus greatly
  20. enhancing the speed of ROM based operations.  This "FASTROM" code isn't
  21. extremely sophisticated, and could possibly run into trouble on other 32 bit
  22. systems, but it has been tested on the A2620.  It will certainly have to be 
  23. rethought to work properly with memory outside of the 68000 compatible 24 bit
  24. address space.
  25.  
  26.     In any case, the syntax of the program is given as follows:
  27.  
  28.         SetCPU [INST|DATA] [[NO]CACHE|[NO]BURST]
  29.                [[NO]FASTROM [TRAP]] [NOMMUTEST]
  30.                [CHECK 680x0|68851|6888x|MMU|FPU]
  31.  
  32. where "[]" indicates an optional parameter, "|" indicates a choice of
  33. parameters.  Typing "SetCPU ?" will retrieve this same syntax diagram.
  34. Typing SetCPU alone will result in the SYSTEM configuration being 
  35. send to the console, my current system returns this:
  36.  
  37.     SYSTEM: 68020 68881 68851 FASTROM (INST: CACHE)
  38.  
  39. This indicates I have a 68020/68881/68851 system (eg, standard A2620), I've
  40. previously installed the FASTROM translation, and my instruction cache is
  41. turned on (done by AmigaOS V1.2 or V1.3).  Note that any parameters that
  42. don't make sense to the real system configuration, such as asking to modify
  43. the data cache on a 68020 system or install the FASTROM translation on a
  44. 68000 system are just ignored.
  45.  
  46.     The individual commands are given below in detail:
  47.  
  48.  
  49. [NO]CACHE
  50.     This command will switch on or off 68020 and 68030 caches.  If
  51.     not qualified, it'll act on both instruction and data caches of
  52.     the 68030.
  53.  
  54. [NO]BURST
  55.     This command will switch on or off the burst cache line fill 
  56.     request of the 68030.  If not qualified, it'll act on both 
  57.     instruction and data caches.
  58.  
  59. INST
  60.     This preceeds a CACHE or BURST operation to restrict it's application
  61.     to the instruction cache only.
  62.  
  63. DATA
  64.     This preceeds a CACHE or BURST operation to restrict it's application
  65.     to the data cache only.
  66.  
  67. [NO]FASTROM [TRAP]
  68.     This activates the FASTROM translation on or off an MMU equipped 
  69.     system.  When switching on, it first allocates 256K of memory for
  70.     the ROM image, then currenly 512 bytes of memory for the MMU table.
  71.     It copies the ROM into the image area, then applies the translation
  72.     by pointing the MMU at the table and activating it.  The TRAP option
  73.     causes the MMU to look at all 32 bits of address; access to any 
  74.     memory outside of the 24 bit space will result in an exception, which
  75.     if unhandled, results in a GURU 2.  When TRAP is not specified, the 
  76.     MMU is only looking at 24 bits of address space.  This is the mode 
  77.     you'd normally run in.  Under V1.3 and earlier releases, a DOS bug 
  78.     can cause invalid accesses, which cause the exception, when running 
  79.     the EndCLI or NewCLI/NewShell programs; running untrapped will avoid 
  80.     gurus with these commands.  It's still possible to run into an 
  81.     exception when running without the TRAP option.  One easy way is 
  82.     writing to the ROM image, which is write protected by the MMU.  The 
  83.     NOFASTROM option will switch off the MMU and reclaim the memory used
  84.     for the ROM image and MMU table.  Note that this is achieved by 
  85.     locating these items via the appropriate MMU registers.  If any other
  86.     program set up the MMU for something, this could be a very bad thing
  87.     to do.  In general, until there's some level of OS support for the 
  88.     MMU in Amiga systems, you're really safe using only one MMU tool at 
  89.     a time.
  90.  
  91. NOMMUTEST
  92.     This option won't normally be necessary.  However, some 68020 boards
  93.     out there apparently have hardware bugs of some sort that make
  94.     testing for the MMU impossible, at least as near as I can tell.  If
  95.     your 68020 board freezes, or crashes with some kind of coprocessor 
  96.     protocol violation GURU (probably numbers $0D or $0E), you have a
  97.     problem with your 68020 board.  The most common bug is the 68020
  98.     board hardware failing to fully decode CPU space, such that the FPU
  99.     in the system also responds to the MMU's address space.
  100.  
  101. CHECK 
  102.     This option lets you check for the existence of a particular
  103.     CPU system component in a script.  It works like this:
  104.  
  105.         SetCPU CHECK 68020
  106.         If WARN
  107.             echo "No 68020 here!"
  108.         Else
  109.             echo "Sho nuff got a 68020 here!"
  110.         Endif
  111.  
  112.     The arguments to CHECK can be any of:
  113.  
  114.         68000    Matches the obvious
  115.         68010    "
  116.         68020    "
  117.         68030    "
  118.         68851    "
  119.         68881    "
  120.         68882    "
  121.         FPU    Matches 68881 or 68882
  122.         MMU    Matches 68851 or 68030
  123.  
  124. That's about it.  As mentioned, this code is public domain, and you're
  125. free to do anything with it you like.  Even make it better!  For any real
  126. MMU programming, I'd recommend both "MC68030 Enhanced 32-Bit Microprocessor
  127. User's Manual" and "MC68881 Paged Memory Management Unit User's Manual",
  128. both from Motorola.  There are some differences between the two, please make 
  129. sure, if you're writing any MMU code, that you either write code that works
  130. on both, or you specifically check for each MMU and act accordingly.
  131.  
  132. Also note that much of what SetCPU does may be wrong in a future release of
  133. the OS, so it's a very bad idea to put any of this stuff in a commercial
  134. program.  Things like identifying the MMU, CPU, or FPU that aren't fully
  135. done in 1.3 may still work in a future OS release, but if that OS is
  136. correctly identifying the MMU, CPU (eg, 68020 vs. 68030), or FPU (eg,
  137. 68881 vs. 68882), SetCPU should be using the OS's opinion of these items,
  138. not testing itself.  On a more drastic note, if an OS ever starts using
  139. the MMU, the FASTROM code will certainly break.  It's the job of the OS to
  140. arbitrate the MMU, and if the OS is doing that, no legal program would be
  141. able to come along and muck with the MMU registers without reeking havoc
  142. on the operating system.
  143.  
  144. One final note, if you have a 68020 board that locks up without the
  145. NOMMUTEST option, you'd be wise to express your concerns to the vendor
  146. of that board.  There's an awful good chance that if, in the future, 
  147. Amiga releases an operating system that knows about the MMU, it'll test
  148. for it in some way, probably similar to what I do here.  If your board
  149. locks up on MMU operations, you may not be able to run this future OS
  150. on your 68020 board.  Maybe the vendors can fix these now, instead of
  151. later when you really need this fixed.
  152.  
  153.             -Dave Haynie
  154.              PLINK:        D-Dave H
  155.              bix:        hazy
  156.              usenet:    {uunet,rutgers}!cbmvax!daveh
  157.