Short: Library to ctrl the MC68K MMUs Author: thor@math.tu-berlin.de (Thomas Richter) Uploader: thor math tu-berlin de (Thomas Richter) Type: util/libs Version: 43.6 Requires: Os 2.04, a 68020/68851, 68030, 68040 or 68060 with a working MMU Architecture: m68k-amigaos ----------------------------------------------------------------------------- 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. ------------------------------------------------------------------------------ Release 43.6 -------------- - mmu.library: Added another safety check for the DMA property list. - MuMapRom: The reset-and-stay resident mechanism of MuMapRom makes now use of the ColdCapture exec vector and a nice little extra hack. - MuMapRom: Adds now a 16MB "safety zone" around memory areas to keep some wierd memory tests working. - memory.library: Changed the memory administration functions a bit by adding a "ranger pointer". Release 43.5.1 -------------- - 680x0.library: Handled the low-memory area of MuMove4K unproperly and therefore broke MuFastZero. Fixed. - MuMapRom: Did not work at all if the "ROMINFAST" option was not present at the command line. Should be much better now. - memory.library: The library does no longer allow the attachment of an address space to the global MMU context. - memory.library: The library does no longer support attachments of address spaces to supervisor contexts. This wouldn't have worked anyhow. - MuGuardianAngel: AllocAbs() was still broken and returned the wrong register. Release 43.5 -------------- - CPU libraries: All CPU libraries reset the VBR now before restarting the ROM. - mmu.library: Fixed a possible race condition of the 68060 exception handler. The 68060 can report a misaligned access even though the fault address and the access fault size do not indicate that a page boundary is crossed. - Included a new test tool: "SwapTest" will check whether the 68060 or 68040 library support some race conditions on swapping correctly. Note that this test will fail for most third-party libraries. - Included MuForce 40.30 (Aminet release) that is required for the latest MuGA. It won't work with former releases. Release 43.4.2 (Internal release only) -------------- - memory.library: - fixed possible memory leak of the swap hooks. They should have closed files/devices on VMPACK_EXIT, not VMPACK_CLOSE. - Updated the documentation of the mmu.library for the new functions. - Included a first version for the memory.library documentation. Release 43.4.1 (Internal release only) -------------- - mmu.library: Forgot to include the 43.4 of the mmu.library in the last distribution. - memory.library: - fixed broken handling of private swap hooks for virtual memory pools. - fixed broken handling of "Retry" of error requesters. - added more sophisticated error handling for out of memory and swap alerts. The code will no longer try to repeat for obvious errors. - mmap.c: - fixed missing result code on error. Release 43.4 (Internal release only) -------------- - mmu.library: The 68040 race condition fix of the 43.3 wasn't as good as I though. Reworked this mess again. It will now be able to handle the wierd condition where a write-back is busy and detected from a word-sized movem, even though it comes from a different instruction. Yuck! - mmu.library: Added workarounds for the V37 ObtainSemaphoreShared() bug. - mmu.library: Made all context locks shared as far as possible. - mmu.library: Fixed a possible register trash for the shared context locks. - memory.library: Worked again a bit on the memory allocation routines - Examples: vmem.c and mmap.c are now ready for release. The examples look now like they are supposed to. - Updated the mmu.library autodocs a bit. - memory.library: - added another cache at the swap hook side of the library. This should hopefully help to improve the performance a bit as it tries to bundle I/O accesses. - the library limits now the virtual memory range of the address space to the user defined limit before asking the hook for the maximal size. This avoids unnecessary disk- trashing for the file hook. - the library should behaive much better now for low memory situations and errors on the swap hook. The hook remains responsive in these situations. - added a (localizable) error requester for failures of the three built-in swap hooks. - All file I/O goes now over packets rather the dos.library. This would avoid trouble in case the dos.library gets patched over. Release 43.3 (Internal release only) -------------- - mmu.library: Fixed a possible race condition of the Motorola "Diva", the 68040. Unlike what the documentation suggests, the CM bit is not directly related to access errors of movem's. )-: - memory.library: - Fixed a bug in the final page disposal routine that could have caused MuGA hits. Fixed. - Fixed a bug in the swap daemon that could have tried to deliver a motor tick to the swap hook even though the hook has been released already. - Reworked the internal memory handling. The memory pools come now with scratch lists to speed up the allocation of tiny chunks, and to avoid unnecessary virtual memory accesses. Further, the library uses now its own set of pooled allocation/deallocation routines. First of all, this avoids clashes with whatever patch might sit there and doesn't know how to handle virtual memory correctly, especially the rather harsh Forbid()/Disable() rules. Second, the new pooled allocation tries a combination of a "best fit" plus "buddy chunk" allocation that is less naive than the native exec allocation. (but still naive enough to allow improvements...) - Fixed bugs in the computation of the swap pool size that happened mainly on machines with Z2 memory only. - Added documentation for the PoolVSize() function that was forgotten for the 0.0 release last time. - Added a tag to restrict the size of the virtual memory pool created. - MuGA: Fixed Deallocate()/Allocate() patches that forgot to align memory correctly. - MuRedox: Aparently, the new version never made it to Aminet, even though it was uploaded. It provides one new option, SHOWPATCHEDINSTRS, which shows the list of instructions it was able to replace by its own set of stub-routines. If the vmem example program shows an "Allocation Failed" report, do not worry. This is just because the memory pool run out of data. This is likely to happen due to the way how this stress-test works. The memory.library got tested now on the 030,040 and 060. Release 43.2 (Internal release only) -------------- - mmu.library: Added support for the mmu.resource. This is a system resource that defines the interface to the true hard- ware MMU. The library will make use of this resource whenever it is present, and will fall back to its build-in routines otherwise. The purpose of the resource is to allow emulation of the MC68K MMU on non-native CPUs (i.e. x86) without the need to re-write the entire library from scratch. - mmu.library: "shared" pages are finally officially supported. Note that most of this stuff worked already in V42. - mmu.library: Fixed a bug in PhysicalLocation() that did not return the true physical location in case the memory was marked as MAPP_SHARED. - mmu.library: Added GetPageUsedModified() to parse the Used/Modified flags more easely than with Get/SetPage- Properties(). This is still to be documented and mainly for the purpose of the memory.library. - MuGA: Fixed a register trash that broke AllocAbs() and related calls. - NEWS FLASH! Finally, the first release of the memory.library is available. The purpose of this release is to supply virtual memory to the AmigaOs in a flexible and compatible way. There is not yet much documentation, but there are includes and autodocs. ------------------------------------------------------------------------------ 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 (February 2002) .