Short: Library to ctrl the MC68K MMUs Uploader: thor@math.tu-berlin.de (Thomas Richter) Author: thor@math.tu-berlin.de (Thomas Richter) Type: util/libs Requires: Os 2.04, a 68020/68851, 68030, 68040 or 68060 with a working MMU Version: 42.3 NOTE: The developer information went now into the "MuManual" archive, this is the "user only" distribution. ----------------------------------------------------------------------------- Purpose and goal of this library: The mmu.library is a basis for MMU (memory management) related functions the MC68K family can perform. Up to now certain hacks are available that program the MMU themselves (Enforcer,CyberGuard,GuardianAngle,SetCPU,Shapeshifter, VMM,GigaMem...). It's therefore not unexpected that these tools conflict with each other. There's up to now no Os support for the MMU at all - the gap this mmu.library fills. The goal is to provide a basis of functions to address and program the MMU in a hardware independent, Os friendly fashion. Hence, the new version of the Enforcer, called MuForce, will work together with virtual memory, and others. The mmu.library is also the basis for a virtual memory project, the memory.library. Even though the mmu.library does not provide virtual memory itself, it builds the basics to allow an easy implementation and to avoid the hacks required by other implementations so far. ------------------------------------------------------------------------------ Changes since V42.2 --------------------- - Included an alpha release of a new 68060.library which provides a fpsp.resource and is virtual memory aware. This alpha release can be found in the LIBS/alpha directory. Thanks goes to Stephen Brookes and Etienne Vogt for performing some tests. Note though that I do not own a 68060 and could not test this library for correctness. - Included a MMU driven ShapeShifter video driver, MuEVD. (new) - MuGuardianAngel: Does no longer call RawIOInit() and hence will no longer conflict with programs using the serial port even in cases MuGuardianAngel never required the port in first place. - MuForce: Does no longer call RawIOInit() but fully relies on the Os and/or the user to initialize the serial port correctly, in the same way the old Enforcer did. This means that MuForce will now safely cooperate with software that requires the serial port in cases MuForce output goes to the parallel port or other destinations. - Note that there is now a new release of "BlizKick" which fixes the problems mentioned below. - Updated the documentation, fixed a minor mistake in the MMU developer's manual. - Included an upgrade patch from SetPatch 44.13 to 44.14 which, once again, opens the 680x0.library instead of the 68040.library. The RamLibFix is then no longer required since it is included now in SetPatch anyhow. - MuGuardianAngel: The DUMPLIST routine had a bug and might have allocated too less memory. Luckely, this had the only side effect that not all of the mung list would have been dumped correctly, it did not trash any memory. - MuGuardianAngel: The DUMPLIST option now also makes use of the SegTracker to print segment/hunk information of the allocating routine. - Installation scripts: Due to a bug in the BuildMMUConfig.rexx script, the on-board hardware of certain P5 boards has been disabled completely. Urgl. - mmu.library: Added a new command for the ENVARC:MMU-Configuration, "FOR". It executes the command given as argument if the manufacturer product code fits, possibly several times if more than one board is in the machine. - mmu.library: The MMU-Configuration file can now be put into DEVS: as well since some people seem to have problems with the library and HappyEnv. - mmu.library: Added another new command "ClearMMU" which will re-run the MMU setup procedure at least partially. The intention behind this is to override or ignore a previously loaded MMU tree at least partially in places where it is sub-optimal or incorrect. This seems to be required by some Apollo boards. - mmu.library: EnterContext() and LeaveContext() are no longer running into the risk of breaking a Forbid(), provided AllocMem() doesn't. NOTE THAT I NEVER DOCUMENTED THIS FEATURE ANYHOW. This might help for some critical applications where a launched task must run in a new context. Due to a feature of exec, you cannot enter a context before you AddTask() a new task, sigh. - mmu.library: Due to a trashed register, the library crashed upon detection of an 68040 or 68060 with a disabled or otherwise non- functional MMU. Note that it would have detected the EC processors correctly, though, including the 68EC030. This release should do better. Thanks to Pavel for detecting this. - Fixes: Added a fix to repair the UMult64()/SMult64() bug of the Os for the 68000 and 68010 processors. Not required for the up-to-date release of SetPatch, but otherwise recommended. - mmu.library: AddConfigDev() is now supported, but the implementation depends on some internals of the expansion.library. Hopefully, nobody will change them. The MuLib tries to check whether the ROM function is still installed. In case it is, the code will jump into the old ROM code. In case it isn't, a replacement routine is used. - 680x0.libraries: AddConfigDev() is now passed thru, presumably to the mmu.library function. - Installation: Finally, wrote a (rather complicated) installation script for automated installation. - Included various fixes for the BVisionPPC driver and more "software fluff" for the installation process. - 68040.library: Impoved the GetMsg() workaround for programs that call GetMsg() in a tight loop. - 68040.library: Fixes now a bug in the mathieeesingbas.library which doesn't use a FPU since it is setup before this library is setup. Changes since V42.1 --------------------- - The 42.1 release automatically marked all hardware pages as cacheinhibited serialized. Looks like even that was too much for some hardware boards, I don't know why. This should be the proper default anyhow. I disabled this again, even though this means, as for 42.0 and before, that a MMU-Configuration is *mandatory* if you use the library as "stand-alone" instead on top of a third- party 68040/68060 library. Changes since V42.0: --------------------- - Installation: P5Init, PPCIdentify, P5Identify reworked again, it enables now explicitly the bus error generation of the A4000 motherboard resources. - Installation Rexx scripts: Added a "NoP5" keyword to disable ex- plicitly the P5 identification steps which seem to be problematic for some boards for reasons that are beyond me. - MuManual: Fixed some typos, corrected some mistakes, clarified some formulations. Thanks to Etienne Voigt for proofreading! - Organization: The "MMULib" archive is now the user archive, all developer information went into the "MuManual" archive, including the autodocs, the includes, the bmaps and some example sources. This will help to keep the archive short. - mmulib: The CurrentContext() function forgot to Forbid() properly. Note that you still need a Forbid() bracketing or the result code might be pretty useless. The propability that this broke code is very low, though. - mmulib: GetMappingProperties() was simply broken in V42.0 and below. Sorry, this got fixed. This function hasn't been used yet, so this bug was left unnoticed. - Included a debug version of the library in the MuManual archive. - BlizKick: In order to avoid a yellow alert, either BlizKick must be modified or must be run behind SetPatch. The reason for the alert is that BlizKick opens the mmu.library before the 68060/68040 lib is open, which is and never has been legal. I just added an explicit check for this condition in V42 because too many people ignored it. As I said, "no discussion". This is a side effect of how the library works and has to work. Changes since V41.xx: --------------------- - mmu.library: Added more error checking for the startup code, esp. the MMU-Configuration file. Added a check for proper config- uration, i.e. whether the library was (incorrectly) loaded in front of SetPatch. - Added a new function: RunOldConfig(). It runs a small supervisor routine with the boot MMU configuration. - 68040.library: Added an explicit check for correct configuration, it will generate a requester in case no 68040 is available. - MuGuardianAngel: Fixed a bug in the mung-wall check which could have reported one additional mung-wall damage in case the front wall was found defective. Added a workaround for a possible 68060 firmware bug, the "U" bit is now always set in the MMU descriptors to avoid unnecessary MMU writebacks. - In case you see MuGuardianAngel hits of the z3scsi.device, run the FixCybAccess program. It will work around the z3scsi.device hits as well. Thanks, Helmut. - MuMove4K PREPAREEMUL moves now the low chip memory end to the 16K line, not to the 8K line. This might fix some Fusion problems. Thanks, Pavel. - Improved the error messages of MuFastZero a little bit. - Reworked P5Identify and PPCIdentify to make these two more stable. - Added another external MMU setup command, P5Init. It should keep care about all P5 specific cache settings and should setup the PPC and the BOOT-MMU-Port automatically. All manual P5 specific entries in the MMU-Configuration except graphic board cachings are obsolete now and should be replaced by P5Init. - Rewrote both setup scripts to reflect the changes in the P5 setup logic, i.e. ScanMMUPort has been replaced by P5Init and all P5 specific cache settings have been removed. - Added stack increasement patches for the mfm.device (CrossDos) and IPrefs 40.7 in case you do not yet use Os 3.5. Thanks Gene. - Added a fix for two bugs in ramlib. First, its stack is too low. Second, it uses SIGF_SINGLE as message bit for its process port which could cause some race conditions with semaphores in library setup code. - The MuGuardianAngel patch report and automatic IRQ check have been reworked a bit. The "patches overwritten" message is now no longer periodically generated, but will be suspended up to the next "real" hit where another message will be generated. - The MuGuardianAngel automatic IRQ stack was not only useless, but in fact broken. This does not go for the stack check of the exec memory handling functions which was and still is fine. Good enough it was recommended to leave the IRQ check disabled. "Nearly out of stack" warnings were not generated by the IRQ code at all, and the stack overflow and stack underflow messages usually report "bogus" hits due to its construction. Stack snooping is now by default ENABLED, except for "out of bounds" reports, which still requires STACKSNOOP option explicitly. Added an option to adjust the minimal stack size for the "Nearly out of stack" reports, but it can be made only larger, i.e. more "picky". - mmu.library: The pre-42 releases only marked the zero page as non-blank which might have caused problems for some Mac emu- lators. It now marks the lowest 32K as valid. Former versions set it to "cacheinhibit", it is now set to "cacheinhibit nonser- ialized imprecise". - mmu.library: The low-memory limit up to which the mmu.library has to software-emulate accesses has been made adjustable. - mmu.library: Due to a bug in the high-level mapping list manage- ment, MAPP_INDIRECT did not work correctly. - mmu.library: BuildIndirect() performs now a few more consistency checks and is less restrictive for MAPP_INVALID and MAPP_SWAPPED. - Updated the DMAInitiate() function, it provides now a return code instead going guru if it doesn't like the parameters. - Updated MuOmniSCSIPatch to reflect the changes made to DMAInitiate(). - Fixed many documentation errors in mmu.doc, updated and checked exception.doc again. - Included a demo program for indirect descriptor handling. - Speedup SetIndirect() somewhat by placing this routine directly in the MMU drivers as a "native" operation. - Added a new LVO "SetIndirectArray()" to set more than one indirect descriptor at once. Should be *very* fast. - The startup command "DescriptorCacheInhibit" did not pass a proper result code on success and hence caused a yellow alert. This bug was only noticable in some of the V42 betas where proper result code checking was introduced. - mmu.library: WithoutMMU() disables now the CPU caches as well to allow a safe access to non-cacheable addresses. - MuFastZero: In case MuFastZero is removed (why?) the unmapped chip memory is set to IMPRECISE and NONSERIALIZED to provide at least a minimal speedup. - Added "AmigaGuide" versions of the autodocs. - Included a new version of BPPCFix by Frank Wille. Thanks, Frank! Using this program will allow you to replace the ROM-based libraries of the Blizzard-Boards. Thanks Stephen for working this out, and for making this trick possible! - Included a "RKRM" style manual and tutorial for the MuLib in "dvi" and "postscript" format. ------------------------------------------------------------------------------ The THOR-Software Licence (v2, 24th June 1998) This License applies to the computer programs known as the "mmu.library" and its sources. The "Program", below, refers to such program. The "Archive" refers to the package of distribution, as prepared by the author of the Program, Thomas Richter. Each licensee is addressed as "you". The Program and the data in the archive are freely distributable under the restrictions stated below, but are also Copyright (c) Thomas Richter. Distribution of the Program, the Archive and the data in the Archive by a commercial organization without written permission from the author to any third party is prohibited if any payment is made in connection with such distribution, whether directly (as in payment for a copy of the Program) or indirectly (as in payment for some service related to the Program, or payment for some product or service that includes a copy of the Program "without charge"; these are only examples, and not an exhaustive enumeration of prohibited activities). However, the following methods of distribution involving payment shall not in and of themselves be a violation of this restriction: (i) Posting the Program on a public access information storage and retrieval service for which a fee is received for retrieving information (such as an on-line service), provided that the fee is not content-dependent (i.e., the fee would be the same for retrieving the same volume of information consisting of random data). (ii) Distributing the Program on a CD-ROM, provided that a) the Archive is reproduced entirely and verbatim on such CD-ROM, including especially this licence agreement; b) the CD-ROM is made available to the public for a nominal fee only, c) a copy of the CD is made available to the author for free except for shipment costs, and d) provided further that all information on such CD-ROM is redistributable for non-commercial purposes without charge. Redistribution of a modified version of the Archive, the Program or the contents of the Archive is prohibited in any way, by any organization, regardless whether commercial or non-commercial. Everything must be kept together, in original and unmodified form. Limitations. THE PROGRAM IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY. THERE IS NO WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE THE PROGRAM, THE ARCHIVE AND ALL DATA OF THIS ARCHIVE FROM YOUR STORAGE SYSTEM. YOU ACCEPT THIS LICENCE BY USING OR REDISTRIBUTING THE PROGRAM. Thomas Richter ----------------------------------------------------------------------------- So long, Thomas (December 2000)