cnvogelg / amitools

Various tools for using AmigaOS programs on other platforms
250 stars 69 forks source link

AmiTools 0.7.0 breaks compatibility with CD32 and TerribleFire TF330 and TF328 (possibly others) #183

Closed limi closed 10 months ago

limi commented 1 year ago

First, thank you for a fantastic tool that we use to produce https://amiga.vision — it lets us automate things that we had to do by hand earlier.

For our latest release, we upgraded AmiTools from 0.6.0 to 0.7.0. After releasing we started getting bug reports from CD32 owners that couldn’t get the image to boot at all. After trying a bunch of different things, we managed to narrow it down to rdbtool in 0.7.0 creating an image that would boot on emulators, on MiSTer FPGA, on Amiga 1200s, etc — but would not boot on CD32s with TF accelerator with CF cards.

After re-building the exact same setup with rdbtool from the 0.6.0 release, it started working again.

We diffed the output of rdbtool image.hdf show from the two different builds, but couldn’t find anything meaningful between the two, which is why we were so confused.

Thanks again for a great tool!

limi commented 1 year ago

I mis-spoke, the one change we could find was:

DosEnv
- size:           16
+ size:           19

So we believe this change to be the cause: https://github.com/cnvogelg/amitools/commit/8d113af0ec9c1d11cb691d8ed1129f166d1082f0

limi commented 1 year ago

And for context, here’s how we discovered it: https://misterfpga.org/viewtopic.php?p=72372#p72372

cnvogelg commented 1 year ago

Hi limi,

yes the size of the dos env was increased to cover the new fields introduced in AmigaOS 3.x. Namely the number of boot blocks is required to prepare disk images for NetBSD (and most likely other OSes that require large boot blocks).

By providing the size of entries in the dos env AmigaOS provides a good mechanism for compatibility. A driver should query the actual size and accept if there are more entries available than it needs. AmigaOS itself works this way. Unfortunately, there are drivers in the field that are too strict and expect the size to be exactly their required value and will break with the new size...

For better compatibility here I will adjust the size field only if the new fields are actually used. HDToolBox does it the same way... So things are safe again...

cnvogelg commented 1 year ago

Here we go: fd2c264 provides a fix. Please give it a try and confirm that this resolves your issue. Thanks!

limi commented 10 months ago

Works, thank you!