************************************************ ** ** ** -------------------------------- ** ** ROM OPERATING SYSTEM EXECUTIVE ** ** -------------------------------- ** ** ** ** V44.1 ** ** ** ** by Harry "Piru" Sintonen ** ************************************************ »»»»»» public beta4, 1st Nov 2001 «««««« - Legal: o EXEC V44 IS NOT OFFICIAL NOR APPROVED BY AMIGA INTERNATIONAL INC. THERE IS NO GUARANTEE WHATSOEVER. USE AT YOUR OWN RISK. o EXEC V44 IS FREEWARE AND COPYRIGHT © 2000-2001 BY Harry Sintonen. - Improvements: o General optimizations everywhere in the exec.library and the alert.hook. Dozens of routines rewritten from the scratch to be smaller and faster. I've optimized the routines 68020+ in mind, however the A2000 ROM run on plain 68000 machines (A500, A600, A2000) too. For 68000 and 68010 owners the V40.10 exec probably is slightly faster. o The V44.1 exec is around 848 bytes smaller than V40.10! o Bugfixed exec/Alert() not to cause privilege violation trap with 68010+ CPUs if VBR is not at zero and the alert is of DEADEND type (very annoying bug). o Bugfixed exec/FreePooled() not releasing memory. Empty puddles would not get returned to the free memory list until the pool was DeletePool()ed (minor but yet annoying bug). o Bugfixed exec/ReleaseSemaphore() trashing d0/d1/a0 when calling release without obtain (minor bug, can only occur with misbehaving exec/Alert() patch). o Added BOOL return code workaround to exec/CheckIO() routine. The new code tries to figure out if the caller is going to interpret the result wrong, and if this is the case, will fix the return code (minor bug). o Bugfixed exec/OpenLibrary() not passing open-version in d0 for LIB_OPEN, unlike the example sources suggest. (minor bug) o Bugfixed SAD/TURN_ON_SINGLE returning crap as old trace vector address and SAD/TURN_OFF_SINGLE sending 4 bytes of crap after command DONE. (minor bugs, as no-one really use SAD) o Added return code workaround for old amiga.lib (upto version 40.15) CreateTask() misinterpreting exec/AllocEntry return code. amiga.lib V44.1 fixed this bug, but lots of current programs still have the bugged CreateTask() routine in them. (nasty bug, causes crashes in low mem situations) o Added workaround for exec/GetMsg() and 68060 CPUs, braindead programs calling GetMsg() in tight loop would lock up the system. (minor bug) o Bugfixed exec/ReleaseSemaphore() calculating wrong SS_NESTCOUNT when both Procure() and ObtainSemaphore() were pending for the same task. (nasty bug) o SetPatch no longer patch any exec.library bugs, since they're all fixed now. :-) Please note that this does NOT mean you can remove SetPatch (it does patch tons of other OS bugs still)! o Optimized low level interrupt code. o Optimized the 68020+FPU task scheduler to keep the stack longword aligned at all times. o Added 68020+ optimized CopyMem and CopyMemQuick routines. These routines are quite ok on 68040 and 68060 too. The 68000/68010 versions aren't optimized to save space. o Exec internal memory allocations use memory pool to reduce memory fragmentation (msgports, iorequests, tc_ETask). o Chipmem start is at $4000 for ShapeShifter / Fusion, no need for extra reset proof tools to hack it. o Kickstart copyright information updated: "Copyright © 1985-2000 Amiga International, Inc. All Rights Reserved." (same as in AmigaOS 3.5) o Identifies as ROM 3.5 :-) - Downsides: o Installation of the exec V44.1 isn't that simple. See below. o Some patches that rely on certain internal way of system operation could fail with the V44 exec. Note that as a general rule, everything should work as before. o Some software explicitly check for V40 and think V44 is *older* than V40. Luckily such broken software is very rare. These programs include CyberGraphX software (only upto cgxv42_r2_pre8). Here is how you can fix it: > cd libs: > copy clone cgxsystem.library cgxsystem.library.backup > cgx44fixer cgxsystem.library cgx44fixer by Harry "Piru" Sintonen patch 0: offset: 0x0243E0 patch 1: offset: 0x025C86 cgxsystem.library patched succesfully. (Note: offsets vary with different cgxsystem.library versions!) If there should be any problems with the patched cgxsystem.library just restore the backup. Without this patch the displayinfo database is wrong and you can't see any CGFX modes in screenmode requesters. UPDATE: The latest pre-release of CGX V4.2 (cgxv42_r2_pre11) finally fixes this problem, and thus you no longer need this patch. Hooray! :-) o Original SysInfo 3.24 hang after MFlops test if run with exec44 and CyberGuard. This is due the fact that SysInfo read the zeropage below address 0x4000, which has been marked invalid. This isn't excatly exec44's fault, it happen every time if chipmem start is >=0x4000 and you run CyberGuard. However I wrote a patch that fix the problem, you need spatch program to apply it: > cd t: > copy whateverdir/SysInfo t: > copy exec44/SysInfo.pch t: > spatch SysInfo t:SysInfo.new is the new version, that should no longer hang. Please note that SysInfo is very old and outdated, and it still has lots of bugs. I suggest you use SysSpeed instead. - Installation: o First of all you need: - V40.x ROM image. Note that there are separate versions for: A1200 A500/A600/A2000 A3000 A4000 A4000T CD32 Some of the ROMs could work with other machine than originally intended, but your're better off by getting the correct ROM in the first place. - Hardware that is capable of softkicking: phase5/dce or Apollo board for example. - Softkicking software for your hardware (phase5/dce boards: BlizKick, Apollo boards: RemAPollo) o Patch the V40 ROM to generate the "V44 ROM": - Pick the correct exec version according to your machine type: A1200 -> exec.bin.a1200 A500/A600/A2000 -> exec.bin.a2000 A3000 -> exec.bin.a3000 A4000/A4000T -> exec.bin.a4000 CD32 -> exec.bin.cdgs - Do something like this (...and use your brain to pick the corrent files etc.): > zapexec FROM devs:rom40068.A1200 WITH exec.bin.a1200 TO devs:rom441.A1200 Original exec.library + alert.hook size: 14264 Replacement exec.library + alert.hook size: 13416 Zapped! Resumming the ROM image... Checksum: $C55F46C0 Writing the new ROM image to "devs:rom441.A1200"... Done. o Use the new ROM image with your softkicker. - Obsolete patches (at least): o BlizKick: AlertFix, FixGetMsg. Other modules are still good to have, like romfixes! o FixGetMsg by Frederick H. G. Wright II . - Problems?: o BlizKick RebootFix upto 1.3 didn't work with exec44. RebootFix v1.4 fixed this. You can download latest BlizKick beta release from http://www.iki.fi/sintonen/sw.html o TB reported that at least FastFileSystem v43.19 doesn't validate filesystem with exec44. I'll look into this, when I have time. More reports if this is broken or not are welcome. o Several people reported problems with Fusion (hangs and crashes when starting). If you're using BlizKick, make sure you still use FusionReserve module (yep, this is still needed since Fusion check for some magic values in low chipmem pages. Stupid if you ask me). Also, if you have 68040 or 68060 CPU, I suggest you use FixPATCHMAC program, just in case. I hope this helps, if not, use ShapeShifter. I am sick of Fusion crap, it's all big messy hack. o Several people reported problems with ShapeShifter. However at least v3.10 and v3.11 work just fine here, even without any 'prep' program. - Bugs: o Bugs? No bugs, honest. ;) o Uh, really, if you think you've found some, email me at sintonen@iki.fi explaining the problem as detailed as possible. Please *do* include Enforcer/Cyberguard/MuForce/whatever dumps and/or whatever files needed to explain the problem. Do *not* email me just to say: "it doesn't work". o When reporting bugs, remember to include the exact version (incl. date!) of the exec.library (see top of this document). Also explain your hardware configuration briefly, and possible patches you're using. Don't forget to tell the type and version of the ROM image you applied the patch to. - Brief history: o V44.1 public beta4, 1st Nov 2001: - Fixed big 'ooops!' from AttemptSemaphore(), it didn't return TRUE when semaphore was obtained successfully. This silly bug caused some weird side-effect bugs, for example Warp3D failed to work properly with the new CGX V4 and PCI flashrom (seemed to affect at least Permedia2 and Voodoo drivers). It took me 4 hours of pure hardcore debugging to figure out what was causing the problems. ;-) o V44.1 internal beta4d, 29th Oct 2001: - Fixed big 'ooops!' from CreateMsgPort(), if task/process had no free signal available bad things happened (read: crash). Luckily this was very unlikely to happen in normal use. o V44.1 internal beta4c, 24th Oct 2001: - Updated the documentation about CGX V4.2, pre-release 11 no longer require any patching. Great! o V44.1 internal beta4b, 12th Oct 2001: - Restored PutMsg() and ReplyMsg() to always call Signal() for PA_SIGNAL msgports to restore some original system behaviour. Oh well, I never really felt comfortable about that "speedup" hack anyway. o V44.1 internal beta4a, 6th Mar 2001: - Added patches to fix Savage040-060-MMU 2.41 "Special release for Amiga Life" release bugs. o V44.1 public beta3, 1st Mar 2001: - Added SysInfo.pch to fix a hang at MFlops test in SysInfo with chipmem start at >=0x4000 and CyberGuard (reported by R-TEAM). - Improvement: Modified exec/SetFunction() to be able to patch exec/Forbid and 'latepatch'ed utility math functions. Only complete replacement patches worked before, oops. Cures the PatchWork hang (reported by Thomas Pucyk). - Third public beta release. o V44.1 public beta2, 1st Feb 2001: - Fixed a major bug from the new GetMsg(), in some cases it trashed zeropage (read&writes to addresses 0 and 4). Occured with audio.device for example (WBsteroids). Thanks to Marcin Kurek for providing nice bugreport that made it easy to hunt down the bug. - Second public beta release. o V44.1 public beta1, 24th Jan 2001: - Fixed a stupid bug from exec/InitStruct(). 'Next destination' mode was broken. Special thanks to Mikolaj Calusinski for finding this. - exec/CreateMsgPort() changed to return port in a0 aswell as in d0. Fix some broken applications (ClickBoom's Quake for example). - First public beta release. o V44.1 internal beta8, 9th Dec 2000: - MAJOR BUGFIX! The low level intservers didn't provide interrupt mask in d1 register as supposed to! This bug broke Miami[Dx]'s internal serial port 'Transmit Buffer Empty' -interrupt (modem didn't seem to respond to any operation). Probably also was a cause for some other weird problems. And this was all my fault, I just didn't read the autodoc carefully enough. This bug was introduced in the beta1. - Special hellos fly (again) to ram, thanks mate! - Fixed serious bug from ReleaseSemaphore(), if both Procure() and ObtainSemaphore() were pending for the same task, the SS_NESTCOUNT was bumped *twice* per SemaphoreMessage. This bug is present in *all* v39-v40 Kickstart ROMs. - Added iwannabea39 program to fake '3.9 ROM ' for About requester. Start this program after SetPatch if you feel like it. :) o V44.1 internal beta7, 6th Dec 2000: - Added latepatch romtag. It does the following: o For 020+, patch utility.library SMult32, UMult32, SDivMod32, UDivMod32, SMult64 and UMult64 to contain the code in the jump table. Doesn't overwrite possible previously installed patches (by flashrom 68060.library for example). o Set exec library list node priorities. o Set exec device list node priorities. - Thanks to ram for the idea. o V44.1 internal beta6, 3rd Dec 2000: - Only the A500/A600/A2000 ROM need to support 68000 and 68010. Other ROMs can assume 68020+. Optimized some routines for 68020+ CPU: OpenDevice(), DoIO(), WaitIO(), CacheControl(), Exception() and SuperState(). - Thanks to Harald Frank for the idea. o V44.1 internal beta5, 20th Nov 2000: - Fixed a deadly bug from the new exec/RemTask() introduced in beta4. It caused severe problems with 68060 systems that install FPU support later in system boot. RemTask() for other than self seriously screwed system, for example Fusion caused this crash. Special thanks to Wizor for the bugreport. - Changed the Deallocate() AN_MemCorrupt alert type from deadend to recovery. Wrong pointer to Deallocate()/FreeMem()/FreeVec() no longer bring the system down. This is NOT a memory protection or anything like that, just a better behaviour in error condition. o V44.1 internal beta4, 15th Nov 2000: - Fixed a major mistake from the new AllocPooled(), due to a bug the puddle MH_UPPER was incorrectly initialized, and thus FreePooled() failed to deallocate the empty puddles. - Re-implemented execbase internal memory pool (for CreateMsgPort(), DeleteMsgPort(), CreateIORequest(), DeleteIORequest(), AddTask() and RemTask()), reduces memory fragmentation a bit. Added workaround for programs that call DeleteIORequest() for AllocVec()ed memory (at least AmigaAMP upto v2.8 BETA8). - Optimized functions: CreateIORequest(), CreateMsgPort(), Exception(), SuperState(), SetIntVector(), AddIntServer(), RemIntServer(), AddLibrary(), RemLibrary(), CloseLibrary(), SetFunction(), AddDevice(), RemDevice(), Allocate(), Deallocate(), DeletePool(), AllocPooled(), RemMemHandler(), ReplyMsg(), PutMsg(), GetMsg() and RemTask(). - Added a workaround for amiga.lib/CreateTask() AllocEntry() bug. - Added a workaround for exec/GetMsg() and 68060 CPUs, braindead programs calling GetMsg() in tight loop would lock up the system. - Special thanks to NorthWay for the ideas/code. o V44.1 internal beta3, 7th Nov 2000: - Fixed a bug in MakeLibrary(), I accidently removed the AllocMem() result test. I can only trust on result cc's if the routine is called with bsr and not thru vector. - Fixed a bug in InitStruct(), it cleared one word too much, trashing innocent memory. - Restored some magic bit-pattern to coldstart, now RemAPollo should work properly again. - Special thanks to Mikolaj Calusinski for finding these bugs. o V44.1 internal beta2, 6th Nov 2000: - The new AllocPooled() routine introduced a small bug, if you called the routine with null poolHeader the return code would not be zero. Fixed. - due to a silly mistake the exec.bin.a2000 was identical to exec.bin.a1200, so probably it didn't work on A500/A600/A2000 with an 68000. - fixed a silly bug from zapexec that made it totally impossible to apply the patches to other than A1200 ROM. - bugfixed: OpenLibrary(), SAD/TURN_ON_SINGLE and SAD/TURN_OFF_SINGLE. - optimized: the SAD - optimized functions: OpenDevice(), SendIO(), DoIO(), WaitIO(), CreateMsgPort(), RemDevice(), RemLibrary(), OpenLibrary(), CloseLibrary(), Wait(), AllocSignal(), FreeSignal(), Schedule(), Dispatch(), Exception(), Switch000(), Switch020FPU(), Enqueue(), ReplyMsg(), PutMsg(), SetExcept(), SetSignal() and Signal(). o V44.1 internal beta1, 31st Oct 2000: - bugfixed: Alert(), FreePooled() and ReleaseSemaphore(). Added BOOL return code workaround to CheckIO(). - optimized: alert.hook, rom coldstart, low level interrupt code and the SAD. - optimized functions: Alert(), ReadGayle(), CopyMem(), CopyMemQuick(), OpenDevice(), WaitIO(), CreateIORequest(), DeleteIORequest(), CreateMsgPort(), DeleteMsgPort(), AddDevice(), RawDoFmt(), ColdReboot(), CachePostDMA_030(), CacheControl(), CacheClearU(), CacheClearE(), Supervisor(), FindResident(), InitCode(), InitResident(), InitStruct(), SumKickData(), SetIntVector(), AddIntServer(), RemIntServer(), StackSwap(), Switch000(), Switch020FPU(), Launch020FPU(), Dispatch(), TaggedOpenLibrary(), SetFunction(), SumLibrary(), MakeFunctions(), FindName(), AddMemList(), CreatePool(), DeletePool(), AllocPooled(), FreePooled(), AllocEntry(), FreeEntry(), Allocate(), Deallocate(), AllocAbs(), AllocMem(), FreeMem(), ReplyMsg(), PutMsg(), InitSemaphore(), Procure(), Vacate(), ObtainSemaphore(), ReleaseSemaphore(), AttemptSemaphore(), ObtainSemaphoreShared(), ObtainSemaphoreList(), AttemptSemaphoreShared(), ReleaseSemaphoreList(), SetTaskPri(), AddTask(), RemTask(), FindTask(), SetExcept(), SetSignal(), Signal(), Wait(), Reschedule(), AllocTrap(), FreeTrap(), AllocSignal() and FreeSignal(). - Todo: o Fix bugs, if any found. o Yet more general optimizations. o Make good use of the extra space gained (ca. 848 bytes currently). o Ideas?