``` 通用TBXI补丁集:用于启动System 7.5的Mac OS新世界ROM补丁集 ```
universal-tbxi-patchset: Mac OS New World ROM patchset to boot System 7.5

原始链接: https://github.com/Wack0/universal-tbxi-patchset

此仓库提供针对 New World Mac OS Toolbox 镜像(1.2+ 版本)的补丁,以启用在较新硬件上启动较旧的系统版本,如 System 7.x。 随着时间的推移,关键接口(程序间通信、声音、通讯、事件管理器、图片/文本/图标工具)被从 Toolbox 中移除。这些补丁恢复了这些功能。 包含的脚本会根据 Toolbox 镜像中现有的陷阱自动应用正确的补丁集。 此外,还提供了一个针对 `ProcessMgrSupport.pef` 的特定补丁,解决了 TBXI 版本之间初始化更改的问题,并需要使用 Retro68 进行重建以支持较旧的系统。 进一步的补丁解决了与 Mac OS 9 中引入的文件控制块的兼容性问题,允许较旧的系统运行,但可能存在不稳定情况。 建议以 TBXI v10.2.1 作为基础,并提供特定的偏移量补丁。 虽然这些补丁允许启动较旧的系统,但由于不兼容的扩展或控制面板(例如 System 7.x 中的日期和时间面板),可能会发生崩溃。 不能保证完全稳定的系统,但这提供了一种在更现代的配置上运行经典 Mac OS 的途径。

``` Hacker News新版 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交登录 Universal-tbxi-patchset:Mac OS 新世界 ROM 补丁集,用于启动 System 7.5 (github.com/wack0) 36 分,classichasclass 1 天前 | 隐藏 | 过去 | 收藏 | 2 评论 yjftsjthsd-h 1 天前 | 下一个 [–] > 补丁脚本是用 PHP 编写的,只需在与你的 vasmm68k_mot 构建相同的目录下运行 php patch.php "path/to/Mac OS ROM.hqx.src"。它是 100% 有效的,但我总是忘记 PHP 是一种通用脚本语言:) 我假设它是一个补丁脚本,而不是 patch(1),因为它似乎正在交互式地查看 ROM 以找到要修改的正确内容?回复 dddddaviddddd 1 天前 | 上一个 [–] 我认为这是现在允许你在像 Mac Mini G4 这样新的机器上运行 System 7 的工作的一部分,这在 https://news.ycombinator.com/item?id=46084956 中有更广泛的讨论。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索: ```
相关文章

原文

This repository includes patches, that can be applied to classic Mac OS New World Toolbox images of version 1.2 and higher, that patches back in code that was removed and required for booting earlier versions of classic Mac OS.

With an appropriate System Enabler where required (CHRP System Enabler for 7.x, iMac G3 enabler for early 8.x, Sawtooth 8.6 TBXI for 8.6...), such a patched TBXI can attempt to boot System 7.5 and above, with varying degrees of success (some extensions/control panels/etc can cause crashes).

The following patches are included:

This is a patch set for the main m68k part of the Toolbox image, which brings back in implementations of various interfaces that got removed from the tree at various points:

  • TBXI v1.2 removed the Program-to-Program Communication Toolbox implementation - Mac OS 8.x boot does not use this but 7.x requires it to be present
  • Between there and TBXI v2.5.1, the legacy Sound Toolbox, Communications Toolbox and Event Manager implementations were removed.
  • Between TBXI v6.1 and v8.8, the Picture Utilities, Text Services Manager, and Icon Utilities implementations were removed - additionally, a function in one of the tables was changed from a no-op to a bad trap, and the code to initialise another function table pointer in a structure pointed to by low memory was removed (this last one was done between v3.0 and v3.7).
    • After v8.8, there were no significant changes here - and later TBXIs can use the m68k main part from v8.8 with no issues.

There are three different patchsets, the script to apply the patches will detect which set to apply based on what traps are present.

The assembler used here is vasm (for m68k, mot syntax), built from source with patches applied to symbol.c to remove marking repeat definitions as an error (in check_symbol comment out the line with general_error(67,name); and in new_abs do the same with that and the if line above).

The patch script is written in PHP, just run php patch.php "path/to/Mac OS ROM.hqx.src" with your build of vasmm68k_mot in the same directory.

At some point between TBXI v3.1 and v6.1, the initialisation interface for ProcessMgrSupport.pef changed - it originally had its entry point pointing to a mixed-mode RoutineDescriptor which was called from m68k code, and was changed to an exported PowerPC function InitProcessMgrSupport.

ProcessMgrSupport is not large (old variant is ~5KB, new variant is ~3KB), so I decompiled the parts in C and disassembled the parts in PowerPC asm, and included both initialisation formats, so it can work to boot older and later System files.

If your TBXI's Parcels.src/MacROM.src/Mac68KROM.src/Rsrc/ncod_8_ProcessMgrSupport.pef is around 3KB in size, build the provided implementation with Retro68, and replace it with the built PEF, otherwise booting earlier System files will crash due to calling a null pointer.

InterfaceLib patches (done manually)

At Mac OS 9.0, the format of the File Control Block changed, and the PowerPC functions in InterfaceLib to get/set entries related to it in low memory were changed (at some point between TBXI v3.0 and v3.7) to cause a system error (this was described in Technical Note TN1184).

To work around this issue with later TBXIs and earlier System files, the following patches need to be made to InterfaceLib:

.LMGetFCBSPtr:
lwz r3, 0x34E
blr

.LMSetFCBSPtr:
stw r3, 0x34E
blr

.LMSetFSFCBLen:
sth r3, 0x3F6
blr

This could be automated, though code has not yet been written to do this. If you want to use a TBXI from 9.x era, it would be best to use TBXI v10.2.1 as a base; here are the patches for 10.2.1 (in fc /b format of offset: original patched):

000169A4: 7C 80
000169A5: 08 60
000169A6: 02 03
000169A7: A6 4E
000169A8: 90 4E
000169A9: 01 80
000169AB: 08 20
000169D4: 7C 90
000169D5: 08 60
000169D6: 02 03
000169D7: A6 4E
000169D8: 90 4E
000169D9: 01 80
000169DB: 08 20
00016A64: 7C B0
00016A65: 08 60
00016A66: 02 03
00016A67: A6 F6
00016A68: 90 4E
00016A69: 01 80
00016A6B: 08 20

Mac OS 9 stores fake objects in the old FCB table to keep backwards compatibility with old m68k code - so here be dragons, etc. It's enough to let older code run at least.

With a patched v10.2.1 TBXI, the Date & Time Control Panel in System 7.x will crash (on real hardware, QEMU seems to be fine) if it's present. The reason why is currently unknown (probably a function pointer call through a wild/uninitialised pointer access).

Don't expect a stable system by any means. ;)

联系我们 contact @ memedata.com