Re: copy function and run it





sconnet@xxxxxxxxx wrote:

I am using a PPC750 and vxWorks. I am trying to copy a function
outside of the text/data/bss segment into an unused portion of RAM and
jump to it. The function to be copied contains no library calls or
function calls. The executing function then copies a vxworks image
from another location in user defined memory over top of the existing
running image and jumps to it. Is this valid? People are telling me it
should work but does not.

I am not particularly familiar with the specifics of VxWorks, however I did the things similar to what you are trying to do. Yes, it is possible, however it requires a lot of care.

1. Make sure your function is properly linked. I.e. the code is placed at one location, and it is supposed to run from the other location.

2. There could be some agreement on the run time environment required to execute a function. Make sure the environment is correct at the location where the function is executed.

3. A compiler could have optimized your function away as a dead code.

4. It could be a problem with near/far memory access model depending on your CPU.

5. Make sure that the location in the RAM is not used by anything else. You should define it as the dedicated section in the linker file.



Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com
.



Relevant Pages

  • Getting Back to Real Mode
    ... Jump to CODE32:pmode lable; ... Pmode lable: Sets All other 32 segments will be set ... Jump CODE16:Realmode lable this statement makes the system restarts. ... I am executing the program with DOS6.22 debugger at a specified ...
    (comp.lang.asm.x86)
  • Re: How does setpatch work?
    ... > Kickstart is in ROM, the Amiga hardware is designed to boot off ... > I guess the Kickstart ROM code loads some function jump table into RAM. ... Usually this is done from an array of function entry points. ...
    (comp.sys.amiga.programmer)
  • Re: Sysinstall automatic filesystem size generation.
    ... I thought that with SCSI it is "ok" to leave the cache enabled ... >the reboot because it was still cached in RAM and executing from RAM ... that would account for the 0-size files but not for ones that ...
    (freebsd-stable)
  • mc68332 embedded programming problems
    ... I am trying very unsuccessfully to load my code from my Flash into ram, ... and then jump to ram. ... I can only load so many bytes to ram before the system resets. ...
    (sci.electronics.design)
  • Re: Flash Memory - Loading an Application of 2M size into 1M Flash memory
    ... your development platform only has 1 MB of flash??? ... I do RAM execution, debugging and development. ... You don't say whether or not you are executing in-place from the ...
    (comp.arch.embedded)