why host shell can't access target file system? - VxWorks

This is a discussion on why host shell can't access target file system? - VxWorks ; As we know, VxWorks has target shell. And on the host side, we have host shell for development. In target shell, one can use "cd" command to change its current directory. for example, in target shell, we cd "/tffs0","/ata0","fd0",etc but ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: why host shell can't access target file system?

  1. why host shell can't access target file system?

    As we know, VxWorks has target shell. And on the host side, we have
    host shell for development.

    In target shell, one can use "cd" command to change its current
    directory.

    for example, in target shell, we cd "/tffs0","/ata0","fd0",etc

    but in host shell

    we can also use "cd" to change its current directory, but it seems
    that we can only access host file system. for example, cd "c:/" is
    ok, but when we type cd "/ata0a" in host shell, it prompts no such
    directory.

    Can we access target file system in host shell? Is it possible?

    Thanks very much.


  2. Re: why host shell can't access target file system?

    Hello Kai,

    Try the '@' symbol in front of the command (@cd). This will invoke the
    target's command instead of the host shell's emulation for this
    command. Be careful to use the '@' symbol in front of other commands
    like 'ls' or 'pwd' as well since otherwise you'll use the host-side
    commands which will apply to a different directory.

    Hope this helps,

    --
    PAD


  3. Re: why host shell can't access target file system?

    Thanks PAD
    You're really helpful. It really works!

    Hooray!

    On Aug 22, 1:48 am, PAD wrote:
    > Hello Kai,
    >
    > Try the '@' symbol in front of the command (@cd). This will invoke the
    > target's command instead of the host shell's emulation for this
    > command. Be careful to use the '@' symbol in front of other commands
    > like 'ls' or 'pwd' as well since otherwise you'll use the host-side
    > commands which will apply to a different directory.
    >
    > Hope this helps,
    >
    > --
    > PAD




  4. Re: why host shell can't access target file system?

    Sorry guys, Where is target shell? are you guys refering to the
    terminal?? I can't even use "cd" on the terminal. How can I "ls" what
    I have on the target?? Thanks a lot.

    Kevin


  5. Re: why host shell can't access target file system?

    Hello Kevin,

    The target shell is an optional component that must be included in the
    system image if needed. Look for the INCLUDE_SHELL component. In
    itself the target shell is not enough though: you'll likely need show
    routines (there are many and the related componensthave the word _SHOW
    in their names). Commands like 'cd' and 'ls' come with the component
    INCLUDE_DISK_UTIL_SHELL_CMD (details vary with versions of VxWorks).

    What Kai wants to use though is the host shell (AKA WindSh). This is
    an application that connects to the target server and emulates the
    kernel shell (in recent versions of VxWorks it does much more). This
    is a way of _not_ including the target shell in VxWorks while still
    being able to interact with the OS via a comand line interface.

    Hope this helps,

    --
    PAD


  6. Re: why host shell can't access target file system?

    Thanks, I understand now.

    On Aug 27, 10:55 am, PAD wrote:
    > Hello Kevin,
    >
    > The target shell is an optional component that must be included in the
    > system image if needed. Look for the INCLUDE_SHELL component. In
    > itself the target shell is not enough though: you'll likely need show
    > routines (there are many and the related componensthave the word _SHOW
    > in their names). Commands like 'cd' and 'ls' come with the component
    > INCLUDE_DISK_UTIL_SHELL_CMD (details vary with versions of VxWorks).
    >
    > What Kai wants to use though is the host shell (AKA WindSh). This is
    > an application that connects to the target server and emulates the
    > kernel shell (in recent versions of VxWorks it does much more). This
    > is a way of _not_ including the target shell in VxWorks while still
    > being able to interact with the OS via a comand line interface.
    >
    > Hope this helps,
    >
    > --
    > PAD




  7. Re: why host shell can't access target file system?

    Hello PAD,

    Let's say I have a file called ntp.conf. How can I download this file
    to the target?? Here's my approach, I made a folder under my VxWork
    Image Project, and put the file in this folder. So when I boot the
    image, this folder and the file will be downloaded to the target. But
    I don't think it's the correct way to do it, is it? I should do it
    through the ROMFS File System Project, right? Thanks a lot.

    Kevin


  8. Re: why host shell can't access target file system?

    Hey, I found it.

    For anyone who may need help:
    1) In the kernel configuration, include "INCLUDE_ROMFS"
    2) In VIP, create a sub ROMFS project
    3) Add file, to this project
    4) Close, Save, rebuild, reboot.
    5) When u type ls "/romfs" you will see the list of files you
    just added.

    Question:
    Now I want to access this file, how? do i do something like
    sp(ntpd, "-c", "/romfs/ntp.conf")

    Thanks,

    On Aug 28, 12:59 pm, Aggie wrote:
    > Hello PAD,
    >
    > Let's say I have a file called ntp.conf. How can I download this file
    > to the target?? Here's my approach, I made a folder under my VxWork
    > Image Project, and put the file in this folder. So when I boot the
    > image, this folder and the file will be downloaded to the target. But
    > I don't think it's the correct way to do it, is it? I should do it
    > through the ROMFS File System Project, right? Thanks a lot.
    >
    > Kevin




  9. Re: why host shell can't access target file system?

    Hello Kevin,

    Your first approach (using the VIP project to magically get the file
    on the target) is not going to work because there is nothing in this
    file that get's compiled in the VxWorks image. There are however
    several possible answer to your situation:

    1 - don't bother downloading, just access the host's filesystem via
    open(), read() and close(). Of course this does not work for a
    deployed system where no host is around.
    2 - if your target has a disk device just copy the file on this device
    and read it from there.
    3 - convert the content of ntp.conf into an array of characters part
    of a C module. Then link this module to the VxWorks image (you
    probably can do this via the VIP project). Accessing the content of
    ntp.conf in an easy way might also require setting up a RAM disk.
    4 - create a ROMFS project holding the ntp.conf file and get it
    included in the VIP image.

    Option 4 is definitively the easiest if option 1 is, well, not an
    option

    Hope this helps,

    --
    PAD


  10. Re: why host shell can't access target file system?

    Hello PAD,

    I picked option 4 and want to make sure if i'm doing the right thing.

    > 4 - create a ROMFS project holding the ntp.conf file and get it
    > included in the VIP image.


    1) In the kernel configuration, include "INCLUDE_ROMFS"
    2) In VIP, create a sub ROMFS project
    3) Add file, to this project
    4) Close, Save, rebuild, reboot.
    5) When u type ls "/romfs" at the host shell, you will see the list
    of files you
    just added to the ROMFS project.

    Am I doing it right?? If it is, how can I open this file and read the
    content of this file. Let's say I name this file, temp.txt. After I do
    the above steps, temp.txt will be at /romfs/temp.txt. Is there any way
    that I can open this temp.txt file? something similar to "vim
    temp.txt" or "more temp.txt" in Unix machine. Thanks.

    Kevin


  11. Re: why host shell can't access target file system?

    Hello Kevin,

    What you did looks ok to me, except that you might have to type 'ls "/
    romfs"' in the target shell ('@ls "/romfs" from the host shell. See
    the first three posts in this thread for the explanation).

    Once the file is on the ROMFS filesystem all you need to do is write a
    little program that opens /romfs/temp.txt and reads its content. Since
    the file system is read-only (hence the name) you cannot modify the
    file. If you want you can switch to the command mode of the target
    shell ('cmd' command) and then type 'more /romfs/temp.txt'. You'll be
    able to go page by page through the content of the file.

    Cheers,

    --
    PAD


  12. Re: why host shell can't access target file system?

    On Aug 31, 3:35 am, PAD wrote:
    > Hello Kevin,
    >
    > What you did looks ok to me, except that you might have to type 'ls "/
    > romfs"' in the target shell ('@ls "/romfs" from the host shell. See
    > the first three posts in this thread for the explanation).
    >
    > Once the file is on the ROMFS filesystem all you need to do is write a
    > little program that opens /romfs/temp.txt and reads its content. Since
    > the file system is read-only (hence the name) you cannot modify the
    > file. If you want you can switch to the command mode of the target
    > shell ('cmd' command) and then type 'more /romfs/temp.txt'. You'll be
    > able to go page by page through the content of the file.
    >
    > Cheers,
    >
    > --
    > PAD


    All,

    Its been few years since have worked on vxworks / visited this group.

    Was wondering if you really need to add a filesystem + expect the
    target to have onboard flash just for the sake of running few scripts.
    Both add to the product cost.

    Assuming you have a flash / rom on your end product, adding a
    filesystem to it is still a bad idea since the romfs( I used to look
    at trueffs those days, have worked on jffs2/cramfs etc in linux) will
    use atleast few sectors of flash for house keeping.

    - Vijay Peshkar


  13. Re: why host shell can't access target file system?

    On Sep 2, 4:29 am, vijay.pesh...@gmail.com wrote:
    > On Aug 31, 3:35 am, PAD wrote:
    >
    >
    >
    > > Hello Kevin,

    >
    > > What you did looks ok to me, except that you might have to type 'ls "/
    > > romfs"' in the target shell ('@ls "/romfs" from the host shell. See
    > > the first three posts in this thread for the explanation).

    >
    > > Once the file is on the ROMFS filesystem all you need to do is write a
    > > little program that opens /romfs/temp.txt and reads its content. Since
    > > the file system is read-only (hence the name) you cannot modify the
    > > file. If you want you can switch to the command mode of the target
    > > shell ('cmd' command) and then type 'more /romfs/temp.txt'. You'll be
    > > able to go page by page through the content of the file.

    >
    > > Cheers,

    >
    > > --
    > > PAD

    >
    > All,
    >
    > Its been few years since have worked on vxworks / visited this group.
    >
    > Was wondering if you really need to add a filesystem + expect the
    > target to have onboard flash just for the sake of running few scripts.
    > Both add to the product cost.
    >
    > Assuming you have a flash / rom on your end product, adding a
    > filesystem to it is still a bad idea since the romfs( I used to look
    > at trueffs those days, have worked on jffs2/cramfs etc in linux) will
    > use atleast few sectors of flash for house keeping.


    The ROMFS that's being discussed here is a RAM based, read-only file
    system -- it doesn't require or support flash.
    It's a quick and dirty way, under vxWorks 6.x, to get files onto a
    target.
    Of course, it has the drawback that the file system contents are
    static and need to be decided at project build time.
    This is adequate to the requirements of many target systems.


    HTH,
    GV



  14. Re: why host shell can't access target file system?

    Hello PAD,

    I just realized I would need to modify the file, so i guess ROMFS
    filesystem can't be used. What else can i use? Thanks...

    Kev.

    On Aug 30, 3:35 pm, PAD wrote:
    > Hello Kevin,
    >
    > What you did looks ok to me, except that you might have to type 'ls "/
    > romfs"' in the target shell ('@ls "/romfs" from the host shell. See
    > the first three posts in this thread for the explanation).
    >
    > Once thefileis on the ROMFS filesystem all you need to do is write a
    > little program that opens /romfs/temp.txt and reads its content. Since
    > thefilesystemis read-only (hence the name) you cannot modify thefile. If you want you can switch to the command mode of the target
    > shell ('cmd' command) and then type 'more /romfs/temp.txt'. You'll be
    > able to go page by page through the content of thefile.
    >
    > Cheers,
    >
    > --
    > PAD




  15. Re: why host shell can't access target file system?

    Hi Kevin,

    I would say that you'll have to try using a RAM disk. If you have only
    one file and no need for a directory structure you should be able to
    format this RAM disk with the RAWFS file system (otherwise DOSFS might
    be a better choice). How to do this is documented in the Kernel
    Programmer's Guide.

    Hope this helps,

    --
    PAD


+ Reply to Thread