[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] ext2fs driver in trunk broken?



On 06/07/2012 23:44, Vincent Rivière wrote:
Yes, for an unknown reason the official ext2.xfs binary does not work on the
FireBee. This is a known problem.

I found the cause of this problem.

Normally, ext2.xfs is compiled with -m68020-60.
Inside sys/xfs/ext2fs/inode.c, function get_cookie(), there is a long division where both the quotient and the reminder are used.

/* group number */
group = inode / EXT2_INODES_PER_GROUP (s);

/* index on group */
offset = inode % EXT2_INODES_PER_GROUP (s) * EXT2_INODE_SIZE (s);

GCC produces a divul.l with 2 registers as target (for quotient and remainder). It is a 68020 instruction which is not supported on ColdFire.
FireTOS tries to emulate it, but it is buggy: the quotient is wrong.

I have reported this bug to the ACP mailing list.

So there is no bug in FreeMiNT's code.

BTW: When we compile ext2.xfs for ColdFire, it works perfectly with both FireTOS and EmuTOS.

--
Vincent Rivière