1

How to Link/Load DKM projects with Kernel Image(VIP) project so that i can call the Entry point function of DKM project(application) from Kernel Image project's "usrAppInit.c" to get the application started automatically at boot time? Could some one please describe steps or point me to any documentation?

Sukum
  • 37
  • 1
  • 6

2 Answers2

1
  1. Add the DKM project as sub-project of your VIP. You can drag and drop, or open the VIP Project Properties, and from Project References check your DKM project
  2. In usrAppInit.c, call the entry point of your DKM. You will probably want to include the appropriate header
  3. Modify the VIP include paths as required to include the header file.
  4. If required, configure the kernel to use the correct build target for the DKM.

Using this approach, when you build the VIP, it will first build the child DKM projects (which will generate the .out files) then the VIP, generating a vxworks image that includes the .out files

mjs
  • 2,837
  • 4
  • 28
  • 48
  • Hi, Thanks for the solution, but unfortunately this makes a big project with a single binary. My requirement is to have DKM(.out) separately and link it to the Kernel Image Project probably using a build spec macro "EXTRA_MODULES". I tried this but i'm getting the following error: dld: Redeclaration of __dso_handle dld: Redeclaration of _ctors Defined in ../../INT-AC-DKM-18/CD1_AM437X_VSB_ARMARCH7diab/INT-AC-DKM-18/Debug/INT-AC-DKM-18.out and ctdt.o dld: Redeclaration of _dtors . Any idea how to resolve this conflict? – Sukum Aug 03 '17 at 09:38
  • No, it will, also generate the DKM .out - check in the DKM build folder. I use this exact process myself. The redeclaration errors you are getting are probably due to including the DKM as both a sub-project, and also as an EXTRA_MODULE. You might also need to force the kernel to use the correct buildspec for the DKM – mjs Aug 03 '17 at 12:25
  • You would also need to load the DKM using ld("DKM.out"), before calling the entry function as extern – finickyTunnel Aug 04 '17 at 05:22
  • @endTunnel not required, as this generates a vxworks image that already has the .out linked into it. – mjs Aug 04 '17 at 08:57
  • @mjs: Right. It does have separate ".out's". Thanks for the information. Also i found an other solution to it without having the projects clubbed. Need to specify the DKM application's partial image .o object file path to the EXTRA_MODULES Macro rather than ".out" path. If for example the application is "myApp" , "myapp_partialImage.o" path should be specified in the Macro. Multiple paths can be specified in the Macro with the space if Multiple app needs to be linked. – Sukum Aug 04 '17 at 09:31
  • 1
    @Sukum I hope this helped. If so please consider upvoting and/or accepting the answer. If you eventually went with another solution, you could also post your own answer (which you can accept instead, if you wish). – mjs Aug 09 '17 at 07:42
  • 1
    what happens when i have `a.o`, `b.o` linked with `c_partial.o` into `c.out`... what should my VIP reference? ro include via Extra_Modules? – Tomer W Jan 23 '19 at 07:00
0

An other solution to this problem without having the projects clubbed, Need to specify the DKM application's partial image ".o" object file path to the EXTRA_MODULES Macro rather than ".out" path. If for example the application is "myApp" , "myapp_partialImage.o" path should be specified in the Macro. Multiple paths can be specified in the Macro with the space if Multiple app needs to be linked

Sukum
  • 37
  • 1
  • 6