Re: [cc65] Apple2 file io - here: memory management questions

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-07-31 13:09:36
On Fri, Jul 30, 2004 at 12:26:21AM +0200, Oliver Schmidt wrote:
> @Ullrich: Do you see an option to provide some memory allocation mechanism
> suitable for ProDOS 8 file buffers?

It's a common case that aligned memory is needed, so adding such a routine
would also be helpful in other situations. The best way would be to change
malloc to honor an alignment, and create a new malloc wrapper that calls the
old routine with an alignment of 1. However, one problem that prevents a quick
implementation is that the heap routines are highly optimized, with one
routine knowing about the zero page usage of others and similar things, so one
needs to proceed carefully when touching the code.

> 1. scenario: DOS 3.3
[...]
> 2. scenario: DOS 3.3 in upper memory
[...]
> 3. scenario: ProDOS 8 with command interpreter
[...]
> 4. scenario: ProDOS 8 without command interpreter
[...]

I'm not an Apple user, so maybe what I'm saying is stupid, but all this seems
rather complex to me. Why not start with a solution for the most common case
(which seems to be DOS 3.3), and first get something working? Having something
that works with all operating systems in all memory configurations on all
hardware is nice, but it has a high chance to get never implemented. It is my
experience that - having a small but working solution - it is easier to
determine what is needed in addition, and what could be left of or changed.

Please note that I'm not critizing your explanations. They are elaborated and
very understandable. But when I read it, my thoughts were "do we really need
to consider all this for a first working solution?".

I remember all the discussions about file I/O for the CBMs. I had refused to
implement file I/O for the CBMs because I thought that would be a nice user
contribution. As a result, I had endless discussions, both on and off list
about how this could be done. People came with ideas how to support fast
loaders, virtual file systems, all sorts of non standard addon hardware and
whatever. I'm sure I spent more than 25 hours just discussing file system
concepts and explaining the existing API in the cc65 libs. Plus, there were
regular mails from people complaining that printf ("Hello world") did not
work. At one point I was so fed up that I just added file I/O. While it is not
perfect (no fast loader, no special devices, not interrupt safe, ...) it works
reasonably well, and discussions about CBM file i/o have more or less
vanished.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jul 31 13:09:40 2004

This archive was generated by hypermail 2.1.8 : 2004-07-31 13:09:49 CEST