VxWorks 6 Topics

Building a Kernel

GNATemulator supports a specific BSP for VxWorks 6, the first step is to build a kernel with this BSP.

To create a VxWorks 6 kernel:

  1. In WorkBench: File -> New -> VxWorks Image Project

  2. Enter project name (e.g. GNATemu_kernel), click Next

  3. On GNATemulator for PowerPC e500v2 VxWorks 6.x, select the wrSbc8548 BSP, and on GNATemulator for PowerPC VxWorks 6.x select the wrSbc834x BSP.

  4. Select the gnu tool chain.

  5. Click Next twice

  6. Select Profile: PROFILE_DEVELOPMENT and click Finish

  7. In the kernel configuration window for BSP wrSbc8548 profile:

    1. Exclude DRV_TIMER_OPENPIC
    2. Include INCLUDE_STANDALONE_SYM_TBL
    3. Include FOLDER_DOSFS2
    4. Set LOCAL_MEM_SIZE to 0x8000000 # Note 0x800_0000
    5. Set WIND_JOBS_MAX to 256
  8. In the kernel configuration window for BSP wrSbc834x profile:

    1. Exclude INCLUDE_NET_DRV
    2. Include INCLUDE_NETSTAT
    3. Include INCLUDE_STANDALONE_SYM_TBL
    4. Include FOLDER_DOSFS2
    5. Set LOCAL_MEM_SIZE to 0x8000000 # Note 0x800_0000
    6. Set WIND_JOBS_MAX to 256
    7. Change IP addresses of DEFAULT_BOOT_LINE to h=192.168.0.1 e=192.168.0.2
  9. On GNATemulator for PowerPC VxWorks 6.x

    1. Click on File -> Import...

    2. Select General -> File System and press Next

    3. In the File System dialog, browse to following directory

      <GNATEMULATOR_INSTALL_DIR>/share/gnatemu/<TARGET>/autoexec

    4. Press OK

    5. Press Select All then Finish

    6. Answer Yes To All in the Overwrite... dialog box

  10. To build the kernel run: Project -> Build Project

You can find the kernel image at <PROJECT_ROOT_DIR>/Default/VxWorks.

Running GNATemulator

Downloadable Kernel Module

GNATemulator takes the DKM (.out) as last command line argument,
automatically loads and runs it and then stop execution.
$ powerpc-wrs-vxworks-gnatemu --kernel=<PROJECT_ROOT_DIR>/Default/VxWorks print.out
Target Name: vxTarget

Adding 6942 symbols for standalone.


                VxWorks

Copyright 1984-2012  Wind River Systems, Inc.

             CPU: Wind River SBC8349E
    Runtime Name: VxWorks
 Runtime Version: 6.9
     BSP version: 6.9/0
         Created: Dec  1 2012, 19:28:15
ED&R Policy Mode: Deployed
   WDB Comm Type: WDB_COMM_END
             WDB: Agent Disabled.


cmdline: kernel print.out
Instantiating /tmp as rawFs,  device = 0x1
Formatting /tmp for DOSFS
Instantiating /tmp as rawFs, device = 0x1
Formatting...-> OK.
Mount ramdisk in /tmp...OK
copy host:print.out -> local:print.out
708798 byte(s) transferred
<runkernel print.out at addr=0x17567e0 id=24468064>
Hello world!
</runkernel>

Interactive Mode

When there is no DKM on the command line, GNATemulator starts vxWorks in interactive mode.

$ powerpc-wrs-vxworks-gnatemu --kernel=<PROJECT_ROOT_DIR>/Default/VxWorks
Target Name: vxTarget

Adding 6942 symbols for standalone.


                VxWorks

Copyright 1984-2012

             CPU: Wind River SBC8349E
    Runtime Name: VxWorks
 Runtime Version: 6.9
     BSP version: 6.9/0
         Created: Dec  1 2012, 19:28:15
ED&R Policy Mode: Deployed
   WDB Comm Type: WDB_COMM_END
             WDB: Agent Disabled.

cmdline:
Instantiating /tmp as rawFs,  device = 0x1
Formatting /tmp for DOSFS

Instantiating /tmp as rawFs, device = 0x1
Formatting...-> OK.
Mount ramdisk in /tmp...OK
Run_shell
->

Connecting Workbench to GNATemulator

The Wind River Debug Server (DFW) can connect to GNATemulator using the wdbrpc back-end that will use the Ethernet connection available in GNATemulator.

To create a new target server for GNATemulator and VxWorks 6:

  1. Click on New Connection... in the Target menu of Workbench.

  2. Select Wind River VxWorks 6.x Target Server Connection as the system type.

  3. In the Target Server Options page, select wdbrpc as the Backend, set the IP address to 127.0.0.1 and the port to 17185.

  4. Set the Kernel image

  5. To complete the setup of the target server you can keep the other fields to their default values

  6. Start GNATemulator with the --wdb option

  7. Note: INCLUDE_WDB_ALWAYS_ENABLED must be in kernel configuration.

    $ powerpc-wrs-vxworks-gnatemu --wdb --kernel=<PROJECT_ROOT_DIR>/Default/VxWorks

  8. Click on Connect ‘...’ in the Target menu.

Using the internal TFTP server

