High capacity cards can have over 4GB of storage space, and the Capacity member & addr offsets will actually overflow a u32.
For instance this line is bound to overflow: (sdcard.c)
cardinfo->CardCapacity = (cardinfo->SD_csd.DeviceSize + 1) * 512 * 1024;
when DeviceSize is 0x3b36 as it is on my 8GB card.
I will rewrite the code to use "block index" rather than byte offsets into the block device. Possibly will CircleOS itself have similar issues.
(And thanks for the code, it is a good starting point at any rate)
Last edited by Snakehand (2010-03-16 22:38:41)