[Coco] format memory (was) Gotek floppy emulator

Tormod Volden lists.tormod at gmail.com
Tue Feb 16 17:24:33 EST 2016


On Tue, Feb 16, 2016 at 10:32 PM, Robert Gault wrote:
>
> Tormod,
>
> You can study the source code for format, which is not that easy to follow.
> One thing that jumps out is the use of the SS.WTRK system call.
> If you look up SS.WTRK in the OS-9 manual #26-3031, you will see that regX
> points to a track buffer. Now as disk formats differ, not all track sizes
> will be the same. However, if you should have a 512-byte sector with
> 18-sectors per track, that's 9216 bytes total.

Thanks! At first glance it was not obvious to me that a "set status"
system call would write tracks to disk. I haven't read the code
carefully.

So this is handed down to e.g. the rb1773 driver at
level1/modules/rb1773.asm line 1206 (Level 2-only section) where the
whole track buffer is copied to a "temporary task". Or is it copied to
system memory?

>
> The data area for the format command has several buffers and many data
> values. It shouldn't be a surprise that the total data area is about 11,000
> bytes.
>
> If you want to see just how small you could make the format data area, you
> could try reducing the size of
> fdtbuf2  rmb   9924
> and perhaps the next rmb until the command fails with the largest type disk
> used with a Coco.

OK, I see. Why is this memory not allocated dynamically depending on
what type of disk is in use? Never mind :) I understand that the user
memory is not a problem for normal setups, so there is no reason to
optimize this. Unless the same size is allocated in system RAM too,
during above mentioned copy...

Starting to understand the motivation for Level3...

Tormod


More information about the Coco mailing list