home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vxworks
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!netnews.srv.cs.cmu.edu!hmp
- From: hmp@frc2.frc.ri.cmu.edu (Henning Pangels)
- Subject: Interesting ld68k behavior
- Message-ID: <HMP.92Nov6084047@squash.frc.ri.cmu.edu>
- Sender: news@cs.cmu.edu (Usenet News System)
- Nntp-Posting-Host: squash.frc.ri.cmu.edu
- Reply-To: hmp@frc2.frc.ri.cmu.edu (Henning Pangels)
- Organization: Field Robotics Center, CMU
- Date: Fri, 6 Nov 1992 13:40:47 GMT
- Lines: 43
-
-
-
- I just thought I'd share an observation I've made recently while
- placing vxWorks and application code into ROM.
-
- I'm using the rom compression feature, so most of my code gets
- crunched into a handy data array. The last step before compression is
- to ld68k everything one last time, specifying usrInit() as the entry
- point and RAM_TEXT_HIGH_ADDRESS (typically 0x90000) as the start of
- the text segment. Then, when the system starts up, romStart()
- uncompresses the whole mess, starting at RAM_TEXT_HIGH_ADDRESS, and
- then proceeds to jump to the entry point with the call
- ((FUNCPTR)RAM_TEXT_HIGH_ADRS) (startType);
-
- So far so good, it looks like everything is going according to plan.
- My assumption - from looking at how things are done - was that
- specifying -e _usrInit and -T 90000 results in usrInit() being placed
- at the start of the text segment, since that is the routine we want to
- execute when we jump to RAM_TEXT_HIGH_ADDRESS. Sounds reasonable.
-
- But imagine my surprise when I added some custom routines at the top
- of usrConfig.c (one might argue over the political correctness of
- doing so...), and usrInit no longer ended up at RAM_TEXT_HIGH_ADDRESS.
- Instead, whatever routine appeared first in usrConfig.c got that
- privilege and was subsequently called by romStart.
- The obvious solution was to simply rearrange the order of the routines
- usrConfig.c so that usrInit() comes first.
-
- But I have to wonder: Is this the way things ought to be? Am I just
- missing something fundamental here? Or could it be that somehow the
- notion of "entry point" becomes unclear when loading a module by
- uncompressing from one part of memory into another?
-
- I'd be interested in your comments.
-
- -Henning
-
-
- --
- Henning Pangels |hmp@frc2.frc.ri.cmu.edu | Field Robotics Center
- Research Programmer|(412) 268-7088 |Carnegie-Mellon University
- ------------------------------------------------------------------------------
- It can be difficult to wreck a nice beach.
-