GNATemulator‘s internal TFTP server can be used to load file and executable on the target.

  1. Open the kernel project created in Building a Kernel

  2. In the kernel configuration window:

    1. Include INCLUDE_TFTP_CLIENT
    2. Include INCLUDE_IPTFTPC
    3. Include INCLUDE_IPTFTP_CLIENT_CMD
    4. Include INCLUDE_RAM_DISK
    5. Set RAM_DISK_SIZE to 16000000
    6. Set RAM_DISK_DEV_NAME to “/tmp”
  3. In addition for the wrSbc834x BSP:
    1. Set DEFAULT_BOOT_LINE to “mottsec(0,0)host:target/config/wrSbc834x/vxWorks h=192.168.0.1 e=192.168.0.2 g=192.168.0.1 u=vxworks tn=wrSbc834x”
  4. Re-build the kernel: Project -> Build Project

To use the TFTP in VxWorks:

  1. Start GNATemulator

    $ powerpc-wrs-vxworks-gnatemu --wdb --kernel=<PROJECT_ROOT_DIR>/default/vxWorks

  2. In the VxWorks prompt, format the ram disk

    -> dosFsVolFormat ("/tmp", 0, 0)

  3. Change current directory

    -> cd "/tmp"

  4. Enter command mode

    -> cmd

  5. Use the tftp command to download a file

    [vxWorks *]# tftp 192.168.0.1 get test.txt

Here is a complete example of TFTP session:

$ echo Test TFTP server > test.txt
$ powerpc-wrs-vxworks-gnatemu --wdb --kernel=<PROJECT_ROOT_DIR>/default/vxWorks
Instantiating /tmp as rawFs,  device = 0x1
Target Name: vxTarget
Instantiating /ram as rawFs,  device = 0x10001
Formatting /ram for DOSFS
Instantiating /ram as rawFs, device = 0x10001
Formatting...Retrieved old volume params with %38 confidence:
Volume Parameters: FAT type: FAT32, sectors per cluster 0
  0 FAT copies, 0 clusters, 0 sectors per FAT
  Sectors reserved 0, hidden 0, FAT sectors 0
  Root dir entries 0, sysId (null)  , serial number 20000
  Label:"           " ...
Disk with 64 sectors of 512 bytes will be formatted with:
Volume Parameters: FAT type: FAT12, sectors per cluster 1
  2 FAT copies, 54 clusters, 1 sectors per FAT
  Sectors reserved 1, hidden 0, FAT sectors 2
  Root dir entries 112, sysId VXDOS12 , serial number 20000
  Label:"           " ...
OK.

Adding 6717 symbols for standalone.


                VxWorks

Copyright 1984-2012  Wind River Systems, Inc.

             CPU: Wind River SBC8349E
    Runtime Name: VxWorks
 Runtime Version: 6.9
     BSP version: 6.9/0
         Created: Dec  1 2012, 19:28:15
ED&R Policy Mode: Deployed
   WDB Comm Type: WDB_COMM_END
             WDB: Agent Disabled.


-> dosFsVolFormat ("/tmp", 0, 0)
Formatting /tmp for DOSFS
Instantiating /tmp as rawFs, device = 0x1
Formatting...Retrieved old volume params with %38 confidence:
Volume Parameters: FAT type: FAT32, sectors per cluster 0
  0 FAT copies, 0 clusters, 0 sectors per FAT
  Sectors reserved 0, hidden 0, FAT sectors 0
  Root dir entries 0, sysId (null)  , serial number 11690000
  Label:"           " ...
Disk with 31250 sectors of 512 bytes will be formatted with:
Volume Parameters: FAT type: FAT16, sectors per cluster 2
  2 FAT copies, 15546 clusters, 62 sectors per FAT
  Sectors reserved 1, hidden 0, FAT sectors 124
  Root dir entries 512, sysId VXDOS16 , serial number 11690000
  Label:"           " ...
OK.
value = 0 = 0x0
-> cd "/tmp"
value = 0 = 0x0
-> cmd
[vxWorks *]# tftp 192.168.0.1 get test.txt
Transfer completed: 17 bytes in 0.0 seconds.
[vxWorks *]# cat test.txt
Test TFTP server
[vxWorks *]#

VxWorks 6 Cert Topics

Building a Kernel

GNATemulator supports a specific BSP for VxWorks 6 cert, the first step is to build a kernel with this BSP.

To create a VxWorks 6 cert kernel:

  1. In WorkBench: File -> New -> VxWorks Cert Image Project

  2. Enter project name (e.g. GNATemu_kernel), click Next

  3. On GNATemulator for PowerPC e500v2 VxWorks 6.x, select the wrSbc8548 BSP, and on GNATemulator for PowerPC VxWorks 6.x select the wrSbc834x BSP.

  4. Select the gnu tool chain.

  5. Click Next

  6. Select option with RTP support and click Next

  7. Select a Profile and click Finish

  8. In the kernel configuration window:

    1. Set LOCAL_MEM_SIZE to 0x8000000 # Note 0x800_0000
  9. To build the kernel run: Project -> Build Project

You can find the kernel image at <PROJECT_ROOT_DIR>/Default/VxWorks.

Running GNATemulator

$ powerpc-wrs-vxworks-gnatemu --kernel=<PROJECT_ROOT_DIR>/Default/VxWorks


  Copyright 1984-2011 Wind River Systems, Inc.
  VxWorks Cert 6.6.4.1
  Created: Jun 14 2013, 17:48:22
  ...

Running tests on vxWorks Cert

To run a test on vxWorks Cert it has to be included in the kernel during build. SKMs linked to the kernel binary, RTPs in a ROMFS. Then usrAppInit() must be modified to load and/or run the test. You will find procedures to do so in WorkBench documentation. Note that theses procedures can be scripted using the vxprj command line tool.