[Coco] Tool Shed Issues
L. Curtis Boyle
curtisboyle at sasktel.net
Thu Nov 28 13:23:08 EST 2024
On Nov 27, 2024, at 1:13 PM, Allen Huffman <alsplace at pobox.com> wrote:
>
>> On Nov 27, 2024, at 12:30 PM, L. Curtis Boyle via Coco <coco at maltedmedia.com> wrote:
>>
>> Actually, RBF has an internal limit of 2048 sectors (or clusters) per segment. It has to do with buffering the allocation table one sector at a time. Setting the drive’s device descriptor with DMODE to force SAS=ff (to force it to attempt to allocate at least 255 sectors per cluster) helps make bigger files within NitrOs9; not sure on the utility.
>>
>> This allows a lot more than 3 or 4 MB (and I know we did that at work regularly) per file. But a high SAS setting was pretty critical for that working.
>
> Hi Curtis. Help refresh my brane a bit…
>
> I never played with adjusting the cluster size because I had read so many utilities did not honor it and could cause corruption. Did you run in to that?
Mostly on defrag utilities (and some backup utilities). Usually written by people who only had floppy systems or small hard drives and honestly didn’t know any better. (I hit these types of things when I did the version 2 IDE drivers for the Glenside IDE adaptor - my test bed was a 20 GB Samsung hard drive that I made five 4 GB partitions on for testing, using the maximum cluster size/drive size possible.
>
> By default, OS-9 shipped with a cluster size of one 256-byte sector. This made the smallest file, like a text file just containing the text “42”, take up 256 bytes on the disk.
>
> Would using 255 mean that same text file of “42” would now take 255*256 bytes (65280 bytes)?
The SAS (default Sector Allocation Size) is how many contiguous sectors it will try to grab per segment (up to the maximum of 2048 per segment due the limitation I mentioned earlier). So that doesn’t affect the minimum file size at all. Cluster size, however, does. If you have a cluster size of 2 sectors, the minimum file size would be 512 bytes. 4 sectors would be 1K, etc.
>
> Hmmm, is it really 1-255? What happens if you put zero there?
Hopefully nothing bad… never tried that! I would hope it would either wrap to 255 or at least bump it back up to 1 (or maybe even consider it 256?) I know on floppies the descriptors default to smaller ones (like 32), but on hard drives it should definitely be bumped up. Bumping it up on a floppy drive slows down file access when creating or writing to expand a file, as it will try mightily to find a contiguous chunk of the SAS size, and start looking again from the beginning if it can’t (for any free space).
One other trick to reduce fragmentation was to use the SetStat SS.Size to presize your file immediately after creating it to the maximum size that you anticipate; it will allocate all of that at once without waiting for other files to be created/deleted and fragmenting the drive further before you next add to that file.
I should mention that the maximum file size possible in OS9/NitrOS9 (48 segments all at max size of 2048 sectors) is 24.5 MB.
>
> — A
>
>
>
More information about the Coco
mailing list