Programmatic use of load module

VxWorks

    Sponsored Links

    Next

  • 1. SD Card interface on vxworks
    Hello, I am developing a driver for SPI for SD Card interface on Vxworks. As SD Card supports FAT file system, i want to use the same. I have no idea how to go ahaid with the implementation. Can anyone please tell me how the architecture will be, means which are all the layers will come into picture and how each one of them is connected to the other. I am assuming there will be three layers, uppermost will be FAT file system layer, next will be SD Card driver layer and lower most will be the SPI driver layer, but am not sure about this. And even if it is correct i dont know how to go ahaid with it. Can anyway please guide me for the same. Thanks prasad
  • 2. Best way to implement periodic task using POSIX timers
    Hello eveyone, I'm quite a beginner with vxworks and I'd like to ask a basic question. I have to implement a set of three period tasks using POSIX timers. I was wondering which is the best way to do it. My actual implementation uses 3 tasks with different priorieties. Each task has its own entry function and its own timer. There are also 3 counting semaphores. Let me just write some code for explaining in a better way: I spawn task using taskSpawn and I associate to each task a function entryFunction. void entryFunction(SEM_ID sem) { .............. while(1) { semTake(sem); /* periodic stuff*/ } return; } Semaphores are initializated to a 0 count and in the way I wrote the code the first action on a semaphore is always the semTake. The semaphore is given inside timer handler function every tiem it expires. So this means the task does its periodic computation every X ticks. void handler(SEM_ID sem) { semGive(sem); return; } A given semaphore is taken always by the same task and given always by the same timer. Everything seems to work fine with this implementation. Do you think it is a good approach (safe, efficient, etc....)? What I'm not sure about is the use of semaphores for simulating task's idle time. Thank you in advance, Paolo
  • 3. measuring interrupt latency
    I was wonder if anyone had success measuring interrupt latency using timers in Vxworks on either a intel x86 or PowerPC board. If so it would be wonderful if you could share it with me. I tried using auxiliary clock interrupt to measure this using systimestamp drivers and sys clock as timing sources, but was unsuccessful with it. I am aware that it is possible to get an accurate measurement using oscilloscope or logical analyzer but I would prefer a more automated way of measuring interrupt latency using timers. Also to be more specific here, by interrupt latency what I mean here is the time between the interrupt signaling to when the C routine connected to the interrupt service vector starts executing. So according to this definition it should include the latency due to the controller as well as the time to execute intEnt (otherwise referred to as interrupt prologue), which saves the registers and masks the interrupts.
  • 4. Compiler Flags for Boot ROM
    Hi friends, I want to add one compiler flag in my BSP compilation. In Tornado 2.2, Where I have to add this flag. In Project utility, Build tag has default compile type. In the properties of default, we can change the Compiler and linker options for VxWorks Image. For Boot ROM, where I have to add this? -Thanks K.Ananth
  • 5. open SSL and open SSH
    Hi All, I need some info about open SSL and open SSH on vxworks 6.2 or 5.x. I searched the group for the same topic, all the postings were too old, so posting my query again. Any open source available for SSL and SSH for vxworks 6.2? If it is not available, any one is there who has ported and able to show HTTPS or any apps on SSH? Highly appreciate your response. --MB

Programmatic use of load module

Postby Jeanseb » Sat, 10 Sep 2005 22:09:37 GMT

Hello,

I have read the windriver tech tip 4179, which explains how to
programmaticaly load modules from RAM/ROM.

I am interested in doing this, since I want to split my code in
multiple modules on my standalone application: updating my code would
only require updating a couple of modules (the link to my standalone
application has a very limited bandwidth). Also at startup, I would be
able to load different modules, and chose which version of my code to
run.

However, I have encoutered 2 major problems:

1) I intend to load code modules from flash from UsrAppInit. There is a
problem though: from UsrAppInit, I cannot invoke any function from the
modules I intend to load, since these functions are not defined in the
scope of the bootable image. I have tried a forward declaration of
these functions (using extern, which works for downloadable
applications) but the code just does not compile ("undefined
reference").

2) When modules have a cyclic relationship - Module A invokes Module B,
and Module B invokes Module A - the sequential VxWorks loader does not
work. Since loading Module A first will generate errors due to
undefined symbols from Module B, and vice versa. I have tried to
declare a "fake" module B in module A (create an empty library, used to
register Module B symbols in the symbol table). Then I load module B to
overwrite the fake symbols defined by module A. The idea is to
pre-register module B's symbols when module A is loaded.
possible: "The system symbol table allows name clashes to occur. For
example, suppose a function func exists in the system. A second symbol
named func is added to the system symbol table as part of a load. From
this point, all links to func are to the most recently loaded
symbol...". I have tried multiple options for the loader, but it just
does not work: the symbols defined by module B, even if they use the
same name do not overwrite the fake symbols defined by module A.

