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.11 Requires: Os 2.04, a 68020/68851, 68030, 68040 or 68060 with a working MMU Architecture: m68k-amigaos >= 2.0.4 ----------------------------------------------------------------------------- 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 the 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. The memory.library is now complete and can be found in this archive. ------------------------------------------------------------------------------ Release 43.11 -------------- - This release merges the changes made by Etienne back in the main development branch. - The MMU detection code is now also able to identify 68060's during the system bootstrap where some P5 boards only identify them as 68010's for compatibility reasons. - Fixed a harmless bug in the 68030/68581 MMU table reader. - CPU libraries: This release patches the private exec function ExitIntr() to address spurious interrupts happening on fast accelerator boards. On such boards Paula did not yet clear the interrupt bits when the CPU leaves the interrupt processing, causing a second spurious interrupt as soon as the processor leaves the exec interrupt handler. - LoadModule: Merged changes by Etienne back into the main branch. - MuGuardianAngel: Merged fixes by Christian Sauer back into the main development branch. Release 43.10 -------------- - Fixed nasty 43.9 exception crashes on 030 systems (and probably 020/881 as well). These crashes were caused by PhxAss default optimizations which converted explicit BRA.W to BRA.S in the exception handler and messed up calculated jumps. The MuLib is now assembled with branch optimization explicitely turned OFF *grunt* Release 43.9 -------------- - Made the mmu.library assemble with PhxAss by decoding DevPac only macros. - Added safeguard to the mmu.library AddMem command for switchable accelerator boards: memory in the 32bit address space (above the first 16Mb) will only be added if the CPU is at least a 68020. - Made the mmu.library ClearMMU command more effective: it will now reset areas incorrectly marked valid in the boot configuration to blank space. - THOR: Added workaround for some Appolo 060 boards that apparently misuse some undocumented 060 MMU table bits. Release 43.8 -------------- - mmu.library: I seem to have updated something here in 2002, but I really forgot. Anyhow, this is the latest release I have. - 68060.library: Added patches for the utility.library division support since some kickstart versions apparently do not patch in the optimized versions. - 68040.library: Added patches for the utility.library division and multiplication routines because some kickstart routines do not seem to patch the optimized versions in. - disassembler.library: Fixed all issues Christian Sauer fixed in 40.5, and also fixed garbled output on disassembly of floating point constants. Release 43.7 -------------- - mmu.library: Added a workaround against invalid MMU tables setup by utilities that do not satisfy the stronger alignment restrictions of the 68060 compared to the 68040. The MMU table scanner is now a bit more relaxed for these tables. - 68060.library: Improved the divu.l 64:32 division emulation somewhat. Motorola used Knuth's "Algorithm D" out of the book, which is, however, a bit overweighted for the purpose of the library. I replaced it by a somewhat simpler and faster algo- rithm. Won't make a difference unless the program to be emulated uses way too many divu.l computations. - Applied the same changes to MuRedox and its divu emulation. 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 (June 2002)