Determining kernel shell state in 6.x - VxWorks

This is a discussion on Determining kernel shell state in 6.x - VxWorks ; (I am using VxWorks 6.5, so I'm not sure if this pertains to all 6.x kernels) I would like to write my own interpreter such that I special-handle when a started-kernel-shell has exited. For instance: while (1) { gets(buf); if ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Determining kernel shell state in 6.x

  1. Determining kernel shell state in 6.x

    (I am using VxWorks 6.5, so I'm not sure if this pertains to all 6.x
    kernels)

    I would like to write my own interpreter such that I special-handle
    when a started-kernel-shell has exited.

    For instance:
    while (1)
    {
    gets(buf);
    if (strcmp(buf, "shell") == 0)
    {
    int fdIn = ioGlobalStdGet(STD_IN);
    int fdOut = ioGlobalStdGet(STD_OUT);
    int fdErr = ioGlobalStdGet(STD_ERR);
    shellGenericInit(0, 0, 0, 0, TRUE, FALSE, fdIn, fdOut,
    fdErr);

    // The kernel shell will now take over stdin
    // until, in the shell, someone enters 'exit' at the -> prompt

    WAIT_FOR_SHELL_EXIT();
    printf("shell done\n");
    }
    else
    {
    printf("%s private command\n", buf);
    }
    }

    Assume I have configured the kernel with INCLUDE_SHELL, but
    SHELL_START_AT_BOOT as FALSE.

    Thank your for any suggestions as to how to implement
    WAIT_FOR_SHELL_EXIT().

    Regards,
    CMiller

  2. Re: Determining kernel shell state in 6.x

    Are you familiar with the VxWorks "command shell" which was added
    to VxWorks 6.0. It should remain permanently resident.

    What is cool is that you can easily add your own commands to the
    interpreter at run time.

    See the section "Adding Custom Commands to the Command Interpreter" in
    the Kernel Programmer's Manual (Target Tools->Kernel Shell section)

    Jason

    CMiller wrote:
    > (I am using VxWorks 6.5, so I'm not sure if this pertains to all 6.x
    > kernels)
    >
    > I would like to write my own interpreter such that I special-handle
    > when a started-kernel-shell has exited.
    >
    > For instance:
    > while (1)
    > {
    > gets(buf);
    > if (strcmp(buf, "shell") == 0)
    > {
    > int fdIn = ioGlobalStdGet(STD_IN);
    > int fdOut = ioGlobalStdGet(STD_OUT);
    > int fdErr = ioGlobalStdGet(STD_ERR);
    > shellGenericInit(0, 0, 0, 0, TRUE, FALSE, fdIn, fdOut,
    > fdErr);
    >
    > // The kernel shell will now take over stdin
    > // until, in the shell, someone enters 'exit' at the -> prompt
    >
    > WAIT_FOR_SHELL_EXIT();
    > printf("shell done\n");
    > }
    > else
    > {
    > printf("%s private command\n", buf);
    > }
    > }
    >
    > Assume I have configured the kernel with INCLUDE_SHELL, but
    > SHELL_START_AT_BOOT as FALSE.
    >
    > Thank your for any suggestions as to how to implement
    > WAIT_FOR_SHELL_EXIT().
    >
    > Regards,
    > CMiller


  3. Re: Determining kernel shell state in 6.x

    On Jun 27, 11:23 am, Jason wrote:
    > Are you familiar with the VxWorks "command shell" which was added
    > to VxWorks 6.0. It should remain permanently resident.
    >
    > What is cool is that you can easily add your own commands to the
    > interpreter at run time.
    >
    > See the section "Adding Custom Commands to the Command Interpreter" in
    > the Kernel Programmer's Manual (Target Tools->Kernel Shell section)
    >
    > Jason


    Yes, Jason, I considered that (there is a very good example of its use
    in the demo directory). I
    rather want to control things in my own way (I have a flex/bison
    command processor I want
    to use, but with the option of temporarily "going to the shell").

    I'm hoping there's a way to have the shell code raise an event flag
    upon the kernel shell's
    'going down'.

    Regards,
    CMiller

+ Reply to Thread