[Coco] HDB-DOS Eprom

Tormod Volden lists.tormod at gmail.com
Sat Mar 19 18:11:04 EDT 2016


On Sat, Mar 19, 2016 at 12:40 AM, Gene Heskett wrote:
> On Friday 18 March 2016 17:06:01 Mathieu Chouinard wrote:
>
>> > That is sector offset to the beginning of the HDBDOS/basic disks,
>> > and allows 94,371,840 megabytes for os9, which is about 3/4 of what
>> > can be handled with a cluster size of 1.  Above about 132 megs it
>> > needs a cluster size of 2, then 4 at just above 250 megs, moving up
>> > in powers of 2, so my 1Gb seagate I have as S1, is running with a
>> > cluster size of 16, or $10 in hexidecimal.  We run out of cluster
>> > size room at about 4Gb IIRC.
>>
>> is there some document that explain how to do it?

Some is explained here, page 7-5, on "segment allocation size",
http://www.icdia.co.uk/microware/tech/tech_7.pdf

>>
> I don't know as there is an official document, but it works like this, at
> a cluster size of one, each bit in the allocation map represents a
> single sector. The map itself is limited to 65536 bytes, 64k IOW, so the
> map can represent 8 x 65536=522,944, 256 byte sectors, and that is
> 133,873,664 bytes of disk.  Above that to double that to 267,747,328
> bytes, it needs a cluster size of 2, then double that again for
> 535,494,656 bytes it needs a cluster size of 4. You just keep upping
> both figures by a power of two until you are out of a 1 byte cluster
> size, and you are something above 4Gb, at which point you are up against
> the 3 byte offset limit of a sector seek anyway, so you never hit a full
> 256 sectors per bit in the map.  Your minimum allocation is one cluster.
> At a cluster size of $10, aka 16, one could use a sas of 2 or 4 and
> still have room for the average coco sized file in one FD.SEG entry.  We
> have had our files grow in average size over the years, so the default
> SAS=8 is occasionally a problem, so I have been advocating a SAS of $10,

I don't think the default segment allocation size is 8. It was changed
before NitrOS-9 3.3.0 here:
https://sourceforge.net/p/nitros9/code/ci/e881994bfe30017541c516107b244b57ccb6355f/

However it looks like you set it to 10 (decimal) in rbfdesc.asm, and
to $10 in superdesc.asm
Should it maybe be $10 both places?

> or for known huge files, set it for $FF temporarily, so you never run
> out of FD.SEG's, which can be an un-recoverable problem in some cases.
>
> Once the file has been written and closed, os9 cleans up and returns any
> of that unused SAS to the system, so you don't lose anything by running
> a big SAS except the ability to stuff a disk to the last byte.

Yes, the SAS is only used to reserve space while the file is open, and
the extra sectors are de-allocated when the file gets closed, /if/ the
file pointer is at end-of-file. If the file pointer is in the middle
of the file upon closing, the extra space is not de-allocated, if I
read above OS-9 docs correctly.

Tormod


More information about the Coco mailing list