Re: A85: **RIGEL - the NEW shell**


[Prev][Next][Index][Thread]

Re: A85: **RIGEL - the NEW shell**



Jimmy Mårdell wrote:
> 
> I didn't find prgmexmp.txt and libexmp.txt - or were those replaced
> with lessons.doc?

Precisely.  Sorry about the confusion.
 
> A few things that crossed my mind when I read the doc files (and some
> disasm :) ):

Even though I don't appreciate that, I guess you were merely curious.
 
> In lessons.doc you say "All interrupts are removed by Rigel upon exiting
> Rigel." Does this mean that interrupt won't be resident in TI-OS?

Yes.  For one, the use of a TSR under the TI-OS is really unnecessary. 
Possibly one might argue that a screen capturing program would be nice,
but I believe must link programs allow a screen dump.  The reason they
are removed, is since the TI-85 rearranges memory when variables are
deleted (etc.) and this may cause the TSRs to move around in memory. 
Therefore the pointers that call the interrupt handlers will become
incorrect.
 
> When you install an interrupt, you simply just puts the pointer
> to the routine in the table (btw, the interrupt chain mode is identical
> with usgard, although the routine to store/remove an interrupt is
> different). If you want to install a TSR, I can't understand how
> that pointer will change when the program changes memory location. What
> I mean is that if program A installs a TSR, and then if you run progam
> B,
> program A has been moved and the pointer to the TSR must change, else
> the
> calc will crash. Or have I missed something here? (this is just theory -
> I haven't tested anything).

Well, I am not exactly clear what you are saying or asking.  Basically,
if I load a TSR in program A and then exit and run program B.  Program A
will have been moved, as Rigel relocates program B.  Therefore the TSR
loaded from program A will have changed location.  Rigel updates the
pointers to the TSR.  Because a TSR may move around in memory, one must
use "library-based relocation" in the TSR routine, instead of
conventional "main program fixed-address relocation".  Understand?
 
> Interesting idea to store the interrupt table at $8200-$8300, but won't
> you
> mess up with TI-OS later? I checked ti-ram.txt, but it didn't say much
> about that
> particular memory area. If you don't restored the contents after
> quitting Rigel,
> some parts of the TI OS must be corrupted. Using that method will
> definately
> guarantee that you never can run TSR programs in TI-OS.
> 
> I also noted that you move the stack - is this really necessary? I
> didn't
> really get what you were doing (storing something at a fixed location I
> assume), but can't you just store it at $FA70 instead? I didn't check
> this
> to closely, so I may have missed something.

Well I move the SP up (and move whats on the stack to the new location)
to free up 257-bytes.  You may have noticed that it is impossible to
load the interrupt vector there.  Hence, this is why I use $8200-$8300. 
I save what is in this range in the 257-bytes I have know in the stack
memory, and then load the interrupt vector between $8200-$8300.  When I
exit Rigel I restore everything.  Pretty neat, huh?
 
> Another thing: HOW are you going to make Rigel backward compatible!?!?
> According
> to rigel.h, you move the program you want to run directly after Rigel.
> If you
> in a later version increase the Rigel size (if only with a few bytes),
> you would
> have to change prog_start, ie you would lose backward compatibility.

I gave myself a substantial "buffer" if you will, in case I wish to
update or fix some bugs.  Besides I cannot see much else support one
would want out of a shell.
 
> Also, do you update the VAT when relocating (I doubt it)? You know,
> that's
> not very good...

Well, I'm not that stupid.  Yes I do update the VAT completely.  In fact
I have to, so that I can link libraries.
 
> This were just some few things that popped up at the first look. Since I
> haven't
> tested it, some of my statements above may be wrong.
> 
> --
> Jimmy Mårdell                "The nice thing about standards is that
> mailto:mja@algonet.se         there are so many of them to choose from."
> http://www.algonet.se/~mja
> IRC: Yarin                   "Sanity? I'm sure I have it on tape
> somewhere!"

Hope this helps.


Follow-Ups: References: