On Feb 11, 7:54 am, "Michael R. Kesti" <michaelke...@comcast.net>
wrote:
Rocketman wrote:
I think this is an easy question but I couldn't find it in the manual. >I'm working with VxWorks 5.5 Tornado 2.2.
I have an image project that builds the kernel that I want. I also
have a DKM project to build the application that I want. Now I'd like >to combine the two so when my system boots it automatically starts my >application.
I think I just need to call the application from usrAppInit, however,
how do I link the DKM's .out into the kernel? Do I need to build a >library first? etc.
Can someone describe the steps or point me to some documentation?
Many Thanks.
John.
Maybe you don't need to statically link your application with your
VxWorks image. If you can copy the application's .out file to the
same file system on which you store the VxWorks image then you could
code usrAppInit() to use loadModuleAt() to load the application in
memory, symFindByName() to find the application's entry point, and
finally call that entry point.
Michael,
Thanks that's an interesting solution. I'll have to give it a try.
I found information on other ways to do this but had limited success:
1. Add the path to the .out file as a value to the EXTRA_MODULES
macro.
Unfortunately when I rebuilt my kernel I got linking errors; 'multiple definition of _ctors and _dtors'
Didn't try to solve this one.
2. Use a boot script to load the module. I ran into the problem of Relocation value does not fit in 24 bits (I'm on a PowerPC with 128MB
of ram)
The normal fix of using the -mlongcall flag with the compiler didn't
work.
I haven't tried other fixes which basically fool the system to think
there's less memory when loading the module.
3. Combine the kernel image project and DKM project into one big
kernel image project so the application is already built into the
kernel.
This is what I did. I don't like having one big project but it works.
HTH anyone else asking this same question.
On Feb 11, 7:54 am, "Michael R. Kesti" <michaelke...@comcast.net>
wrote:
Rocketman wrote:
I think this is an easy question but I couldn't find it in the manual. >I'm working with VxWorks 5.5 Tornado 2.2.
I have an image project that builds the kernel that I want. I also
have a DKM project to build the application that I want. Now I'd like >to combine the two so when my system boots it automatically starts my >application.
I think I just need to call the application from usrAppInit, however,
how do I link the DKM's .out into the kernel? Do I need to build a >library first? etc.
Can someone describe the steps or point me to some documentation?
Many Thanks.
John.
Maybe you don't need to statically link your application with your
VxWorks image. If you can copy the application's .out file to the
same file system on which you store the VxWorks image then you could
code usrAppInit() to use loadModuleAt() to load the application in
memory, symFindByName() to find the application's entry point, and
finally call that entry point.
Michael,
Thanks that's an interesting solution. I'll have to give it a try.
I found information on other ways to do this but had limited success:
1. Add the path to the .out file as a value to the EXTRA_MODULES
macro.
Unfortunately when I rebuilt my kernel I got linking errors; 'multiple definition of _ctors and _dtors'
Didn't try to solve this one.
2. Use a boot script to load the module. I ran into the problem of Relocation value does not fit in 24 bits (I'm on a PowerPC with 128MB
of ram)
The normal fix of using the -mlongcall flag with the compiler didn't
work.
I haven't tried other fixes which basically fool the system to think
there's less memory when loading the module.
3. Combine the kernel image project and DKM project into one big
kernel image project so the application is already built into the
kernel.
This is what I did. I don't like having one big project but it works.
HTH anyone else asking this same question.
On 11 Feb., 21:01, Rocketman <jmm1...@gmail.com> wrote:
On Feb 11, 7:54 am, "Michael R. Kesti" <michaelke...@comcast.net>
wrote:
Rocketman wrote:
I think this is an easy question but I couldn't find it in the manual. >I'm working with VxWorks 5.5 Tornado 2.2.
I have an image project that builds the kernel that I want. I also >have a DKM project to build the application that I want. Now I'd like >to combine the two so when my system boots it automatically starts my >application.
I think I just need to call the application from usrAppInit, however, >how do I link the DKM's .out into the kernel? Do I need to build a >library first? etc.
Can someone describe the steps or point me to some documentation?
Many Thanks.
John.
Maybe you don't need to statically link your application with your VxWorks image. If you can copy the application's .out file to the
same file system on which you store the VxWorks image then you could
code usrAppInit() to use loadModuleAt() to load the application in memory, symFindByName() to find the application's entry point, and finally call that entry point.
Michael,
Thanks that's an interesting solution. I'll have to give it a try.
I found information on other ways to do this but had limited success:
1. Add the path to the .out file as a value to the EXTRA_MODULES
macro.
Unfortunately when I rebuilt my kernel I got linking errors; 'multiple definition of _ctors and _dtors'
Didn't try to solve this one.
2. Use a boot script to load the module. I ran into the problem of Relocation value does not fit in 24 bits (I'm on a PowerPC with 128MB
of ram)
The normal fix of using the -mlongcall flag with the compiler didn't
work.
I haven't tried other fixes which basically fool the system to think there's less memory when loading the module.
3. Combine the kernel image project and DKM project into one big
kernel image project so the application is already built into the
kernel.
This is what I did. I don't like having one big project but it works.
HTH anyone else asking this same question.
Hi,
have you tried this in the usrAppInit.c?
The problem is that the entry point of your application cannot be
resolved when the VxWorks image is loading. So write a function to
resolve the entry point of your application after loading it. That
way, there will be no unresolved identifiers when the VxWorks image is loading, and then when the image starts executing in usrAppInit.c,
your function will cause a jump to the entry point of your
application. We have the following functions defined in usrAppInit.c.
Below, "myEntryPointSymbol" will depend on how your linker puts
together the symbols. (For example, if one were creating the app with RoseRealTime and Tornado2.02, the symbol "_rtsMain" is generated for
the entry point rtsMain() ). Generally, as it might be in your case,
is it "_main"???
cheers.
LOCAL STATUS loadApplicationModule ( char *fileName ){
int fd = open(fileName, O_RDONLY, 0);.
MODULE_ID moduleId;
printErr("loading application module %s...", fileName);
if( fd != ERROR ){
moduleId = loadModule(fd, LOAD_ALL_SYMBOLS);
close(fd);
} else {
printErr("file open error %08X\n", errno);
}
if( moduleId != NULL){
FUNCPTR startfunction;
SYM_TYPE symtype;
STATUS rc;
printErr("search entry point in module %08X...\n", moduleId );
rc = symFindByName( sysSymTbl, "myEntryPointSymbol", (char **) &startfunction, &symtype);
if ( rc == OK ){
printErr("starting at %p %d\n", startfunction, symtype);
startfunction("myApp", "-oblisten 35518", "-URTS_DEBUG=quit");
} else {
printErr("entry point not found error %08X\n", errno);
}
} else {
printErr("module load error %08X\n", errno);
}
return (OK);
}
void start_myApplication(){
taskSpawn(
"myApplication",
TASK_PRIORITY,
TASK_OPTIONS,
TASK_STACKSIZE,
loadApplicationModule,
(int) "myOutFileNameWithPath",
0, 0, 0, 0, 0, 0, 0, 0, 0);
}
second call. But the problem here is that it is taking about one and a half minute to get the OPEN() call success and call the entry point after the boot up. Any idea how to get the application call immediately after boot up without any delay?Hi, I tried this method to load and call the entry point function from usrAppInit(), but the open() call was failing. so i added a forever loop to give it a try for multiple times and i see that the first call to OPEN() fails and is success on the
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 440 |
Nodes: | 16 (2 / 14) |
Uptime: | 23:54:18 |
Calls: | 9,150 |
Calls today: | 1 |
Files: | 13,433 |
Messages: | 6,043,104 |