custom system calls in vxsim - VxWorks

This is a discussion on custom system calls in vxsim - VxWorks ; hi, I'm trying to create my own custom system calls on vxsim (for start), and i'm having problems compiling the simulator image: "Undefined symbol 'mySysCallSc' in file 'partialImage.o'" anyone got an idea of how to compile mySysCallSc into the partialImage? ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: custom system calls in vxsim

  1. custom system calls in vxsim

    hi,

    I'm trying to create my own custom system calls on vxsim (for start),
    and i'm having problems compiling the simulator image:
    "Undefined symbol 'mySysCallSc' in file 'partialImage.o'"

    anyone got an idea of how to compile mySysCallSc into the partialImage?

    thanx,
    Ben


  2. Re: custom system calls in vxsim

    Hello,

    Have you provided the mySysCallSc() routine? If not, you have to
    because this is your system call handler and it is up to you to write
    it. Look in the VxWorks Kernel Programmer's Guide for a description of
    the steps required to create custom system calls.

    Cheers,

    --
    PAD


  3. Re: custom system calls in vxsim

    I've provided the system call handler, and changed syscallUsrApi.def
    and syscallUsrNum.def to support the system call. scgen worked fine,
    and no compilation errors detected when i compiled the VxWorks source,
    with my system call handler included.

    but then, when i tried to build the image project, it failed with the
    undefined symbol error.


  4. Re: custom system calls in vxsim


    PSben wrote:
    > I've provided the system call handler, and changed syscallUsrApi.def
    > and syscallUsrNum.def to support the system call. scgen worked fine,
    > and no compilation errors detected when i compiled the VxWorks source,
    > with my system call handler included.
    >
    > but then, when i tried to build the image project, it failed with the
    > undefined symbol error.


    When you rebuilt the vxWorks libraries, did you specify CPU=SIMNT and
    TOOL=xxx to match the buildspec you use when you build the image
    project?

    GV


  5. Re: custom system calls in vxsim

    Then I would say it looks like the additional module you provided
    (holding the code of mySysCallSc()) is not linked in your VxWorks
    kernel image. Where did you add the file? I think you can do this via a
    VxWorks Image Project somehow.

    --
    PAD


  6. Re: custom system calls in vxsim


    PAD wrote:
    > Then I would say it looks like the additional module you provided
    > (holding the code of mySysCallSc()) is not linked in your VxWorks
    > kernel image. Where did you add the file? I think you can do this via a
    > VxWorks Image Project somehow.
    >
    > --
    > PAD


    moving the files to the image project actually solved the problem, now
    i have a registered system call, and i can see it in "syscallShow"
    command.
    thanx for your help.

    BTW, I'm not sure this is the right way, because now, with every image
    i need to add the syscall files to the image project. although the
    system call is supposed to be part of the OS source.

    anyway, i got a new problem, and i'd be glad if you continue helping
    me.
    I'm trying to use the system call from RTP project,


    sctest.h (in the image project)
    ---
    extern int sysCallTest(int i1, int i2);
    ---

    sctest.c (in the image project)
    ---
    int sysCallTest(int i1, int i2)
    {
    return i1+i2;
    }

    struct sysCallTestScArgs
    {
    int i1;
    int i2;
    };

    int sysCallTestSc(struct sysCallTestScArgs* args)
    {
    return sysCallTest(args->i1,args->i2);
    }
    ---

    main.cpp (in the rtp project)
    ---
    #include "../VxSimTest/sctest.h" //

    int main()
    {
    int i=sysCallTest(1, 2);
    }
    ---

    the file main.cpp compiles with no error, but when trying to build the
    project, i get this error:

    "dld: warning: Undefined symbol 'sysCallTest' in file
    'SIMPENTIUMdiab_RTP_DEBUG/main.o'
    dld: error: Undefined symbols found - no output written"

    it seems the "undefined symbol" problem passed to the RTP :-)
    any ideas?


  7. Re: custom system calls in vxsim

    Hello,

    PSben wrote:
    > moving the files to the image project actually solved the problem,

    now
    > i have a registered system call, and i can see it in "syscallShow"
    > command.
    > thanx for your help.


    Welcome.

    > BTW, I'm not sure this is the right way, because now, with every image
    > i need to add the syscall files to the image project. although the
    > system call is supposed to be part of the OS source.


    Unless you actually add your source file somewhere in the VxWorks
    source tree and rebuild the VxWorks kernel libraries your system call
    file cannot be part of the OS source. The way you have done it seems
    correct to me but you may also want to create a downloadable kernel
    module. This way you would link when downloading the module in the
    kernel instead of linking it when creating the VxWorks image. This
    might be more appropriate for your situation.

    [...]
    > the file main.cpp compiles with no error, but when trying to build the
    > project, i get this error:
    >
    > "dld: warning: Undefined symbol 'sysCallTest' in file
    > 'SIMPENTIUMdiab_RTP_DEBUG/main.o'
    > dld: error: Undefined symbols found - no output written"
    >
    > it seems the "undefined symbol" problem passed to the RTP :-)
    > any ideas?


    Have you declared your system call in (from memory, not sure about the
    exact names) target/usr/h/syscallUsrApi.def and
    target/usr/h/syscallUsrNum.def? If not, then you need to and then you
    have to run the scgen utility: this is what's going to generate the
    system call stub providing the symbol 'sysCallTest' in the RTP.

    I know this is described in the VxWorks Kernel Programmer's Guide
    somewhere (I don't have it handy).

    Cheers,

    --
    PAD


  8. Re: custom system calls in vxsim

    A correction and a precision now that I am at my desk:

    PAD wrote:
    [...]
    >
    > Have you declared your system call in (from memory, not sure about the
    > exact names) target/usr/h/syscallUsrApi.def and
    > target/usr/h/syscallUsrNum.def? If not, then you need to and then you
    > have to run the scgen utility: this is what's going to generate the
    > system call stub providing the symbol 'sysCallTest' in the RTP.


    The correct location for these files is ${WIND_BASE}/target/share/h.

    > I know this is described in the VxWorks Kernel Programmer's Guide
    > somewhere (I don't have it handy).


    This is described in the section 2.10 Custom System Calls of the
    VxWorks Kernel Programmer's Guide.

    Cheers,

    --
    PAD


+ Reply to Thread