home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 575.lha / Personal040DevelopSoft / 040.doc.pp / 040.doc
Encoding:
Text File  |  1991-11-29  |  6.8 KB  |  122 lines

  1. Personal 040 Development Software
  2.  
  3. by Greg Tibbs 1 November 1991
  4.  
  5. This archive contains four programs and their source code to do various things
  6. with a 68040  equipped machine. These programs are called FastROM040, MMU040, and 
  7. ROMSPLIT1 and ROMSPLIT2. All the programs are compiled in SAS C or A68K assembler.
  8. They are all CLI-style programs. 
  9.  
  10.  
  11. FASTROM040
  12.  
  13. FastROM040 remaps the Kickstart ROM to 32 bit Fast Memory. The memory management
  14. address translation tables are set to support the Progressive Peripherals &
  15. Software 040 card for the A3000. The MMU setup supports all internal A3000
  16. motherboard RAM, ZorroII space, Local Bus RAM, and partial ZorroIII space. 
  17. Approximately 25 percent of the 4 Gig address area is declared invalid and
  18. will cause some form of address exception if a spurious write or read is
  19. made to/from these areas. The only option to FASTROM040 is CACHEZ2. If all
  20. you have in ZorroII space is RAM, you can invoke the CACHEZ2 option. Most
  21. 68040 owners will have a hard disk controller and as such should NOT 
  22. invoke this option. A future revision of this program will examine the 
  23. expansion card lists and turn caching on only if it is public memory.
  24.  
  25. Other 68040 accelerators, including those for A2000s whose on-board RAM lives 
  26. in a compatible area should work (If it doesn't lock up, it worked!). All areas 
  27. except the lowest 16MB area that are not invalid are made Copyback Cachable. 
  28. Other utilities, such as CPU, may or may not interfere with the FASTROM040
  29. remap and should be carefully tested for compatibility. Progressive's CPU040
  30. appears safe and can be used to turn the data and instruction caches on and off.
  31. It's copyback enable button however only affects addresses reserved for ZorroIII
  32. address space and turning copyback mode back on restores everything properly.
  33.  
  34. ZorroIII I/O cards, should there be any, will probably not work without re-writing 
  35. this program due to caching enabled in the ZorroIII autoconfig area. A future
  36. version of this program with much larger address translation table requirements 
  37. may fully support the ZorroIII area.
  38.  
  39. The 040 has a simple three level tree structure. To keep things simple, I
  40. pruned the initial table down to one branch which represents the lowest 32 Mb,
  41. which includes the A2000 area. All other branches of the root table are declared 
  42. invalid. The tranparent translation registers (mTTx) will allow reclaiming most 
  43. RAM without the need for massive tables.
  44.  
  45. The one valid entry in the first level (root) table points to another table of 128
  46. pointers which each in turn point to tables of page descriptors. Each second level 
  47. entry represents 256K. Unfortunately the 68040 does not have early termination, but 
  48. only has invalid termination. Since I only care about the lowest 16MB, I declare the 
  49. upper 64 pointers invalid.
  50.  
  51. Each of the remaining 64 second level pointers point to individual 32 entry
  52. page description tables for a total of 2048 page descriptors. In the program this 
  53. took 8K (4 bytes per entry); I jammed all the page desription tables together in one 
  54. memory area so they could be set up with a minimum of code. Each page descriptor
  55. represents 8K of physical address space. The last 64 page descriptors in the
  56. page descriptor table relocate the Kickstart ROM.
  57.  
  58. Personally I am quite disappointed with the 040 MMU. It is of entirely different
  59. design than the 68030 MMU or the 68851 PMMU. The assembly listings had to have
  60. all the 040 opcodes hand assembled. First, there isn't early termination of table
  61. searches. This means that every time the 040 tries to address an area it does not 
  62. have in its address translation cache, it has to abort the current bus cycle,
  63. perform three reads from the tables to get the proper translation and then
  64. restart the bus cycle with the translation. Early termination could have
  65. allowed most areas to be read within one read access instead of three. The second area
  66. that is disappointing with the 040 MMU is that table sizes are fixed to 4K or 8K
  67. per page descriptor. You could go up to 32K per entry with the 68030, meaning smaller
  68. tables and faster loading of the ATC. Finally the biggest problem is that there
  69. is no way to separate Instruction space from Data space. There were bits that
  70. could be set in the 030 and 851 tables that allowed separate tables to be
  71. used to separately control the data versus the instruction caches on a page
  72. by page boundary. Only by cleverly programming the transparent translation registers
  73. can you obtain a separation of cache function over the same physical area.
  74.  
  75. Progessive's initial setup for the 040MMU uses the two Data Tranparent Translation
  76. Registers and one of the two Instruction Transparent Translation registers. This
  77. setup enables the instruction cache for the entire 68040 address space and 
  78. copyback cache mode for all but the lowest 16Mb of the 040 address space for the
  79. data cache. The lowest 16MB is nondatacachable serialized because of the
  80. I/O areas, custom chip registers, and chip ram. This setup is the fastest to all 
  81. areas except it doesn't allow for relocating the ROMs. 
  82.  
  83. When both the translation table and transparent translation registers are enabled,
  84. the 040 only performs a table search if it is not first found by the translation
  85. registers. The transparent translation registers may overlap, in which
  86. case the lower register overrides the upper. The Translation registers are
  87. named ITT0, ITT1, DTT0, DTT1. I needed four of each type of register (data and
  88. instruction) to make a perfect map, but alas, there are only two of each type.
  89.  
  90. MMU040
  91.  
  92. MMU040 prints out most of the 040 registers relating to the MMU. The outputs
  93. are in Hex and you need the Motorola MC68040 User's Manual to interpret them.
  94. I develped this utility to help debug FastROM040. Requires AmigaDos 2.04 because
  95. I rely on the exec falg to indicate the 040.
  96.  
  97. ROMSPLIT & ROMSPLIT1
  98.  
  99. ROMSplit and ROMSplit1 take the Kickstart file located in your devs: directory and
  100. creates two files in RAM: called KickRom0 and KickRom1 which are binary equivalent
  101. to what you need to make EPROMs that are required by the A3000 68040 accelerator
  102. manufacturers. ROMSplit stores the data in Motorola byte ordering and ROMSplit1
  103. stores the data in Intel byte ordering. I have found the BP Microsystems EP-1140
  104. EPROM programmer will read the files generated by ROMSPLIT1. Additional details
  105. on the procedures to make 2.04 or later ROMs are in the file HOW2MAKEROMS.DOC.
  106.  
  107. ETC.
  108.  
  109. Some of the code contained in these programs was taken from SetCPU V1.4 by
  110. Dave Haynie which was released into the public domain. In similar spirit, this 
  111. 040 specific code is also released into the Public domain with no restrictions 
  112. whatsoever. Use these programs and this code at your own risk. I accept no 
  113. responsibilites or liabilities for its behavior in any way. However, 
  114. if this program works (or doesn't work) on your 040  machine, drop me a line 
  115. telling me your results. Good Luck!
  116.  
  117. Greg Tibbs
  118.  
  119. CIS 73767,456
  120. bix gbtibbs
  121.  
  122.