[Coco] Howto for Altera DE1?

Steven Hirsch snhirsch at gmail.com
Sun Jul 4 09:56:14 EDT 2010


On Sun, 4 Jul 2010, Steven Hirsch wrote:

>> 
>> Exception in thread "dwproto-0-8" java.lang.ArrayIndexOutOfBoundsException: 
>> 222880
>>        at 
>> com.groupunix.drivewireserver.dwprotocolhandler.DWDisk.loadSectors(DWDisk.java:283)
>
> Ding!  Here's the problem:
>
> ----------------------- cut here --------------
>
> public class DWDisk {
>
> ...
>
> public static final int MAX_SECTORS = 122880; // what is coco's max? 24 
> bits?
>
> ....
>
> private DWDiskSector[] sectors = new DWDiskSector[MAX_SECTORS];
>
>
>
> ----------------------------------------------
>
> Looks like a hard-coded assumption about maximum sector offset.  I'll try 
> bumping that up and rebuilding.

Ok,  I had to increase that to 516096 to allow for a 128MB disk image. 
With all of the disk buffers allocated on the heap, the process starts to 
use a lot of memory.

Is it possible to deal with memory-mapped files in Java?  That might be a 
more elegant way to do this than a literal heap-allocation.



-- 




More information about the Coco mailing list