To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3571
3570  |  3572
Subject: 
Re: Global Objects was Strange RCX startup issues
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 10 Dec 2003 17:00:53 GMT
Viewed: 
3861 times
  
In lugnet.robotics.rcx.legos, Joseph Woolley wrote:
Doh!  I think I just answered the question (of course it was After
hitting send)

Joseph Woolley wrote:
[snip]
Also, I have a question (because of my limited knowledge of how the
__ctors and __dtors are managed):  Would the two *for* loops in your
sample code call the ctors and dtors for all global objects, regardless
of which program they belong (assuming Task Management and Program
Management is built)?  Would it be correct to validate that the function
pointer is pointing to a function within the current program code before
calling it?

So __ctors and __dtors are local to the program (address fix-up done by
genlds, etc...) ?  This way the __ctors are only for the current program.

Yes.

To add automatic handling of the global objects (for the kernel built
with TM and PROGRAM) would require that dll send the address of __ctors,
__ctors_end, __dtors and __dtors_end to the Program Manager.

Yes, I took a peek at the dll code and it looks like only one packet type would
have to be extended to add this additional information.

When not using the program manager (i.e. linking the user program directly to
BrickOS), then some simple loops like in my example should do the trick.

This seems possible, but not likely in the very near future.  Maybe I
can dig into it before January.

That would be great, Joe, if you could find the time.  I know I've shyed away
from using C++ with BrickOS because of this problem.  (Too lazy to fix it, I
guess! :-)

Mark



Message has 2 Replies:
  Re: Global Objects was Strange RCX startup issues
 
(...) [snipped] (...) I simply added ctor_size and dtor_size to the *image*, *lx* and *program* structures. This allows the program manager to calc the start and end of these segments. (...) It wasn't as hard as I had thought. I have the fix (...) (21 years ago, 11-Dec-03, to lugnet.robotics.rcx.legos)
  Direct Link (was Global Objects was Strange RCX startup issues)
 
In lugnet.robotics.rcx.legos, Mark Riley wrote: ... (...) All right, this brings up an interesting question. I can use BrickOS well enough to make it do cool stuff, but I really don't know all the cool stuff BrickOS can do... If I read this (...) (21 years ago, 11-Dec-03, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: Global Objects was Strange RCX startup issues
 
Doh! I think I just answered the question (of course it was After hitting send) Joseph Woolley wrote: [snip] > Also, I have a question (because of my limited knowledge of how the > __ctors and __dtors are managed): Would the two *for* loops in your (...) (21 years ago, 9-Dec-03, to lugnet.robotics.rcx.legos)

12 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR