On 24 Dec 2014 at 19:00, Roger Burrows wrote:
Mark Duckworth reported a problem on the ACP forum when trying to launch MiNT
from a DOS FAT partition under EmuTOS. MiNT did not boot, because the startup
code refused to login his big DOS-style FAT partitions. Looking at the
relevant MiNT code, I see that MiNT's FATFS will not login a drive where the
cluster size in bytes is bigger than cache.max_size. In init_block_IO(),
cache.max_size is calculated as:
max(MIN_BLOCK,2*max_sect_siz)
where MIN_BLOCK is 8192, and max_sect_siz is taken from the AHDI pun_info
structure, where it is the maximum logical sector size on any of the host's
drives. For a system with only DOS-style partitions, this will be 512
bytes.
So if you try to run MiNT from EmuTOS running on a DOS-style partition,
max_sect_siz will be set to 512, and thus cache.max_size to 8192. Accessing a
partition with clusters larger than 8192 bytes (i.e. a partition larger than
512MB) is not possible, so MiNT will not start.
Attached is a patch to correct this. NOTE: due to lack of a suitable setup,
this has not been tested! It compiles clean and looks straightforward, but
I've been around too long to assume that makes it bug-free.