Could someone help me please?

Thank you in advance!

Jean-Sebastien


Re: Programmatic use of load module

Postby Michael Lawnick » Sat, 10 Sep 2005 22:50:12 GMT

Jeanseb said the following:
[snip]
[snip]
You'll have to use function pointer, which you initialize after module load.
Look into symLib to find out how to get the addresses.
[snip]
No cyclic relation allowed! All symbols must be resolved while download
and won't ever be changed.
If you update a module, unload the old one, load the new one and refresh
the function pointers of the unmodified modules.

!!! Take special care that the processor does not try to call a function
in one of the changed modules while you try to update !!!

HTH
Michael

Re: Programmatic use of load module

Postby ssubbarayan » Tue, 13 Sep 2005 14:02:35 GMT

eanseb wrote:

Jean,
There are some info I have gathered from this group which may be
relevant to your query.I am pasting it below for your reference.I
believe it will be of help to you,Though I am not exactly sure how far
this will be solving your query.


Collected info:
--------------------------------------------------
Hi,

I have two VxWorks images in flash. I boot from one of the images. I
image
I boot from to transfer the second image into RAM and run it. I can
transfer the second image into RAM but I am not sure how to run it.

Can anybody offer any ideas?

Dan J

Michael R. Kesti ( XXXX@XXXXX.COM )
After the second image is loaded into memory (presumably using
loadModule()
or loadModuleAt() ), use symFindByName() to locate that image's entry
point
and then call the entry point.

Is loadModuleAt() not used for loading .out files? I have a bootable
VxWorks image?
Dan J


Bill Pringlemeir ( XXXX@XXXXX.COM )
This is true. You will have to make a modification to the vxWorks RAM
image. Specifically, you have to look at if it is going to setup
memory mappings. For instance, the RAM image may assume that it is
loaded at a particular memory address. Is the RAM image compressed,
etc. You also didn't mention if the RAM image was pre-built, you are
creating it with the project, or via a makefile.

In any case, there are several possibilities. You jump to the first of
the image. This is usually romInit.s, etc. If the image is not
compressed and just assumes that it is loaded at the right place, then
a jump to "usrInit()" might work. Some images have this address
placed at a fixed offset in the image.

btw, there was no way for Michael to know that you are loading a
binary image versus a elf/coff file. Can you see the need to give
more info?

fwiw,
Bill Pringlemeir.

shafi ( XXXX@XXXXX.COM )
Jump to the starting entry routine location on the second image you
loaded on the RAM. check bootConfig.c sample file. That's what it does
there using a function 'go' to jump and execute the image loaded.
----------------------------- ends here----------------


Query 2:

JT ( XXXX@XXXXX.COM )
163)Hi,

I am trying to keep my VxWorks image and my application image separate.

Maybe that is really not necessary, but in our product we will quite
often
be upgrading the application. So I thought it would be a good idea to
keep
the VxWorks image (boot-image), separate from the application.

The problem is: How do I link the VxWorks-image to my application image

when
my application image is changing all the time?

My plan is to place the application image on the target hard disk. This

provides for easy means for our customers to upgrade to new versions of

our
application. The VxWorks image will then, in usrAppInit(), perform a
loadModule() to load our application module from disk to memory.

The plan is then to call "MyApplicationStart()". However, I can not
link the
VxWorks image directly to my application, as the application will
change
over and over again, and thus the address of MyApplicationStart().
Therefore
I get problems when builing the VxWorks image.

So, what is the best way to achieve this? Could I search for
MyApplicationStart() in the SymTable after performing the loadModule?
Or is
there any other way of linking the VxWorks-image to something that will

be
dynamically loaded?

Thanks for any help!

Best regards,

Jostein Tro


Return to VxWorks

 

Who is online

Users browsing this forum: No registered users and 81 guest