Re: [cc65] 65816

Date view Thread view Subject view

From: Maciej Witkowiak (ytm_at_elysium.pl)
Date: 2002-04-18 19:24:24


Ullrich von Bassewitz dnia 17 kwi 2002 o 13:06 +0200 napisał:
> This brings up an idea: Now that o65 support in the linker is complete and
> tested to some degree, it would also be possible to add a framework for
> loadable modules for cc65 generated programs. The o65 format is designed so
> that the loader/relocator is rather small. Adding such a loader would mean
> that programs can load support routines for memory management at runtime
> depending on the hardware found in the system. Such a runtime loader/overlay
> system would be helpful in several other cases, for example to load hardware
> specific mouse or graphic routines.
> 
> The only unfortunate thing is that I usually have a lot more ideas than I can
> handle:-) I'm still working on the simulator thing we discussed lately, and it
> will need a lot more work to become usable.
> 
> Maciej, can you tell me how big the o65 loader is, you wrote for Lunix? For
> the sake of portability, I would suggest to use the standard C file routines
> for the actual loading, so having a number without the file I/O stuff would be
> great.

My o65 loader for LUnix is ~500 lines long and after compiling it is ~900 bytes.
It is rewritten o65 relocator from original Andre Fachat's OS/A code. My
version is simplified - o65 headers and flags are mostly ignored, only system
type is checked, zero page relocation is ignored too, only pagewise relocation
is allowed.
It doesn't handle importing and exporting symbols (only one symbol for LUnix
virtual jumptable can be imported), OS/A relocator has it.

It doesn't have many external dependencies. It needs only equivalents of
fopen, fclose, fgetc, fread (which can be written as a loop with fgetc), and
something similar to malloc, which takes number of needed memory pages and
returns address of first page of continuous memory.

Most of code is devoted to calculating offsets and base addresses for each
segment. 

ytm

-- 
We strategize our object-oriented deliverables and content.

Mr. Derek D Stone
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-04-18 21:37:01 CEST