Re: [cc65] linking to o65

From: A. Fachat <fachat1web.de>
Date: 2012-01-21 01:02:01
Hi there,

after lurking on this list for a (short) while, I thought I'd jump into the 
discussion here... I have to admit I am new to cc65 though.

On Thursday 19 January 2012 18:53:56 Ullrich von Bassewitz wrote:
> There have been people successfully generating o65 output for Lunix using
> ld65, so I do assume that it works up to some degree. If you want your own
> OS id, you ask Andre Fachat for one and add it as a number in the linker
> config file (specifying "os = 5" instead of "os = lunix").

That is no problem. Just have something working, and I'll register a new ID. 
There aren't many anyway...

> > Well, if lunix target works well, it will be ok, I can create a
> > configuration similar to the lunix starting with the linker config file
> > dumped with ld65 (ld65 --dump-config lunix) and modified for my needs. I
> > guess :)
> That is probably the best idea until you have some stuff running. You can
> ask Andre for your own OS id later.

Yes.

> > > There's also a reason not to rely on imports: The string table for
> > > the names of the symbols may get rather big. This is the reason why
> > > loadable drivers (which a in o65 format) use a jump table instead
> > > of imports by name.> 
> > That's an important point.

Well. In fact, even though I don't have it documented explicitely on the web 
page, the recommendation is a mixed approach. Use a jump table, and only 
import the base address of the jump table. The file format is intelligent 
enough to handle offsets to imported variables. So what I do in my own 
operating system is to have two imports, "OSA65" and "LIB6502", and all 
references are like "OSA65+3" (hidden by defined constants like "PUTC"). The 
loader then adds the offset to the import. This way you keep the import table 
small, and still have the relocation ability. I don't know if cc65 supports 
this though.

> > Just I had the dream that there can be an OS
> > which has programs compatible with any computers which can run that OS
> > and use the same CPU, but the exact type of the computer is not
> > important.
> That's a very ambitious goal. You might get further with a target that's
> easier to achieve.

But achievable. Well I did. I think. :-) 
But you need some experience and perseverance. I started small, and got 
increasingly better. I suggest first start with an own OS at all, then go 
multi-arch.

> Yes. o65 is what you're looking for. It has been designed by Andre with
> 6502/816 operating systems in mind. It is less qualified for more complex
> applications, this is why I didn't use it as an intermediate format for
> cc65.

Absolutely. o65 wasn't designed for linker intermediate files.

André

----------------------------------------------------------------------
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 Jan 21 01:02:15 2012

This archive was generated by hypermail 2.1.8 : 2012-01-21 01:02:18 CET