Re: [cc65] linker cfg files

Date view Thread view Subject view

From: Greg King (gngking_at_erols.com)
Date: 2003-08-16 06:48:29


From: Maciej Witkowiak; on Date: Monday, August 11, 2003, 06:19 PM
>
> Ullrich von Bassewitz dnia 11 sie 2003 o 21:59 +0200 napisal:
> >  3. [This is only loosely related to your idea.] I don't have access to
> >     anything Lunix related but the linker config.,
> >     so I do not even know how the startup code must be changed
> >     to support a new configuration.  Wouldn't it be a good idea to make
> >     at least the Lunix startup code part of cc65?  Otherwise,
> >     it doesn't make much sense to have a built-in Lunix linker config.,
> >     since both must always match, or programs will not work correctly.
>
> LNG linker-config. uses $1000 instead of %S (just to virtualize
> the address).

LUnix can load programs anywhere in RAM (it depends on the program's size,
and on what else was loaded previously).  My lunix.cfg uses "start=%S" so
that we can make the labels file match where LUnix happens to put a
program.  The plan is:

1. Build the program -- with the default address.
2. Launch that program in LUnix.
3. Use (VICE's) monitor to find out where LUnix put it.
4. Relink the program -- using that discoverred address.
5. Run that program, again.
6. Load the labels file into the monitor.
   Then, you can see where things are while you are debugging.

>
> (off-topic: whenever I look at that crt0.s, I realize how silly of me it
> was to think about sophisticated way to get dynamic address for C-stack
> in LUnix instead of what is used there.)

Memory-fragmentation is the reason why we should use an allocated stack.
C programs are big; adding a static stack to them would make them even
bigger.  After a lot of unpredictable allocating, freeing, and
re-allocating, LUnix's free memory-blocks might become scatterred and
smaller.  There might not be any single blocks that are big enough to
hold a C-program-plus-stack.  Separating the program and the stack makes
it more likely that they can be put into RAM.

From: Groepaz; on Date: Monday, August 11, 2003, 06:27 PM
>
> I'm waiting myself for the dude that said he had my
> tetris thingy running in lunix, for releasing his libs and stuff.

The previous version of Tetris works with my library.  I haven't tested
the more recent version.

I redesigned lunix.cfg, again.  I want to make the configuration easy and
natural to use, in _both_ the cc65 and LUnix programming environments.
I agree, the library that is used by C programs should go into cc65's
package.  And, the sample programs that show how to send code through
LUnix's preprocessor, and then, through ca65 and ld65, should go into
LUnix's package.

You can look at:
    http://mysite.verizon.net/vze4nxfk/
if you really want to see my LUnix library.

Be careful if you choose to play with it!  The archive is not designed to
be dropped directly into the official cc65 distribution.  Some of my
include-files would replace those in the distribution.  Mine work a little
differently than the way that Uz does things (I tried to make them
completely compatible, but I don't guarantee it).  Don't try to load
dynamic-modules; LUnix needs patches that I have not sent in, yet.

----------------------------------------------------------------------
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 : 2003-08-16 07:05:19 CEST