Subject: bim is 2GM limited?
To: list NetBSD port-pc532 <port-pc532@netbsd.org>
From: Eyal Lebedinsky <eyal@eyal.emu.id.au>
List: port-pc532
Date: 01/26/2003 15:13:58
It is Australia day today, and a long, hot weekend. Living on
the northern edge of Canberra means I stay at home in case the
bushfires from the north (now about 10km away) decide to pay us
another visit. It is in this hazy state of mind that I decided
that upgrading my pc532 is a no-risk affair.

I just replaced the hard disk with one just a bit over 2GB and got
a write error from 'bim' to the boot partition (sd?h) which was at
the end of the disk.

This is NetBSD 1.5.3.

Inspecting the source it is clear that bim is doing byte offset
(into the whole disk sd?c) math using 'int' which is not good.
I reorganised the partitions so that I have swap, boot, data (in
this order) and had no more problems.

I do not recall this problem mentioned elsewhere, and I wonder
where I can find a FAQ that covers such information - it may
save someone else some time (I suspected the new disk first,
and only as a final resort I checked bim itself). I thought I
read it all.

Or should bim be fixed (it is not a complex program and this
problem covers very little code). Well, it should at least
produce proper diagnostics if the boot partition crosses the
2GB limit.

I understand that bim is a pc532 specific utility, so we can
safely fix it without tests on other platforms?

I can fix it by simply leaving 'boot_start' as a sector offset
and passing it as a separate argument to copy_bytes() which
can then handle it safely. But fixing bim may just expose
limitations elsewhere, so should we document that the boot
partition must reside wholly below the 2GB limit or do we
fix bim?
	
--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>