Wr Vx Simulator Users Guide 6.9

June 3, 2018 | Author: danielghro | Category: Command Line Interface, Operating System, Booting, 64 Bit Computing, Device Driver


Comments



Description

Wind River VxWorks Simulator User's Guide, 6.9 Wind River VxWorks Simulator ® USER'S GUIDE 6.9 Copyright © 2010 Wind River Systems, Inc. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means without the prior written permission of Wind River Systems, Inc. Wind River, Tornado, and VxWorks are registered trademarks of Wind River Systems, Inc. The Wind River logo is a trademark of Wind River Systems, Inc. Any third-party trademarks referenced are the property of their respective owners. For further information regarding Wind River trademarks, please see: www.windriver.com/company/terms/trademark.html This product may include software licensed to Wind River by third parties. Relevant notices (if any) are provided in your product installation at the following location: installDir/product_name/3rd_party_licensor_notice.pdf. Wind River may refer to third-party documentation by listing publications or providing links to third-party Web sites for informational purposes. Wind River accepts no responsibility for the information provided in such third-party documentation. Corporate Headquarters Wind River 500 Wind River Way Alameda, CA 94501-1153 U.S.A. Toll free (U.S.A.): 800-545-WIND Telephone: 510-748-4100 Facsimile: 510-749-2010 For additional contact information, see the Wind River Web site: www.windriver.com For information on how to contact Customer Support, see: www.windriver.com/support Wind River VxWorks Simulator User's Guide 6.9 15 Dec 10 Contents 1 Overview ...................................................................................................... 1.1 1.2 Introduction ...................................................................................................................... Supported Features and Compatibility ...................................................................... 1.2.1 1.2.2 1.3 VxWorks Feature Support ............................................................................... Simulated Hardware Support ......................................................................... 1 1 2 2 3 3 Limitations ........................................................................................................................ 2 Getting Started ............................................................................................ 2.1 2.2 Introduction ...................................................................................................................... System Requirements ..................................................................................................... Multiprocessor Simulation Requirements ..................................................... 64-Bit Support .................................................................................................... 2.3 Configuring and Building a VxWorks Image ............................................................ 2.3.1 2.3.2 2.3.3 2.3.4 2.4 Default Configuration Components ............................................................... Configuring Optional Components ............................................................... Building Your VxWorks Image ....................................................................... VxWorks Source Build (VSB) Projects ............................................................ 5 5 5 5 6 6 6 7 7 8 8 8 12 12 13 13 14 14 Launching the VxWorks Simulator ............................................................................. 2.4.1 2.4.2 vxsim Configuration Options .......................................................................... Launching a VxWorks Simulator Instance from the Command Line ....... Modifying the Windows Simulator Console Appearance .......................... Starting an Instance with Network Redirection (NAT) ............................... Starting an Instance to Run on a Simulated Subnet ..................................... 2.4.3 2.4.4 Launching the VxWorks Simulator from Workbench ................................. Connecting to an Existing Simulator Instance from Workbench ............... iii .........4 Defining Compiler Options ..............................................................................................................................................................5 Byte Order ..................... 4...................................................................................... Memory Configuration ..........................................5 Architecture Considerations ................................................................................................................................................... The VxWorks Simulator BSP ........... Simulation ....1 4........ Pass-Through File System (passFS) ...................................... 3.............................................................................5.....2 Boot Parameters ....4 3.............................................. 17 17 17 18 18 20 21 21 21 22 22 22 22 23 23 23 23 23 23 24 24 24 24 25 25 25 26 28 Interface Variations ..........................................................................................................................................................................5 2...................................................................................................................................5.................................................................................................2....... 4 Using the VxWorks Simulator ...................................... Windows Systems .......................2 Introduction ..............3 3......................................6 Rebooting and Exiting the VxWorks Simulator ..............5..... Running the VxWorks Simulator Without MMU Support ................................. 3.................. 3....1 3...................5 WDB Back End ...................3 Introduction .............................................................................................. 3............................. 4........................................3..........2 3.................................................6 Memory Layout .........1 3..................................................................................................................................................................................................................................................4.............. Solaris and Linux Systems .................. Accessing the VxWorks Simulator from a Remote Host ...................................................... 6.................................... 3..................................................... Page Size ...............4....2 3..............3 RTP Considerations ...................................................................................5................ Virtual Disk Support ................................................................................... 33 33 33 33 34 iv ................. Connection Timeout ...........................4.........................4.................................. Building Applications .................................................................5......................................... 15 15 3 Introduction to the VxWorks Simulator Environment ................... 3......................1 Memory Management Unit ..1 4...................... Limitations ...................................1 3........ 3.............................Wind River VxWorks Simulator User's Guide............2..................2 3..........4. 3.............................................................................. Translation Model .....4 3....................................................... Compiling Modules for Debugging ....................................................2 3..............4........................................................ File System Support .......................9 2.... Floating-Point Support ............................4................. Interrupts ............................................................................5........ ISR Stack Protection .............. Hardware Breakpoint . Configuring the VxWorks Simulator ...........................3.... ................................................................................. 64-Bit Windows Hosts .......................... 4......................... Timestamp Driver .................................4......................5 64-Bit VxWorks Simulation ...................3......2................ 5................................................................................ Using a Telnet Client to Display the Simulator Console ..........2 Creating a 64-Bit Image ..................................................................3 4... 5.................................................................................................................................................................................................... Virtual Memory Address Space (32-Bit VxWorks Simulator) .........2 4.......3...................................................................................................3........3........................................... Full Network Simulation: simnet ............................. 4............................................................... Starting the Network Daemon as a Service . Managing the WRTAP Driver on Windows Hosts ....... Virtual Disk Support ....................... Linux Hosts .3....................... Memory Protection Level ...... Shared Memory Network .1 5............................................. Non-Volatile RAM Support ..........................................5...................................................................................... 34 35 35 35 36 37 37 37 38 39 39 39 40 40 40 42 43 44 44 45 45 45 Configuring Hardware Simulation ............................................................................................................. Virtual Memory Address Space (64-Bit VxWorks Simulator) ..........1 Creating an SMP Image .........................................................................1 4......... Network Daemon Debug Shell .... Large Code Model .. 47 47 48 48 50 51 55 57 57 59 63 64 65 66 66 67 v ..................3 Installing the Host Connection Driver .............4 4.........................................3.............................................1 4....................... 5 Networking with the VxWorks Simulator ..............4 Using VxWorks SMP with the VxWorks Simulator ............................................................................ Solaris Hosts .2...................................................................................................................................... Timers ........7 Migrating Applications to a Hardware-Based System .................................................... Serial Line Support ....... Setting Up the Network Daemon .............. 4.................................................................................................................................................................................................... 5.......................................................................................... 4........Contents Physical Memory Address Space ................................................................ Starting the Network Daemon from the Command Line ..................................... User Shared Memory .1 5...........................3.....................................5...............................3 Miscellaneous Configuration ............... 4............6 4........................................................................... Standard I/O . Creating a Network Daemon Configuration File .........................................................2 Building Network Simulations ........................ 32-Bit Windows Hosts ...........................3................................................................................................................... 4.................. Removing the Network Daemon Service ................8 Pass-Through File System (passFS) ......................................6 4.......................................................7 4. 4.........................3 4............5 4...........2 Introduction ..2..............2.......... .................................1 6............ 6........ 6... Windows Hosts ..............................2....... 6. Start a Simulator Instance on Each Host ................................2 6...............2........2....................2 6.......4 6........................................................................4 Networking Across Multiple Hosts with wrnetdlink .................................................................3.3 5........... Overriding Default Redirections ......2 Configure the Network ................................................................. Network Redirection: simnet_nat .......... 6.....3 6.4 Listing Network Redirections .......................... Creating a Dynamic Configuration Using the vxsimnetd Shell ........................ 6 Networking Tutorials .....4............ 6.......................... 6......... Connect the Simulated Subnets Using wrnetdlink ....................................3 Set Up the Network Daemon .....................................................5 5............................3......1 6........1 6...........................................5 Adding a VxWorks Simulator to a Local Network ..................................................................................................................9 5.......................1 6..........................Wind River VxWorks Simulator User's Guide..........................2 Introduction ........2.........................3........................ 5..................................................4 Configuring a Simulated Subnet .....3 Configuring a Subnet Across Multiple Hosts Using wrnetdlink .............................................................................................................................................4.............. 5.............................................1 6...... Simple Simulated Network ...5 Set Up the Network Daemon on Each Host .............. Configure a VxWorks Image on Each Host ............. From Workbench ......................5................................................................................... Limitations ........................................ 75 75 76 76 77 79 79 80 86 89 89 90 92 92 93 93 93 94 95 95 97 97 98 Basic Simulated Network with Multiple Simulators ............................................................. Test the Simulated Network ........6............. Linux Hosts ..................2 Adding a Network Redirection .............................................................................3.. 6........................................................................6......................................................................1 Using Default Redirections .............4............................................... vi ....................................6 IPv6 Tutorial ....... Configuring VxWorks with IPv6 Components .................................... Test the Simulated Network ......................4.........5. Configuring a Bridge .. 5.........3......................................... Starting a Simulator Instance with Multiple Network Interfaces ..... 68 68 69 69 71 71 72 72 72 73 73 74 5.....................................4.............................................................. 6...................3 6.. Start a VxWorks Simulator Instance ....................................................................... From the Command Line ..............2 Creating a Static Configuration ... 6............ Starting a Simulator Instance without an IPv4 Address ........................................ 6.............................................................................................................2 Default Subnet Configuration .2.......................3............................................1 6.................................................................................. ...................................4.... 105 Tutorial: Simulating AMP ............................................... 120 Tutorials and Examples .2..............................................................................................................3 Testing the IPv6 Connection .....................................4..................... 112 7...........................1 A.............................. Start the VxWorks Simulator Instances ....................3 A............................................6 7...1 7...........5..2 Create and Build VxWorks Image Projects for Simulating Secondary CPUs 109 Workbench .......2................................ 108 7.......... 120 Code Sample ...2............................................................................. 114 Configure MND Devices and Confirm Connectivity ....................... 119 Simulating interrupts From a User Application (Windows Only) .............................................................. 119 Configuring a Host Device to Generate interrupts (UNIX Only) ..................................................2 Controlling a Host Serial Device ................................................................. 121 Running The Code ... 118 Loading a Host-Based Application .......... 112 Command Line ... 109 Command Line ..................................6.............................7 Start the VxWorks Simulation of a Secondary CPU ....................................................................................................... 114 A Accessing Host Resources .............. 118 Host Application Interface (vxsimapi) .4 Introduction .............2.................. 106 Command Line .............................................................................................................................................................2 A................................ 105 7............... 105 7........... 99 99 99 7 Tutorial: Simulating VxWorks AMP .............2 Introduction .......................................................................................4 7.................................................................................. 110 7..................................................................................3 A.................. 113 Run the MIPC Demo Application ..................................................................................... 122 A............................................2............................................................................. 120 A.......................................................................... 117 A....................................... 117 Accessing Host OS Routines .............2 A.............................. 122 vii ..................................................... 118 A........................... 112 Workbench .......................................1 A................................................................5..............5 Defining User Exit Hooks ........ 112 Verifying Connectivity Using the mipcShowBus Command ...........2..........................................................................4................Contents Build Your Projects ....3 Start the VxWorks Simulation of the Primary CPU ........................................2................................... 6.....1 Running Tcl on the VxWorks Simulator ......................................5 7..............................1 Create and Build a VxWorks Image Project for Simulating the Primary CPU 106 Workbench ................ ...............2 B...................... 124 Index ....................................................... 6...Wind River VxWorks Simulator User's Guide....................................................................... 123 Simulator Exceptions for Windows .............................................................3 Introduction ....................... 125 viii ............ 123 Simulator Exceptions for UNIX-Based Operating Systems ..1 B........................................................................9 B VxWorks Simulator Exceptions .................................................. 123 B................................. and information on building applications. The goal of this document is to quickly familiarize you with the VxWorks simulator.1 Introduction 1 1.2 Supported Features and Compatibility 2 1. 1 .3 Limitations 3 1. The VxWorks simulator also allows you to set up a simulated target network for developing and testing complex networking applications. and test VxWorks applications on your host system. Later chapters provide more detailed usage information as well as instructions and tutorials for setting up a network of VxWorks simulator instances. run. such as network applications and target and host VxWorks shells. and Windows-based simulators. The early chapters discuss basic configuration information. reducing the need for target hardware during development. This document provides instructions for all supported VxWorks simulator host types including Linux. For external applications needing to interact with a VxWorks target. Solaris. instructions for building a VxWorks image based on the VxWorks simulator BSP. Building these features into a VxWorks simulator image is no different than building them into any VxWorks cross-development environment using a standard board support package (BSP). the capabilities of a VxWorks simulator instance are identical to those of a VxWorks system running on target hardware. The VxWorks simulator allows you to develop.1 Introduction The Wind River VxWorks Simulator is a simulated hardware target for use as a prototyping and test-bed environment for VxWorks.1 Overview 1. A VxWorks simulator instance supports a standard set of VxWorks features. instructions for launching the VxWorks simulator from Wind River Workbench or the command line. and 64-bit hardware platforms ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ For more information on these features. be sure to change forward slashes to backslashes in file paths. on Windows hosts. 6. applications developed for the simulator are fully compatible with VxWorks.9 NOTE: Many examples in this document are provided generically for all hosts. Be sure to modify the generic examples to suit your host platform.2. In addition. For example.Wind River VxWorks Simulator User's Guide. 2 . see the VxWorks Kernel Programmer’s Guide. 1. These examples are typically provided in UNIX syntax.2 Supported Features and Compatibility The VxWorks simulator supports most VxWorks features available on target hardware and also provides support for a number of simulated hardware devices.1 VxWorks Feature Support Applications developed using the VxWorks simulator can take advantage of the following VxWorks features: ■ Error Detection and Reporting ISR Stack Protection (Solaris and Linux hosts only) MIPC Overlapped Memory Real-Time Processes (RTPs) ROMFS Shared Data Regions Shared Libraries (Windows and Linux hosts only) VxFusion (distributed message queues) VxMP (shared-memory objects) VxWorks source build (VSB) projects Wind River System Viewer VxWorks Asymmetric Multiprocessing (AMP) Support for 32. 1. 2 Simulated Hardware Support To support application development.3 Configuring and Building a VxWorks Image.1 Overview 1. For this reason. non-volatile RAM (NVRAM) virtual disk support—Virtual disk support allows you to simulate a disk block device. this can also be used to improve SMP simulation. a timestamp driver a real-time clock symmetric multiprocessing (SMP) environment asynchronous multiprocessing (AMP) environment ■ ■ ■ ■ ■ ■ ■ ■ For information on including support for these simulated hardware features in your VxWorks image. p.37.6. the VxWorks simulator provides simulated hardware support for the following hardware-related features: ■ a VxWorks console a system timer a memory management unit (MMU)—MMU support is required to take advantage of the VxWorks real-time process (RTP) feature.3 Configuring Hardware Simulation. 3 .3 Limitations The VxWorks simulator is not suitable for all prototyping needs. However. see 2. The simulated disk block device can then be used with any file system supported by VxWorks.2. the VxWorks simulator includes MMU support and implements the architecture-specific part of a memory management unit in order to provide the same level of feature support as hardware-based targets. see 4. SMP SMP simulation using the VxWorks simulator is more accurate if the host machine provides multiple CPU cores. 1. Solaris is not supported as a host OS for the 64-bit VxWorks simulator. For more information on hardware simulation. 64-Bit VxWorks The 64-bit VxWorks simulator is supported on 64-bit host operating systems only. NOTE: If your host system supports hyperthreading. p.3 Limitations 1. the VxWorks simulator is not a suitable basis on which to develop hardware device drivers. The VxWorks simulator executes on the host machine and does not attempt the simulation of machine-level instructions for a target architecture. 9 4 . 6.Wind River VxWorks Simulator User's Guide. 1 Introduction This chapter briefly describes how to set up and configure standard features in a VxWorks image for use with the VxWorks simulator. It also includes instructions for launching the VxWorks simulator from your development environment. and the user’s guide for your Platform product. no additional resources are required.2 Getting Started 2.1 Introduction 5 2.3 Configuring and Building a VxWorks Image 6 2.2 System Requirements Host system requirements for the VxWorks simulator are the same as those of a standard VxWorks installation.2 System Requirements 5 2. For more information on configuring and building VxWorks. Multiprocessor Simulation Requirements SMP simulations are more accurate if the host machine provides the same number of CPU cores as the hardware target. 5 . see your Platform release notes.4 Launching the VxWorks Simulator 8 2. Wind River Workbench By Example. see the VxWorks Kernel Programmer’s Guide. 2. For information on VxWorks host system requirements. 4. including: ■ basic memory management support (INCLUDE_MMU_BASIC) (See 3. p.21. this section provides configuration information for supported optional components as well as basic instructions for building a VxWorks image.1 Default Configuration Components The VxWorks simulator default configuration includes support for many VxWorks features.3.3 Non-Volatile RAM Support.38.) C++ support error detection and reporting features kernel hardening features (such as text segment write protection) kernel shell (and its C and command interpreters) network stack non-volatile RAM (See 4. 2. Many standard VxWorks features are included in the image by default. you must run the VxWorks simulator on a 64-bit host. Solaris is not supported as a host OS for 64-bit simulation.3. Your 64-bit host operating system must be a supported version of Windows or Linux. In addition to a list of default configuration components. Using the VxWorks Simulator. 2. see the VxWorks Kernel Programmer’s Guide and the VxWorks Application Programmer’s Guide.) POSIX support (limited support in default configuration) real-time process (RTP) support ROM-based file system (ROMFS) shared libraries and shared data regions spy (task monitoring) virtual disk support (See 4. p.39. For information on using these features with the VxWorks simulator. 6. 6 .9 64-Bit Support To simulate 64-bit VxWorks.3. see 4.3 Configuring and Building a VxWorks Image The default configuration file included in the VxWorks simulator BSP produces a full-featured VxWorks image. p.Wind River VxWorks Simulator User's Guide.1 Memory Management Unit.) Wind River System Viewer ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ For more information on these features.2 Virtual Disk Support. To tune the shared memory size allocated for VxMP (default: 8 KB).st (standalone VxWorks). the macro INCLUDE_SM_NET must be defined in the BSP configuration.3. For VxWorks 6. To take advantage of these features. To include smEnd driver support. you can choose the network device in either of the following ways: ■ through the Target Connection Properties on the Network Options tab through the command-line options (-d or -ni). p. To build a default VxWorks image.1 vxsim Configuration Options. create a VxWorks image project as described in the user’s guide for your Platform. To include support for this feature. For more information on building and configuring a VxWorks image. To define the smEnd driver IP address. p. VxMP The VxWorks simulator optionally supports the multiprocessor capabilities available using the VxWorks VxMP feature.3. use the SM_MEM_SIZE parameter.9 connections. and INCLUDE_SM_OBJ components in your VxWorks image.3 Building Your VxWorks Image The process for configuring and building a VxWorks image is the same for the VxWorks simulator as it is for target hardware. Shared Memory END Driver The VxWorks simulator optionally includes shared memory END driver support (smEnd). use the following VxWorks simulator command-line option: % vxsim -b backplaneAddress or: % vxsim -backplane backplaneAddress 2.4. ■ For more information on these options. Your VxWorks image can be built using either the Wind River Diab Compiler or the Wind River GNU Compiler. However. Otherwise. the BSP makefile builds only the images vxWorks and vxWorks.8.3 Configuring and Building a VxWorks Image NOTE: Networking for the VxWorks simulator is configured by default. The VxWorks simulator BSP is comparable to a standard VxWorks BSP for a hardware target architecture and uses a standard VxWorks Makefile.2 Getting Started 2. the network is only automatically enabled if a network device (simnet or simnet_nat) is enabled. 2. change the SM_OBJ_MEM_SIZE parameter. see 2. you must include the INCLUDE_SM_COMMON. Workbench does this by default.2 Configuring Optional Components The VxWorks simulator provides optional support for the following VxWorks features. However. Base your project on the appropriate 7 . To modify the shared memory pool size assigned to shared objects. INCLUDE_BOOT_LINE_INIT.3. you must configure and build a new VxWorks image for the VxWorks simulator. see 2.3 Building Your VxWorks Image.7. 1 vxsim Configuration Options The vxsim executable provides the equivalent functionality of a boot load program. For more information on VSB projects. see the user’s guide for your Platform product.4.9 VxWorks simulator BSP for your host type. see the VxWorks Kernel Programmer’s Guide: VxWorks Configuration. your path environment variable must include /usr/openwin/bin so that your host can locate xterm. Table 2-1 lists the available simulator BSPs.4 Launching the VxWorks Simulator This section provides information on launching the VxWorks simulator from your development environment. p. However.33. see 4. If xterm is not in your path. you must use the bootChange( ) routine.4 VxWorks Source Build (VSB) Projects The process for configuring and building VSB projects is the same for the VxWorks simulator as it is for target hardware. NOTE: To preserve boot line parameters after a reboot. This routine is executed in the kernel shell. For more information on building a VxWorks image project using vxprj. 2.1 Boot Parameters. Table 2-1 VxWorks Simulator BSPs Host Type BSP Name Windows Solaris Linux simpc solaris linux You can also build a VxWorks image project from the command line using the command-line project facility. 8 . You can use vxsim to load an image from the VxWorks simulator BSP directory. The command-line interface also supports additional convenience options that let you handle things such as configuring multiple interfaces for the VxWorks simulator instance. NOTE: On Solaris simulators.2.3. 2. 6. The vxsim utility supports a set of command-line configuration options that you can use to specify the boot line parameters for the image that will be loaded. For more information. Use vxsim -help to see a complete list of supported options. your VxWorks simulator connection will fail. you cannot build or customize vxsim as you can other boot loaders.Wind River VxWorks Simulator User's Guide. vxprj. 2. in the current directory is loaded.72. -add_nat_redir networkRedirection -anr -backplane inetOnBackplane -b inetOnBackplane -device bootDevice -d bootDevice -ethernet inetOnEthernet -e inetOnEthernet -exitOnError -file fileName -f fileName -flags flags -gateway gatewayInet -g gatewayInet -help -hostinet hostInet -h hostInet -hostname hostName -hn hostName -kill processNumber -k processNumber 9 . Upon error.2 Getting Started 2. If no file is specified. The type of device to boot from: passDev. Kills the VxWorks simulator referenced by processNumber. exit the VxWorks simulator without prompting for user input.45. the vxWorks file.2 Adding a Network Redirection. For a discussion of its usage and an explanation of its optional parameters. The file containing the VxWorks image to load. The host machine to boot from.[nokill] Launches an instance of the VxWorks simulator that makes its console available over a Telnet server. On a UNIX system. The default is 0. the default value is always the actual host name. Print a help message listing the command-line options. see 5. The host Internet address. if any. p. p. or simnet_nat. For details on the syntax and usage of this option. The Internet address of the gateway. The Internet address to assign to the target system (the boot interface). The default is passDeva. The backplane address of the target system.7 Using a Telnet Client to Display the Simulator Console. The default value for this option on a Windows system is host. see 4. Configuration flags.3. Add a NAT network redirection. simnet.4 Launching the VxWorks Simulator Table 2-2 Command-Line Options for the VxWorks Simulator VxWorks Simulator Option Description -add_dev serial0=telnet:[portNumber]: [nowait]. you need to use -list_dev with the -l option. Allows a VxWorks simulator image configured with n CPUs to run with 1 to n CPUs. the port number is displayed on the standard output. clear the log file used by a previous instance. The user’s password (for FTP only).b The VxWorks simulator non-volatile RAM file.txt -list_dev serial0 % vxsim. p. This allows you to start an instance of the VxWorks simulator. For more information on the usage of the -list_dev option.-l logfile. 6. see 4. This writes the port number to the log file specified with -l.. with no -l option..txt -lc The first example. Unused. Limits the number of CPUs to n.9 Table 2-2 Command-Line Options for the VxWorks Simulator (cont’d) VxWorks Simulator Option Description -list_dev serial0 -list_dev all In the current release. Sets the processor number. On UNIX. and write new data to it. Examples: % vxsim. only applies to UNIX. VxWorks simulator additional network interfaces.-l list_dev all -p 3 -l logfile..-list_dev serial0 % vxsim.7 Using a Telnet Client to Display the Simulator Console. Clears the log file specified by the -l option. both forms of the option are equivalent. When the simulator reboots.. the VxWorks simulator is not a console application. Currently. and simulator output is not displayed on the standard output. To obtain the port number.Wind River VxWorks Simulator User's Guide. the log file is also cleared...45. which is effectively an identifier for this simulator instance. The default value is 0. Enables output logging. -list_nat_redir -lnr -logclean -lc List all NAT network redirections. -logfile logFile -l logFile -ncpu n -netif additionalInterface -ni additionalInterface -nvram pathToFileForNvram -n -other other -o other -password ftpPassword -pw ftpPassword -processor number -p number 10 . because only a serial device used for displaying the console over Telnet is supported. available for applications. On Windows. this option provides the port number used by the Telnet server for the current instance of the VxWorks simulator (see the table entry for the -add_dev option). Specifying simnet or simnet_nat for this option indicates that a simulated boot device should be initialized. the -ni option) are not available as specific options in the New Connection wizard dialogs. the tutorial in 6. The directory for temporary VxWorks simulator files. For an actual hardware target. or integer. passDev is used as the boot device type. A startup script for the kernel shell. Certain options (for example. the default is /tmp. Print the VxWorks simulator version. this option is used to specify the device that is used to access the VxWorks image. The default is 32 MB. Also see the entries for the NAT-related options -add_nat_redir and -list_nat_redir. The user name used to access the host. on a Solaris or Linux system. In all other cases.2 Getting Started 2.3 Basic Simulated Network with Multiple Simulators. 11 . This option is not supported for the 64-bit VxWorks simulator. vxsimCpuNum for all other instances. the command-line options listed in Table 2-2 are configured using the New Connection wizard. The default value is max (1). For example. use vxsim -ni "simnet" in place of vxsim -ni simnet. Because the VxWorks simulator always accesses the VxWorks image from the host file system. The default is 0. This option is not supported for the 64-bit VxWorks simulator. The default value is vxsim for the vxsim0 instance.79 uses the passDev option for the simulated router and the simnet option for each of the simulated network devices. The default on a Windows system is the TEMP environment variable value. NOTE: When issuing these command options using the vxsim command from the command line on a Linux or Solaris host. Specifies the VxWorks virtual memory size. p. The name of the target. -unit unitNumber -user user -username user -vaddr address -vsize virtualSize -version -v a. max (1).x Simulator Connection). The VxWorks simulator memory size in bytes. For example. b. These options can be passed directly to the VxWorks simulator using the Other VxWorks Simulator Options field of the VxWorks Simulator Miscellaneous Options dialog. When launching your VxWorks simulator from Workbench (Target > New Connection > Wind River VxWorks 6. The network device unit number (for the boot interface).4 Launching the VxWorks Simulator Table 2-2 Command-Line Options for the VxWorks Simulator (cont’d) VxWorks Simulator Option Description -prot-level protectionLevel -pl protectionLevel -size memorySize -memsize memorySize -startup script -s script -targetname targetName -tn targetName -tmpdir directory Sets the VxWorks simulator memory protection level. this field is used to mimic real target behavior. use double quotation marks around the option values. Specifies the VxWorks virtual base address. Possible values include min (0). The default is 1 GB. NOTE: You must use the bootChange( ) routine in order to make boot-parameter changes that survive a reboot. For the 64-bit VxWorks simulator. see the user’s guide for your Platform product. To change the font used in the console.4. Figure 2-1 Simulator Console 12 . Even if non-volatile RAM support is included. use the vxsim command in the VxWorks Development Shell. type the following in the VxWorks Development Shell: -> vxsim -f pathToVxWorksImage If you run vxsim from the directory containing the VxWorks image that you want to load. To start a VxWorks simulator using the default configuration values. For example. Using this command is similar to using a boot program to load an image. Figure 2-1 shows the simulator console in Windows with the right-click menu open. you can type the following: -> vxsim If your path does not include vxsim.9 2. For more information. use the same command-line sequences as for 32-bit simulation. As options. boot parameters will be lost once the simulator is exited because boot parameters are derived from the VxWorks simulator command line. 6.Wind River VxWorks Simulator User's Guide. right-click the top bar and select Font in the resulting menu. Modifying the Windows Simulator Console Appearance When you launch a VxWorks simulator instance on a Windows host.2 Launching a VxWorks Simulator Instance from the Command Line To start a VxWorks simulator instance from the command line. the target server launches a console connected to the target. vxsim lets you specify values for the parameters typically supplied in a boot line (use vxsim -help to list the option descriptions). ensure that your VxWorks environment is properly set. 200. For more information on 13 .4 Launching the VxWorks Simulator Starting an Instance with Network Redirection (NAT) The VxWorks simulator provides a user-mode network stack that acts as a bridge between the guest network stack and the host network stack. (For more information.50. A VxWorks simulator instance can also be configured with multiple network interfaces (a router configuration) using the -ni option. the default value of 0 is applied. see 5. you need only concern yourself with those devices related to the network interface— specifically. Unlike the network-redirection method. without the need for a specific network driver.168. you can specify simnet as the boot device and its IP address using the -e parameter. Starting an Instance to Run on a Simulated Subnet In addition to network redirection.168. select simnet_nat as your boot device.200.200.1 % vxsim -d simnet -e 192. SUBNET_EXTPROMISC = yes.168.168. you must start the simulator network daemon before starting a VxWorks simulator instance.3 Network Redirection: simnet_nat. see 5. SUBNET_ADDRESS = "192. the default value of 0 is applied. the -p parameter assigns the value 1 as a “processor” number to the second VxWorks simulator instance. it acts as a firewall and does not permit any incoming traffic.) On the whole. the Wind River VxWorks Simulator also provides a full network simulation environment through the VxWorks simulator network daemon. for example. the simnet device—and its address information (IP address and network mask). For more information on network redirection. the port must be explicitly redirected. For example. If you intend to use a simulated subnet in this way.2 Getting Started 2. If you do not specify a -p number. the following command sequences start two VxWorks simulator instances using the default redirection: % vxsim -d simnet_nat % vxsim -d simnet_nat -p 1 In the second command sequence above. the -p parameter assigns the value 1 as a “processor” number to the second VxWorks simulator instance.2 -p 1 Assuming the following default subnet: SUBNET_START default { SUBNET_EXTERNAL = yes. If you do not specify a -p number. p. the daemon allows various protocol and subnet configurations.71. If you want to access a guest UDP/TCP port. The two vxsim commands above start two VxWorks simulator instances that attach to the default subnet 192. It also does not support protocols other than TCP and UDP.2 Setting Up the Network Daemon. For example: % vxsim -d simnet -e 192.0. But by default. If a simulator requires only a single interface. including the Internet. This type of connection does allow access to network resources.0". Therefore. In the second vxsim command. }. To use this kind of simulation.200.2. p. ping and other ICMP utilities do not work with this type of connection. Click Next.2 Full Network Simulation: simnet.78. the simulator console is displayed within Workbench. For more information on setting up a simulated network. To make the connection. to launch the New Connection wizard. see 5. you can connect to the instance from Workbench just as you would connect to a standard target.4 Connecting to an Existing Simulator Instance from Workbench If you have an existing VxWorks simulator instance running on your host. By default. specify the backend type for the VxWorks simulator instance you wish to connect to. In the Backend settings area of the Target Server Options window.68. in 6.. Uncheck Enable the integrated Target Console for: VxWorks Simulator Connections. go to: Window > Preferences > Wind River > Target Management > Target Console 2.3 Launching the VxWorks Simulator from Workbench You can launch the VxWorks simulator from Workbench. (The default VxWorks simulator uses wdbpipe.48.x folder. 4. Under the VxWorks 6. when you launch the VxWorks simulator from Workbench. 3. p. see Starting a Simulator Instance with Multiple Network Interfaces. select Wind River VxWorks 6. Networking Tutorials.x Target Server Connection. p.4. 5.) Click Finish. you can change the default and display the console in its own window. 6. However.Wind River VxWorks Simulator User's Guide. 14 . p. In Workbench. (The host name for the default VxWorks simulator is VxSim0. 2. For step-by-step instructions. In Workbench. To do this: 1.9 this configuration.. You should now see the connection in the Remote Systems list. select Target > New Connection. specify the host name or IP address for the VxWorks simulator instance you wish to connect to. see Start the Simulator Instance from Workbench.4. 2. do the following: 1.) In the same window. 2. On Solaris and Linux systems. If you wish to use this option. edit /etc/sysconfig/network and add the following line: FORWARD_IPV4=yes Then.1. To programmatically exit the VxWorks simulator (which may be useful for scripting). run the following with root permissions: $ # echo "1" > /proc/sys/net/ipv4/ip_forward or. you can exit the VxWorks simulator by closing the VxWorks simulator window. 15 . you can reboot the VxWorks simulator by typing Ctrl+X in the VxWorks simulator console window.4. Enable IP forwarding on the host that will be running the VxWorks simulator instance.2 Getting Started 2. however.4 Launching the VxWorks Simulator 2. and the host has the IP address 10. 1.1 -p 12345 With Full Network Simulation (simnet) When you use full network simulation through the simnet device. according to whether you are using network redirection (simnet_nat) or full network simulation (simnet). you must start the VxWorks simulator with the -exitOnError option. you would use the following sequence to connect on the VxWorks simulator telnet server: telnet 10. To reach the simulator from another host. start the Routing and Remote Access service.4. 2. run the following with root permissions: # # ndd -set /dev/tcp ip_forwarding 1 ■ ■ On Linux hosts. you can reboot (BOOT_NO_AUTOBOOT). restart the host. For example. follow the steps below. NOTE: Issuing the exit command in the kernel shell terminates the shell session only and cannot be used to exit the VxWorks simulator. The approach differs. On Windows systems. the simulated subnet is only visible on the host that is running the network daemon and the simulator. the VxWorks simulator instance can be reached through the host it is running on.10. 2. Start a VxWorks simulator instance on an external subnet. if VxWorks telnet port 23 is redirected to host port 12345.10.10. you must type Ctrl+\ in the VxWorks simulator console window to exit.6 Accessing the VxWorks Simulator from a Remote Host You can access a VxWorks simulator target from a remote host (a host other than the one running the VxWorks simulator instance). ■ On Windows hosts.5 Rebooting and Exiting the VxWorks Simulator As with other targets.10. On Solaris hosts. With Network Redirection (simnet_nat) When you use network redirection through the simnet_nat device. 4.1 -h 90.1.1): % vxsim -d simnet -e 192. specify the route to access the VxWorks simulator instance.0. The gateway is the address of the host running the VxWorks simulator instance on the remote host subnet.1 -g 192.200. On the remote host. Specify the route to access the remote host on the VxWorks simulator instance.0. The gateway is the address of the host running the VxWorks simulator instance on the simulated subnet (subnetAddress.254).Wind River VxWorks Simulator User's Guide.9 3.254 This sets a route that enables the VxWorks simulator instance to send a packet to any host reachable from 90.168.0. 6.0. You can now connect to the VxWorks simulator instance from the remote host.168.0. Note that this can be done using VxWorks simulator boot parameters as follows (this example assumes the IP address of the host running the VxWorks simulator instance is 90. 16 .0.200. 3.2 The VxWorks Simulator BSP 17 3.1 Introduction This chapter discusses the differences between the VxWorks simulator development environment and the standard VxWorks development environment.and 64-bit systems. which are not available for 64-bit systems.3 Building Applications 18 3.2 The VxWorks Simulator BSP Aside from the exceptions noted in this section.4 Interface Variations 21 3.5 Architecture Considerations 24 3. In general. the VxWorks simulator BSP is almost identical. with the exception of -vaddr and -vsize. the VxWorks simulator environment differs very little from the development environment for any other target hardware system. 17 . It uses the same command-line options for both.1 Introduction 17 3. The most notable differences are the networking methods. For both 32. which are discussed in 5.3 Introduction to the VxWorks Simulator Environment 3. the VxWorks simulator BSP is similar to any other VxWorks BSP for a target hardware board and provides similar functionality. which are discussed in the following sections. and variations in the VxWorks simulator BSP and architecture behavior. Networking with the VxWorks Simulator. h. and sysClkConnect( ) through sysNvRamSet( ). sysHwInit( ). if you wish to customize your build. For more information on sysLib. you may need the information in the following sections.9 sysLib.c (or unixSio. 3.c. config. to define compiler options for a specific build target.c module contains the same essential routines: sysModel( ). However.st (standalone) images.Wind River VxWorks Simulator User's Guide. but follows the usual loading model.c The sysLib. 3. it is stored in the variable sysBootLine in sysLib. The CPU variable ensures that VxWorks and your applications are compiled with the appropriate features enabled.c can also be extended to emulate the eventual target hardware more completely. However. The final linking does not arrange for the TEXT segment to be loaded at a fixed area in RAM. Standard I/O The file winSio. is minimal: ■ It does not reference a bspname. CPU and TOOL. it does not build boot ROM images (although the makefile rules remain intact). it supports all of the functionality provided by tyLib. However. because there is no bus.c. ■ Makefile The VxWorks simulator Makefile is similar to the standard version used for VxWorks target hardware BSPs.c.1 Defining Compiler Options The build mechanism for the VxWorks simulator uses two preprocessor constants. 6.c for Linux and Solaris systems) ultimately calls the host OS read( ) and write( ) routines on the standard input and output for the process. The boot line has no fixed memory location. Nevertheless.h file.3 Building Applications Wind River highly recommends that you build VxWorks simulator modules using the vxprj command-line facility or Wind River Workbench. config.3. sysBusToLocalAdrs( ) and related routines have no effect in the VxWorks simulator environment. The BSP file sysLib. it can only build vxWorks and vxWorks. The TOOL variable defines the toolchain to use for compiling and linking modules. The makefile macro MACH_EXTRA is provided so that users can easily link their application modules into the VxWorks image if they are using manual build methods. 18 . see the VxWorks BSP Developer’s Guide: Overview of a BSP.h The configuration header file. Instead. the Intel C++ Compiler is ■ ■ supported as an application compiler only. except for modules that require C++ support. Table 3-1 VxWorks Simulator Compiler Options CPU Definition Host (Run Type) TOOL Variable Value Compiler Command-Line Options -tX86LH:vxworks65 -DCPU=SIMNT -mcpu=i486 -march=i486 -DCPU=SIMNT -mtune=i486 -march=i486 -DCPU=SIMNT -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer -tX86LH:vxworks65 -DCPU=SIMLINUX -mcpu=i486 -march=i486 -DCPU=SIMLINUX -mcpu=i486 -march=i486 -DCPU=SIMLINUX -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer SIMNT Windows (kernel) diab gnu icc 64-bit Windows (kernel) gnu icc SIMLINUX Linux (kernel) diab gnu icc 64-bit Linux (kernel) gnu icc 19 . the VxWorks kernel continues to be built with the GNU compiler. NOTE: Modules built with diab. see the compiler documentation for Pentium (Windows and Linux hosts) or SPARC (Solaris hosts). or icc can be linked together in any combination.3 Introduction to the VxWorks Simulator Environment 3. define TOOL as gnu. To build modules using the Intel C++ Compiler. It also provides sample command-line options specific to the VxWorks simulator architecture. Applications for the VxWorks simulator can be built to run in either the VxWorks kernel or a VxWorks RTP. gnu. To build modules using the Wind River Diab Compiler.3 Building Applications VxWorks simulator modules can be built with any of these compilers: ■ the Wind River Diab Compiler the GNU compiler the Intel C++ Compiler for VxWorks NOTE: For this release of the VxWorks simulator. Cross-linking of C++ modules is not supported in this release. Table 3-1 lists the available CPU and TOOL definitions for the VxWorks simulator. define TOOL as diab. You can use icc to compile kernel modules (DKMs) and RTPs. For more information on the available compiler options. define TOOL as icc. To build modules using the GNU compiler. value = 0 = 0x0 For information on available compiler options. you should use the same compiler as the Intel Architecture. use the following command-line option when you invoke the compiler: -DCPU=SIMPENTIUM On all hosts. 3.2 Compiling Modules for Debugging To compile C and C++ modules for debugging.3. see the Wind River Compiler for x86 User's Guide or the Wind River Compiler for SPARC User's Guide. you will get a load error. If you are compiling for the Solaris VxWorks simulator. you must use the -g flag to generate debug information.9 Table 3-1 VxWorks Simulator Compiler Options (cont’d) CPU Definition Host (Run Type) TOOL Variable Value Compiler Command-Line Options -tSPARCFH:vxworks65 -DCPU=SIMSPARCSOLARIS -DCPU=SIMSPARCSOLARIS -tSPARCFH:rtpsim -DCPU=SIMSPARCSOLARIS -mrtp -DCPU=SIMSPARCSOLARIS -tX86LH:rtpsim -DCPU=SIMPENTIUM -mcpu=i486 -march=i486 -DCPU=SIMPENTIUM -mcpu=i486 -march=i486 -DCPU=SIMPENTIUM -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer SIMSPARCSOLARIS Solaris (kernel) diab gnu Solaris (RTP) diab gnu SIMPENTIUM Windows and Linux (RTP) diab gnu icc 64-bit Windows and Linux (RTP) gnu icc For example. you must compile for the SPARC architecture.cpp 20 . if you attempt to load a PPC32 ELF image from the kernel shell: % ld < host:C:/WindRiver/workspace/PPC_ELF. Your VxWorks installation also includes a VxWorks simulator binary for each supported host system. An example command-line sequence for the Wind River Diab Compiler is as follows: % dcc -tX86LH:vxworks65 -DCPU=SIMNT -IinstallDir/target/h -g test. For example. 6. the VxWorks simulator uses ELF object module format (OMF). You can use this binary as a boot loader for a VxWorks image that you can configure and build using exactly the same compiler options you use to build a VxWorks image for a hardware target architecture.out ld(): error loading file (errno = 0x610001). Thus. to specify the CPU value for an application that will run in an RTP on a Windows (or Linux) host.Wind River VxWorks Simulator User's Guide. if you are compiling a VxWorks image for a Linux or Windows VxWorks simulator. If you attempt to load an ELF image for another architecture onto a VxWorks simulator. routines. Alternatively. replace routines with in-line code.4 Interface Variations In this example. users may choose to debug applications without using compiler optimization. 3. To compile without optimization using the Wind River Diab Compiler. expand loops. compile without the -XO option or use the -Xno-optimized-debug option. and tools discussed in the following sections. To compile without optimization using the GNU compiler.4 Interface Variations This section describes particular functions and tools that are specific to VxWorks simulator targets in any of the following ways: ■ available only for VxWorks simulator targets parameters specific to VxWorks simulator targets special restrictions on. and perform other code modifications during optimization. or characteristics of.cpp An equivalent example for the Intel C++ Compiler for VxWorks is as follows: % icc -mtune=i486 -march=i486 -g -DCPU=SIMNT -IinstallDir/target/h test.3 Introduction to the VxWorks Simulator Environment 3. 3. Users are advised to be aware of these possibilities when attempting to debug optimized code.4.o An equivalent example for the GNU compiler for 64-bit VxWorks is as follows: % ccpentium -m64 -mcmodel=large -mno-red-zone -fno-implicit-fp -fno-omit-frame-pointer-IinstallDir/target/h -g test.c -o test. such as breakpoints that are never hit or an inability to set breakpoints at some locations. making it difficult to correlate a given source line to a particular point in the object code. installDir is the location of your VxWorks tree and -DCPU specifies the CPU type. This is because the compiler may re-order instructions. An equivalent example for the Wind River GNU Compiler is as follows: % ccpentium -mcpu=i486 -march=i486 -DCPU=SIMNT -IinstallDir/target/h -g test.1 Memory Management Unit This section describes the memory management unit implementation for the VxWorks simulator and how it varies from the standard VxWorks MMU implementation. see the reference entries for the libraries.cpp NOTE: Debugging code compiled with optimization is likely to produce unexpected behavior. Simulation The VxWorks simulator provides a simulated hardware memory management unit. The simulated MMU provides features comparable to those found on typical 21 . VxWorks simulator targets ■ ■ For complete documentation. compile without a -O option or use the -O0 option. 9 hardware MMUs. 22 . The simulation uses features provided by the host operating system to map. To run the VxWorks simulator without an MMU. This data structure is made up of configuration constants for each page or group of pages. the following additional constants are supported: ■ VM_STATE_CACHEABLE_NOT VM_STATE_WRITEABLE VM_STATE_WRITEABLE_NOT VM_STATE_VALID VM_STATE_VALID_NOT ■ ■ ■ ■ For more information on configuring virtual memory management. see the VxWorks Kernel Programmer's Guide: Memory Management. Use of the VM_STATE_CACHEABLE constant for each page. or group of pages. see the VxWorks Kernel Programmer’s Guide: Memory Management. MMU simulation is provided for all supported host operating systems. and protect pages in memory. Page Size The VxWorks simulator uses a page size that is determined by the memory page mapping routines in the host operating system. unmap. 6. Running the VxWorks Simulator Without MMU Support You can configure the VxWorks simulator to run without an MMU. In addition to VM_STATE_CACHEABLE. On Windows simulators. defined in sysLib. The data structure sysPhysMemDesc[ ]. this page size is 64 KB. Wind River recommends that you change the MMU page size (VM_PAGE_SIZE parameter) in your VxWorks image to 0x1000 (the default value is 0x2000 on Solaris and Linux simulators and 0x10000 on Windows simulators) in order to limit the amount of physical memory required to run your applications. Translation Model All VxWorks simulator implementations share a common programming model for mapping memory pages. sets the cache to copy-back mode.Wind River VxWorks Simulator User's Guide. For more information on how to configure your VxWorks image for this type of operation. Limitations The VxWorks simulator MMU implementation does not provide support for supervisor/user mode.c describes the physical memory address space. this page size is 8 KB. On Solaris and Linux-based simulators. 3. VxWorks simulator sessions lose their target server connections when the host CPU becomes overwhelmed by too many requests. For more information on using passFS with the VxWorks simulator. Virtual Disk Support The VxWorks simulator provides virtual disk support which allows you to simulate a disk block device. p.2 RTP Considerations Because the VxWorks simulator MMU implementation does not support supervisor/user mode.3. it is not possible to prevent a task running in an RTP from writing in the kernel memory space.4. see 4.3. p. you can adjust the back end request timeout (-Bt) and back end request resend number (-Br) parameters from Workbench using the Advanced Target Server Options in your VxWorks Simulator Connection.4 WDB Back End The VxWorks simulator supports the WDB pipe and WDB RPC target agent communication back ends. Pass-Through File System (passFS) By default.5 Connection Timeout Occasionally. on the VxWorks simulator architecture. Therefore.38.37. If you find that your application is frequently losing its target server connection. see the Wind River Workbench By Example: Connecting to VxWorks Targets.3 Introduction to the VxWorks Simulator Environment 3. the WDB pipe back end is used by default. For more information on resolving connection timeouts.3 File System Support This section discusses the file systems supported by the VxWorks simulator. see the VxWorks Kernel Programmer’s Guide.4 Interface Variations 3.4.1 Pass-Through File System (passFS). an RTP task can potentially crash a kernel task. The simulated disk block device can be used to access any file system supported by VxWorks. see 4. 3. the WDB RPC back end can also be used.4.4. 23 . If network support is enabled on your VxWorks simulator target. For more information on file systems. For more information on virtual disk support for the VxWorks simulator. 3.2 Virtual Disk Support. the VxWorks simulator uses a pass-through file system (passFS) to access files directly on the host system. 5 Architecture Considerations This section describes characteristics of the VxWorks simulator architecture that you should be aware of as you write a VxWorks application.5.Wind River VxWorks Simulator User's Guide. The Windows and Linux simulators use a little-endian environment. For 64-bit VxWorks. 3. the following single-precision routines are not available: acosf( ) cielf( ) floorf( ) powf( ) tanf( ) asinf( ) cosf( ) fmodf( ) sinf( ) tanhf( ) atanf( ) expf( ) logf( ) sinhf( ) atan2f( ) fabsf( ) log10f( ) sqrtf( ) 24 .1 Byte Order The Solaris simulator uses a big-endian environment.2 Hardware Breakpoint The VxWorks simulator does not support hardware breakpoints. 6. Windows and Linux simulators use i387 floating-point registers and instructions.3 Floating-Point Support For 32-bit VxWorks. acos( ) cos( ) floor( ) pow( ) tan( ) asin( ) cosh( ) fmod( ) sin( ) tanh( ) atan( ) exp( ) log( ) sinh( ) atan2( ) fabs( ) log10( ) sqrt( ) The following floating-point routines are not available on the VxWorks simulator: cbrt( ) iround( ) trunc( ) iroundf( ) truncf( ) ciel( ) log2( ) cbrtf( ) log2f( ) infinity( ) round( ) infinityf( ) roundf( ) irint( ) sincos( ) irintf( ) sincosf( ) In addition. these simulators use SSE instructions. The following topics are addressed: ■ byte order hardware breakpoint floating-point support ISR stack protection interrupts memory layout ■ ■ ■ ■ ■ 3.5.9 3. 3.5. Furthermore. the VxWorks simulator uses the SIGALRM signal to simulate system clock interrupts.5. see the VxWorks Kernel Programmer’s Guide: Signals. and Watchdog Timers. For the VxWorks simulator. so that the SIGPOLL signal is sent to the VxWorks simulator when data becomes available. The VxWorks simulator does not require ISR stack overflow and underflow protection on Windows simulators because the Windows operating system automatically detects this type of error condition and handles it before VxWorks can take action. use the sysAuxClkxxx( ) routines. 3. For more information on ISR stack protection. You can install ISRs in the VxWorks simulator to handle these interrupts.4 ISR Stack Protection ISR stack overflow and underflow protection is supported on Solaris and Linux simulators. 25 . For more information on how to configure a host device to generate interrupts when data is available. Solaris and Linux Systems On Solaris and Linux simulators.3 Introduction to the VxWorks Simulator Environment 3. For example. To run ISR code during a future system clock interrupt.5. Table 3-2 shows how the Linux and Solaris simulator interrupt vector tables are assigned. To run ISR code during auxiliary clock interrupts.5 Architecture Considerations 3. and Watchdog Timers. ISRs. use the watchdog timer facilities. see A. ISRs. signal handlers provide the equivalent functionality of interrupts available on other target architectures. the hardware interrupt simulation is performed using host signals. see the VxWorks Kernel Programmer's Guide: Signals.5 Interrupts This section discusses interrupt simulation on the VxWorks simulator and how interrupts are handled in the simulator environment. Accessing Host Resources. NOTE: Not all VxWorks routines can be called from ISRs. For more information. all host file descriptors (such as standard input) can be put in asynchronous mode. to install an ISR that logs a message whenever the host signal SIGUSR2 arrives. For example. logMsg. This can be done using the kill command. The ISR (logMsg( ) in this case) runs every time the signal is received. Table 3-3 User-Defined Interrupts (Linux and Solaris Simulators) Signal Solaris Value Linux Value SIGUSR1 SIGUSR2 16 17 10 12 Windows Systems On Windows the VxWorks simulator uses Windows messages to simulate hardware interrupts. execute the following commands: On Solaris: % intConnect (17. VxWorks defines its own values for these constants and those values differ from the host definitions.Wind River VxWorks Simulator User's Guide.. "Help!\n") Next. avoid using the preprocessor constants SIGUSR1 or SIGUSR2. you must specify the host signal numbers explicitly in your VxWorks application code. For example. 6. Therefore. You must connect your interrupt code with the standard VxWorks intConnect( ) mechanism. 288 Host signal 1 User signal 1 User signal 2 Host signal 32 Interrupt vector for host file descriptor 1 (SIGPOLL) Interrupt vector for host file descriptor 256 (SIGPOLL) You can create pseudo-drivers to use these interrupts. logMsg... Only SIGUSR1 and SIGUSR2 can be used to represent user-defined interrupts (see Table 3-3). "Help!\n") On Linux: $ intConnect (12.9 Table 3-2 Interrupt Assignments (Linux and Solaris Simulators) Interrupt Vectors Description 1 .. send the SIGUSR2 signal to the VxWorks simulator from the host. NOTE: In your VxWorks applications. the pipe back end. For the VxWorks simulator. the VxWorks simulator uses messages to simulate interrupts from the network connections. 26 .. 32 33 .. SIGUSR1 SIGUSR2 . and so forth. You can install ISRs in the VxWorks simulator to handle these messages. messages provide the equivalent functionality of interrupts available on other target architectures. use the sysAuxClkxxx( ) routines. see the VxWorks Kernel Programmer's Guide: Signals. the following code installs an ISR that logs a message whenever an auxiliary clock message arrives. For more information on using user interrupts. and Watchdog Timers. the auxiliary clock rate is configured to generate two ticks per second using sysAuxClkRateSet( ) so that the message is logged every 500 ms. Table 3-4 shows how the Windows simulator interrupt vector table is assigned. logMsg. % sysAuxClkRateSet (2) value = 0 = 0x0 % sysAuxClkEnable () value = 0 = 0x0 % intConnect (0x1. see A.3 Introduction to the VxWorks Simulator Environment 3. For example. For more information. To run ISR code during a future system clock interrupt. use the watchdog timer facilities. ISRs.5 Architecture Considerations NOTE: Not all VxWorks routines can be called from ISRs. To run ISR code during auxiliary clock interrupts. Accessing Host Resources. You must connect your interrupt code using the standard VxWorks intConnect( ) mechanism. 27 . "Aux Clock Int!\n") The user interrupt range can be used by the host side user application. In this example. Table 3-4 Interrupt Assignments (Windows Simulators) Interrupt Vectors Description 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006-0x0009 0x0009-0x00ef 0x00f0-0x00ff 0x0100-0x017f 0x180-0x01ff 0x0200-0x02ff system clock interrupt auxiliary clock interrupt timestamp rollover interrupt back end pipe interrupt SIO driver interrupt bus interrupt inter-processor interrupts (IPIs) reserved for internal use Wind River Media Library interrupt range ULIP interrupt range simulated network interrupt range user interrupt range You can create pseudo-drivers to use these interrupts. if network support is included. User Reserved Memory Application-reserved memory. The location depends on the system image size. this memory region is cleared upon reboot. Interrupt Vector Table Table of interrupt vectors. Host Memory Pool Memory allocated by the host tools. however. Interrupt Stack Size is defined by ISR_STACK_SIZE under INCLUDE_KERNEL.6 Memory Layout 32-Bit Simulator The VxWorks memory layout is the same for all 32-bit VxWorks simulators. ED&R Persistent Memory A reboot-safe protected memory region manager. System Image The VxWorks system image itself (three sections: text.Wind River VxWorks Simulator User's Guide. not including user-reserved memory and persistent memory. Its size is configured through the USER_RESERVED_MEM parameter. data. 28 . labeled as follows: Boot Line ASCII string of boot parameters. which includes: – – – – – – the shared memory anchor the shared memory pool the address space for VxMP shared memory objects (if included) or the shared memory TIPC pool (if included) the DSHM pool (if included) the MIPC pool (if included) user shared memory (if included) Networking Address Space Address space for VxWorks simulator full networking (simnet). System Memory Pool Size depends on the size of the system image.9 3. it can be changed using the CLEAR_USER_RESERVED_MEMORY_ON_COLD_BOOT parameter. Figure 3-1 shows the memory layout. By default. The size depends on the WDB_POOL_SIZE macro. and bss). The sysMemTop( ) routine returns the top of VxWorks system RAM. The entry point for VxWorks is at the start of this region. 6.5. Shared Memory Address Space Address space reserved for shared memory. Exception Message ASCII string of the fatal exception message. 3 Introduction to the VxWorks Simulator Environment 3.PM_RESERVED_MEM SM_ANCHOR_ADRS= LOCAL_MEM_LOCAL_ADRS+LOCAL_MEM_SIZE User Reserved Memory (USER_RESERVED_MEM) ED&R Persistent Memory (PM_RESERVED_MEM) Shared Memory Address Space (SM_TOTAL_SIZE) Networking Address Space (SIMNET_MEM_SIZE) SIMNET_MEM_ADRS= SM_MEM_ADRS+SM_TOTAL_SIZE SIMNET_MEM_ADRS + SIMNET_MEM_SIZE 29 .5 Architecture Considerations Figure 3-1 32-Bit VxWorks System Memory Layout (VxWorks Simulator) LOCAL_MEM_LOCAL_ADRS Boot Line (BOOT_LINE_SIZE) Exception Message sysBootLine = BOOT_LINE_ADRS = LOCAL_MEM_LOCAL_ADRS+BOOT_LINE_OFFSET sysExcMsg = EXC_MSG_ADRS = LOCAL_MEM_LOCAL_ADRS+EXC_MSG_OFFSET System Image text data bss RAM_LOW_ADRS = LOCAL_MEM_LOCAL_ADRS+0x10000 _end Host Memory Pool (WDB_POOL_SIZE) _end + WDB_POOL_SIZE System Memory Pool Interrupt Stack (ISR_STACK_SIZE) KEY Available Reserved Interrupt Vector Table intVecBaseGet( ) sysMemTop( )=LOCAL_MEM_LOCAL_ADRS+LOCAL_MEM_SIZE(USER_RESERVED_MEM+PM_RESERVED_MEM) sysMemTop( )=LOCAL_MEM_LOCAL_ADRS+ LOCAL_MEM_SIZE. Wind River VxWorks Simulator User's Guide, 6.9 64-Bit Simulator Figure 3-2 shows the memory layout for the 64-bit VxWorks simulator on 64-bit Windows and Linux hosts. Kernel Virtual Memory Pool Region The kernel virtual memory pool region is the area used for dynamically managed mappings in the kernel. Shared User Virtual Memory Region This is the shared memory region that is used for creating the shared virtual memory pool. It is used to allocate code and data segments of shared libraries. RTP Private Virtual Memory Region This region is added to each RTP’s page manager upon creation. It is used for allocating the RTP’s code segments and private mappings. Kernel System Virtual Memory Region This region includes the following elements: ■ boot line exception message system image user reserved memory ED&R (error detection and recovery) persistent memory ■ ■ ■ ■ 30 3 Introduction to the VxWorks Simulator Environment 3.5 Architecture Considerations Figure 3-2 Default Virtual Memory Layout for the 64-Bit VxWorks Simulator Linux Host 0x1000.0000 Windows Host Unused (~1.5 GB) 0x6000.0000 Unusable Unused (~4.5 GB) 0x1.4000.0000 =0x1.8000.0000 (LOCAL_MEM_LOCAL_ADRS) Kernel system virtual memory region (2 GB) 0x2.0000.0000 Unused (1 GB) Kernel system virtual memory region (2 GB) RTP Private Virtual Memory Region (configurable; default size is 4 GB) VXSIM_RTP_PRIV_RGN_BASE + VXSIM_RTP_RGN_SIZE RTP Private Virtual Memory Region (configurable; default size is 4 GB) Shared User Virtual Memory Region (configurable; default size is 4 GB) VXSIM_RTP_PRIV_RGN_BASE + VXSIM_RTP_RGN_SIZE + VXSIM_SHARED_RGN_SIZE Shared User Virtual Memory Region (configurable; default size is 4 GB) Kernel Virtual Memory Pool Region (configurable; default size is 4 GB) VXSIM_RTP_PRIV_RGN_BASE + VXSIM_RTP_RGN_SIZE + VXSIM_SHARED_RGN_SIZE + VXSIM_KERNEL_VIRT_RGN_SIZE Shared Memory Address Space (SM_TOTAL_SIZE) Networking Address Space (SM_TOTAL_SIZE) Kernel Virtual Memory Pool Region (configurable; default size is 4 GB) Shared Memory Address Space (SM_TOTAL_SIZE) Networking Address Space (SM_TOTAL_SIZE) 31 Wind River VxWorks Simulator User's Guide, 6.9 32 including boot parameter configuration.2 Configuring the VxWorks Simulator 33 4.3 Configuring Hardware Simulation 37 4. and basic guidelines and limitations for migrating your application to a target hardware system. hardware simulation. For more information on general VxWorks configuration.4 Using the VxWorks Simulator 4. see the VxWorks Kernel Programmer’s Guide: VxWorks Configuration.1 Introduction 33 4.1 Boot Parameters Using the command-line interface.2.4 Using VxWorks SMP with the VxWorks Simulator 42 4. 4. 4. you lose 33 . However.5 64-Bit VxWorks Simulation 44 4.1 Introduction This chapter discusses how to use the VxWorks simulator for VxWorks development.7 Using a Telnet Client to Display the Simulator Console 45 4. you can specify all parameters available in the standard VxWorks boot line for a VxWorks simulator target. It includes information on configuration.2 Configuring the VxWorks Simulator This section discusses configuration issues particular to the VxWorks simulator environment.6 Migrating Applications to a Hardware-Based System 45 4. Physical Memory Address Space The VxWorks simulator physical memory address space is defined by the LOCAL_MEM_LOCAL_ADRS and LOCAL_MEM_SIZE parameters in the VxWorks simulator BSP.9 these parameters when you exit the simulator even if you include non-volatile RAM support. 34 .Wind River VxWorks Simulator User's Guide. the new image must be built with the same memory configuration. This occurs because. you can do this in Workbench: in the Remote Systems view. as shown in the following examples. even when the specified boot parameters are saved in a file (nvram. 6. Once the VxWorks simulator starts. the VxWorks simulator physical memory size can be dynamically modified using the VxWorks simulator command-line interface (using the -size or -memsize command-line options). they are only used for a target reboot.2 Memory Configuration The VxWorks simulator displays its memory settings at startup.vxWorkscpuNum) similar to actual hardware target behavior. However. That is.h file must be identical. Alternatively. you can use the VxWorks bootChange( ) routine to modify boot line parameters. 4. Example 4-1 32-Bit VxWorks Virtual Virtual Physical Physical Example 4-2 Base Top Base Top Address: Address: Address: Address: 0x10000000 0x50000000 0x10000000 0x12000000 Virtual Size: 0x40000000 (1024Mb) Physical Size: 0x02000000 (32Mb) 64-Bit VxWorks Virtual Base Address: 0x0000000180000000 Virtual Top Address: 0x0000000500000000 0x0000000380000000 (14Gb) Physical Base Address: 0x0000000180000000 Physical Top Address: 0x0000000188000000 0x0000000008000000 (128Mb) Virtual Size: Physical Size: The following sections discuss the VxWorks simulator memory parameters and describe how the parameters can be modified. NOTE: The LOCAL_MEM_ADRS parameter must be aligned to 1 MB (0x100000) and the LOCAL_MEM_SIZE parameter must be a multiple of 1 MB. However. The VxWorks simulator uses the values that were set for these parameters when you built VxWorks. then use the Memory Options tab to set these options. not when the target is exited or restarted.2. The new parameters are preserved and taken into account on the next reboot. NOTE: The bootChange( ) routine can be used to boot another VxWorks image. the LOCAL_MEM_SIZE and LOCAL_MEM_LOCAL_ADRS macros in the BSP config. right-click the simulator connection and select Properties. Virtual Memory Address Space (32-Bit VxWorks Simulator) For the 32-bit VxWorks simulator. if you modify LOCAL_MEM_ADRS. NOTE: If you decide to modify the virtual memory base address or virtual memory size. the VxWorks simulator virtual base address is 0x10000000 and the VxWorks simulator virtual top address is 0x4FFFFFFF. shared memory is available for your own implementations of inter-process communication. the virtual memory size is 14 GB by default.4000. The default settings for the virtual memory base address and the virtual memory size should work for most host configurations. you may need to use the -vaddr command-line option to set a virtual address value that is coherent with the physical memory address space. the only memory shared among several instances of the simulator was restricted for the use of VxWorks components. the virtual memory size is limited to 1 GB. the VxWorks simulator virtual base address is 0x60000000 and the VxWorks simulator virtual top address is 0x9FFFFFFF. you may need to modify the virtual memory values in order to avoid a conflict between the VxWorks simulator address space and the host system DLL load addresses. then use the Memory Options tab to set these options. On Windows hosts.4 Using the VxWorks Simulator 4. As of this release of the VxWorks simulator. The virtual base address is 0x1. right-click the simulator connection and select Properties. On Solaris and Linux hosts. NOTE: Depending on your host configuration. User Shared Memory In previous releases of VxWorks and the VxWorks simulator. as shown in Figure 3-2. you may obtain less than 1 GB of virtual memory.2 Configuring the VxWorks Simulator NOTE: On the 32-bit VxWorks simulator. go to the Remote Systems view. To do this in Workbench. The default values for the virtual memory base address and the virtual memory size can be overridden using the -vaddr and -vsize command-line options. You can modify this size through the VXSIM_KERNEL_VIRT_POOL_RGN_SIZE and VXSIM_SHARED_RGN_SIZE parameters. you must ensure that the values are coherent with the physical memory address space. However. 35 . Virtual Memory Address Space (64-Bit VxWorks Simulator) For the 64-bit VxWorks simulator.0000. You may also need to decrease the base address in order to get a larger address space. such as MIPC or VxMP. you can view the current size and base address of the area through the sysUserSmInfoGet( ) routine. void ** pAddr ) /* where to return user shared memory size in bytes */ /* where to return user shared memory address */ If user shared memory is not configured in the system.Wind River VxWorks Simulator User's Guide. unpredictable results may occur. ! CAUTION: All VxWorks simulator instances that are connected to shared memory must have the same shared memory configuration. Multiple Simulator Instances The user shared memory area can be shared by one or more VxWorks simulator instances. The size of the user shared memory area must be the same for all VxWorks simulator instances that use it. This level can be set to min. or an intermediate integer value representing a given protection level. NOTE: Currently. 6. The size value is rounded up to the MMU page size. The synopsis for sysUserSmInfoGet( ) is as follows: void sysUserSmInfoGet ( size_t * pSize. 36 . the memory protection is set to the maximum level (max). Memory Protection Level The VxWorks simulator allows you to specify a memory protection level using the -prot-level option. By default. max. in the simulator BSP’s memory folder. see the VxWorks Kernel Programmer’s Guide: Atomic Operators for AMP.9 Creating a User Shared Memory Area To set up this kind of shared memory in your simulator instance. including for the user shared memory area. only one protection level is provided. Getting Information on the User Shared Memory Area Once you have built the VxWorks simulator image and started it. include the INCLUDE_VXSIM_USER_SM configuration component in your VxWorks image. If you use different shared memory configurations for different instances. For more information on VxWorks AMP atomic operators. This component is not included by default. The size of the user shared memory area is configurable. Using SMP atomic operators (the vxAtomicxxx( ) routines) does not guarantee atomicity of the operation. it can be found in the Project Facility. When you include the INCLUDE_VXSIM_USER_SM component. See Table 4-1. use its VXSIM_USER_SM_SIZE parameter to specify the size. In Workbench. this routine returns 0. Using AMP Atomic Operators You can manipulate the shared memory area through direct memory access (DMA) or with the AMP atomic operators (the vxTas( ) and atomic 32xxx( ) routines). The INCLUDE_PASSFS component is included by default and mounts this file system on startup.4 Using the VxWorks Simulator 4. help. and so forth. use the following command-line option: % vxsim -hn hostname or % vxsim -hostname hostname On Linux and Solaris hosts. for backward compatibility with previous releases. passFS is a file-oriented device driver that provides easy access to the host file system. For complete information on all available options. see the API reference entry for vxsim. 37 .3 Configuring Hardware Simulation This section discusses the available hardware simulation options for the VxWorks simulator. 4. On Windows. the default value for the passFS device name is the name of the host on which the simulator is running.2.1 Pass-Through File System (passFS) The default file system for the VxWorks simulator is the pass-through file system (passFS). the default value is host. To specify the passFS device name (the default is your system host name). This file system is unique to the VxWorks simulator.3. version. 4.3 Miscellaneous Configuration The VxWorks simulator command-line interface also provides a set of miscellaneous options for scripting.3 Configuring Hardware Simulation Table 4-1 Available Memory Protection Levels Protection Level Description 0 (min) 1 (max) No specific protection Enable stack overflow protection 4. The relevant configuration component is INCLUDE_VIRTUAL_DISK. int bytesPerBlk.3. call virtualDiskInit( ). 38 . accessing the virtual disk looks no different than any other disk in a VxWorks I/O system. "/Q"). To initialize the virtual disk system. By default. int blksPerTrack. To create this association. fsmNameInstall("/Q:0". Table 4-2 VxWorks Syntax for Accessing passFS Host Type passFS Syntax Example Linux or Solaris Windows passFSDevice:/dir/file passFSDevice:/disk/dir/file ls myhost:/myDir/myFile (where host name is myHost) ls host:/c/myDir/myFile ls host:c:/myDir/myFile passFSDevice:disk:/dir/file Windows (deprecated.2 Virtual Disk Support To simulate access to file systems.Wind River VxWorks Simulator User's Guide. xbd = xbdBlkDevCreateSync(vdBlkDev. NULL). there is not yet any name or file system associated with the instance. the VxWorks simulator includes support for virtual disks. the VxWorks simulator includes support for virtual disks. "/Q"). DOS_OPT_QUIET | DOS_OPT_BLANK. vdBlkDev = virtualDiskCreate (hostFile. 6. Consider the following code fragment: BLK_DEV * vdBlkDev. int nBlocks ) /* /* /* /* name of the host file to use number of bytes per block number of blocks per track number of blocks on this device */ */ */ */ Although a successful call to virtualDiskCreate( ) creates a disk instance. syntax preserved for backward compatibility) NOTE: passFS uses UNIX-style path separators (/) even on a Windows-based simulator. you can create a virtual disk instance by calling virtualDiskCreate( ): BLK_DEV * vitualDiskCreate ( char * hostFile. status = dosFsVolFormat("/Q". 32*200). After control returns from a successful call to virtualDiskInit( ). you must call a file system device initialization routine. 32.9 The VxWorks syntax for accessing a host file system is summarized in Table 4-2. 4. either the file system supplied with VxWorks or one you have implemented yourself. However. NOTE: Virtual disk support replaces the UNIX disk driver library (unixDrv) included in earlier versions of the VxWorks simulator. to an application running in a VxWorks image. A virtual disk converts all read and write accesses to read and write accesses to a file on the host file system. 512. a VxWorks image includes support for non-volatile RAM.3. Do not delete this file while the virtual disk is open (to close a virtual disk.3 Non-Volatile RAM Support By default. By default. which has a default size of 256 bytes.4 Standard I/O VxWorks simulator BSPs provide a standard I/O (SIO) driver to handle standard input and output. 39 . this driver is target/config/simpc/simSio. For Windows. the VxWorks simulator clock can be impacted.3. NOTE: On Linux and Solaris simulators. This memory is dedicated to storing boot line information. which should return the following: drv 0 1 5 6 3 name /null /tyCo/0 host: /vio C: 4. 4. To simulate NVRAM. call the virtualDiskClose( ) routine). the current activity of each VxWorks task is delayed by an interval of time that corresponds to the preempted time of the process. Trapping of the ^C character is performed by the kernel shell (when it is included in your image). In support of this virtual disk.4 Using the VxWorks Simulator 4. the VxWorks simulator uses a file on the host system.c.5 Timers Similar to any VxWorks target. UNIX job control characters are enabled even when the I/O is in raw mode. Linux. In such cases.3 Configuring Hardware Simulation This code creates /Q. Trapping of control characters like ^Z is UNIX-shell specific and does not conform to the usual VxWorks tyLib conventions. the VxWorks simulator provides a system clock and an auxiliary clock. and AUX_CLK_RATE_MAX are defined to provide parameter checking for the sysClkRateSet( ) and sysAuxClkRateSet( ) routines. and Solaris simulators. use sysNvRamSet( ) and sysNvRamGet( ). To store anything else in NVRAM. SYS_CLK_RATE_MAX. use the NV_RAM_SIZE macro to increase the size of NVRAM. and 32 tracks. To check whether this code has successfully created a virtual disk. a 3 MB DOS disk with 512-byte blocks.3. this file resides in the same directory that contains the VxWorks image. NOTE: If the VxWorks simulator process is preempted by another process on the host machine. you can call devs( ). the virtualDiskCreate( ) call creates the file c:/tmp/filesys1 (if the file does not already exist). The macros SYS_CLK_RATE_MIN. To specify another location. AUX_CLK_RATE_MIN. use the -nvram command-line option: % vxsim -nvram pathToFileForNVRAM 4. To access NVRAM. The rest of the CPU boards communicate with each other.9 4. The macro HOST_SIO_PORT_NUMBER can be used to select which host serial device to use.7 Serial Line Support The VxWorks simulator provides a sample host serial I/O driver (hostSio). For example.3. The timestamp driver is included in the default VxWorks simulator configuration. Accessing Host Resources. In general. see A. In this configuration. using the shared memory network. This allows the target boards to communicate through shared memory. This feature is not included in the default VxWorks simulator.8 Shared Memory Network You can configure a VxWorks system where multiple CPU boards are connected using a common backplane (for example. For more information. the System Viewer graph can be impacted.3. multiple VxWorks simulator instances are configured to use a host shared-memory region as the basis for the shared-memory network. and the host. VxWorks provides a standard network driver to access shared memory such that all higher-level network protocols are available over the backplane. 40 . CPU 0 acts as a gateway to the outside network. In a typical configuration. this driver is used to extend the range of information available from VxWorks kernel instrumentation. a precise time line can be displayed using the Wind River System Viewer.6 Timestamp Driver The VxWorks simulator provides a system-defined timestamp driver. This driver provides access to a host serial device from the VxWorks simulator. when a timestamp driver is available. 4. a VMEbus configuration). one of the CPU boards (CPU 0) communicates with the host using Ethernet.3. the current activity of each VxWorks task is delayed by an interval of time that corresponds to the preempted time of the process. 6. 4.Wind River VxWorks Simulator User's Guide. In this situation. This type of hardware configuration can be emulated using the VxWorks simulator. In this case. To add host serial device support. The timestamp driver is selected by including the INCLUDE_TIMESTAMP and INCLUDE_SYS_TIMESTAMP components in your VxWorks image. the INCLUDE_HOST_SIO component must be defined in the BSP configuration. NOTE: If the VxWorks simulator process is preempted by another process on the host system. 27.0.1 % vxsim -p 2 -b 161.2:ffffff00 161.1:ffffff00 161. you must configure your VxWorks image to use the following components: INCLUDE_SM_NET INCLUDE_SM_COMMON INCLUDE_SM_OBJ You can reconfigure your image using either the vxprj command-line utility or using the Workbench kernel configuration tool.1 vxsimnetd Ethernet Configuring Your VxWorks Simulator for a Shared-Memory Network In order to configure the VxWorks simulator for use with a shared-memory network. see Wind River Workbench By Example: Configuring and Building VxWorks or the user’s guide for your Platform product.0.27.27.2:ffffff00 41 .3 Configuring Hardware Simulation Figure 4-1 VxWorks Simulator Shared-Memory Network Shared Memory Network 161.27. For more information.4 Using the VxWorks Simulator 4.27. the master simulator must always be started first.0.27.0.27.0. Starting the Slave Simulators Once you start the master simulator instance.200. You must also reboot all slave instances each time the master instance is rebooted.168.27.0.0.0.3:ffffff00 -g 161.3:ffffff00 Master (VxSim0) (CPU0) Slave 1 (VxSim1) (CPU1) Slave 2 (VxSim2) (CPU2) 192.27.2:ffffff00 -g 161.1:ffffff00 NOTE: Because it is responsible for initializing the shared memory region.200. Starting the Master Simulator Use the master simulator to communicate with the host through the simnet device. You can specify the shared-memory network address for the master simulator by starting the VxWorks simulator instance with the -backplane (or -b) option as follows: % vxsim -p 0 -d simnet -e 192. you can start slave simulator instances with a gateway set to the master simulator using the -gateway (or -g) option as follows: % vxsim -p 1 -b 161.0.168.1 An alternative option would be to start the slave simulator as follows: % vxsim -p 1 -b 161.1 -b 161. This allows you to test SMP applications before SMP hardware is available. The host OS simulates each CPU with a process that is scheduled by the host OS itself.200.255. enter the following command from a Windows command shell: C:\> route add 161. you must have administrator or root privileges on your host.27. The routing information can be configured as follows: For Windows hosts. Otherwise.n/target/proj/vxsimBSP_smp/default. enter the following command from your host shell: # route add -net 161. Note that vxsimHostProcCall( ) replaces a direct function pointer dereference that is forbidden in SMP.200. For general background on SMP. since simulated CPUs have to share the real CPU power.0.0. on Windows hosts. you must configure your host routing table with the new subnet information.168.168.n\target\proj\simpc_diab_smp\default\vxWorks.0. NOTE: The VxWorks simulator also supports hardware simulation for the VxWorks AMP product using MIPC. For more information on using VxWorks AMP with the simulator. Configuring the Host System Before your host system can communicate with the master simulator.0 MASK 255. the precompiled SMP image is installDir\vxworks-n. see the VxWorks Kernel Programmer’s Guide: VxWorks SMP.1 NOTE: To configure routing information. For more detailed information see A. see 7. 4. Tutorial: Simulating VxWorks AMP. you should be cautious when calling host routines from the VxWorks simulator.0. 6. p.9 and then add a network route to specify which gateway should be used for communication.1 For Solaris and Linux hosts.2 Accessing Host OS Routines.118. If you are using the VxWorks simulator to simulate multiple processors in SMP mode. performance will not match SMP expectations. A precompiled SMP image is located in installDir/vxworks-n.0 192. For example. Thus. 42 . SMP performance can be achieved when the host has more CPUs than the VxWorks simulator. Review code that uses vxsimHostProcAddrGet( ) to make sure it is SMP-safe.Wind River VxWorks Simulator User's Guide.0/24 161. you must include the INCLUDE_ROUTECMD component in your VxWorks image.27.4 Using VxWorks SMP with the VxWorks Simulator The VxWorks simulator provides support for the VxWorks SMP product. You specify the number of simulated CPUs using the Workbench kernel configurator before building the VxWorks image.255.1" NOTE: If you choose to use the alternative option described above.0 192.0.27. This is done from the VxWorks simulator kernel shell as follows: -> routec "add -net 0. as shown in Figure 4-2. In addition. the startup sequence reports both the number of CPU cores that the VxWorks image expects and the actual number of CPU cores present on the host machine. use the Kernel Configuration facility. do the following: 1. If you want to change the number of processor cores (the default is two). Build the project. In the Options dialog of the wizard. The following steps assume that you are using the Workbench Advanced Device Development perspective. 6. then select the connection type Wind River VxWorks 6. 5.1 Creating an SMP Image To create a new VxWorks simulator image that includes support for SMP. Figure 4-2 VxWorks Simulator SMP Startup Screen 1.4 Using VxWorks SMP with the VxWorks Simulator 4. Double-click on the line labeled Number of CPUs enabled (which corresponds to the parameter VX_SMP_NUM_CPUS).4. 3. Create a new VxWorks image project (VIP) in Workbench (for information. Select Target > New Connection. select Window > Open Perspective > Advanced Device Development. When you connect to the SMP-enabled VxWorks simulator instance. Click Finish. Change the highlighted number (2) to the desired number of CPUs. 43 . Click Next then click on Custom simulator and navigate to the project directory for the VIP you just built.x Simulator Connection. the startup banner should indicate that VxWorks SMP is running. 2. see the user’s guide for your Platform1). 4. Go to operating system components > kernel components > kernel. To display the Advanced Device Development perspective.4 Using the VxWorks Simulator 4. check the SMP support in kernel option checkbox. The title bar at the upper left of the Workbench window shows the current perspective. ■ VXSIM_KERNEL_VIRT_POOL_RGN_SIZE Defines the size of the kernel virtual pool.1 Creating a 64-Bit Image To build a 64-bit image for the VxWorks simulator.5. the VxWorks simulator has the following kernel configuration parameters for specifying virtual address space: ■ VXSIM_RTP_PRIVATE_RGN_SIZE Defines the size of the RTP user virtual memory region.5 64-Bit VxWorks Simulation The VxWorks simulator now supports development of applications for operation in 64-bit mode. 44 .9 At the VxWorks simulator prompt. 6. except that for 64-bit simulation. you should be able to see the idle tasks running on the two different CPU cores by issuing the i command: -> i NAME ---------tJobTask tExcTask tLogTask tNbioLog tShell0 tWdbTask tAioIoTask> tAioIoTask> tNet0 ipcom_sysl> tAioWait tIdleTask0 tIdleTask1 value = 0 = ENTRY -----------10098400 100976f0 logTask 10099240 shellTask wdbTask aioIoTask aioIoTask ipcomNetTask 1005bbb0 aioWaitTask idleTaskEntr idleTaskEntr 0x0 TID -------1042ac90 101d0e60 1042ebe8 1042f080 105c8648 104edee0 1044e2d0 1044e6f0 10466030 1046d950 1044adf8 103a9778 103e4000 PRI --0 0 0 0 1 3 50 50 50 50 51 287 287 STATUS ---------PEND PEND PEND PEND READY PEND PEND PEND PEND PEND PEND READY READY PC -------101349d6 101349d6 10132ad5 101349d6 1013e390 101349d6 101350e1 101350e1 10134742 101350e1 101349d6 100366f6 100366f6 SP ERRNO CPU # -------. 4. Limitations The 64-bit VxWorks simulator is supported on 64-bit Windows and Linux hosts only. with very few exceptions.------. You start the simulator in the same way. and include networking in the same way.Wind River VxWorks Simulator User's Guide. build applications. The RTP virtual address will be between 0x2 0000 0000 and (0x200000000 + VXSIM_RTP_PRIVATE_RGN_SIZE). you follow the same process you would use to build a regular 64-bit VxWorks image (based on the simpc or linux simulator BSP).----1066ff48 0 101d0d50 0 106afed8 0 106efef8 0 108be058 0 0 1086fee8 0 1076fd28 0 107afd28 0 107eff54 0 1060fe58 0 1072feb8 0 103a9600 0 103e3e88 0 1 4. The 64-bit VxWorks simulator works the same way as the simulator for 32-bit VxWorks. ■ VXSIM_SHARED_RGN_SIZE Defines the size of the user shared virtual memory region (shared library addresses). see the Wind River Workbench By Example: Configuring and Building VxWorks. because the VxWorks simulator environment is not a suitable basis for developing hardware device drivers. However. nowait—The simulator starts without waiting for the client to connect. For general application build instructions. To do this you use the -add_dev option of the vxsim command.5.) 4. The syntax of the option is: -add_dev serial0=telnet:[portNumber]:[nowait]. For more information on building applications for your target architecture.4 Using the VxWorks Simulator 4. This is in contrast to the standard 64-bit VxWorks operating system. Launch an instance of the simulator and a Telnet server for displaying its console. only the X86-64 ABI’s large code model is supported for RTP executables and user-mode libraries. To migrate your application. This involves recompiling your code using the appropriate CPU type for your target hardware. change your project build specifications to reflect the new hardware-based system. 4.6 Migrating Applications to a Hardware-Based System 4. if omitted. see the VxWorks Architecture Supplement.[nokill] where the optional parameters are interpreted as follows: The optional parameters are interpreted as follows: ■ portNumber —the port to use. the VxWorks simulator chooses the port number.2 Large Code Model For the 64-bit VxWorks simulator. ■ ■ 45 . for which only the small code model is supported for RTP executables and user-mode libraries. nokill—Allows the console to be closed and restarted without killing the simulator process. (The medium code model is not supported in either case.7 Using a Telnet Client to Display the Simulator Console To access the VxWorks simulator console through a Telnet client: 1.6 Migrating Applications to a Hardware-Based System Kernel and RTP applications developed using the VxWorks simulator are easily transferred to target hardware systems. more work may be required once your application is transferred to the target system. 4. To obtain the port number. Disconnecting the Simulator To exit the simulator. use the -list_dev option of the vxsim command to obtain the port number. both forms of the option are equivalent. you need to use -list_dev with the -l option.3 Launching the VxWorks Simulator from Workbench. 6. Connect a Telnet client to the Telnet Server: telnet localhost portNumber The preceding steps display the VxWorks simulator console in a new window. It is required when no port number is specified and causes the VxWorks simulator to supply a port number. On Windows. do one of the following: ■ On Windows: reboot(1) ■ On UNIX: CTRL+\ or reboot(1) 46 . For more information. The -list_dev option has the following forms: -list_dev serial0 -list_dev all In the current release. the -list dev option displays the port number on the standard output.14. This writes the port number to the log file specified with -l. You can also display the console directly in Workbench.9 Examples: vxsim -add_dev serial0=telnet vxsim -add_dev serial0=telnet:5656:nowait vxsim -add_dev serial0=telnet::nowait Note the double colon (::) in the last example. In the current release.Wind River VxWorks Simulator User's Guide. the VxWorks simulator is not a console application. see 2. p. because only a serial device used for displaying the console over Telnet is supported. On UNIX. If you did not specify a port number for the Telnet server with the add_dev option. output from -list dev appears as follows: serial0=telnet:portNumber 3. 2. and simulator output is not displayed on the standard output. Does not require the installation of any driver on the host. while simnet allows more complex network simulation.9.1 Introduction 47 5. is described in detail in 5. Does not support protocols other than TCP and UDP.1 Introduction Starting with Wind River VxWorks Simulator 6. simnet_nat provides a simple solution that is limited to UDP/TCP protocols. 47 . ■ You must start vxsimnetd before starting a simulator instance. Does not require specification of a gateway or target IP address. Uses the vxsimnetd daemon. and as such does not permit any incoming traffic.3 Network Redirection: simnet_nat 71 5.2 Full Network Simulation: simnet.48. Allows access to network resources. Does not require the use of vxsimnetd. two types of networking are available for the VxWorks simulator: network redirection (also known as network address translation. and full network simulation. or NAT). through the simnet device. Table 5-1 Networking Methods for the VxWorks Simulator Networking Method Description ■ Limitations ■ simnet Allows various protocol and subnet configurations. simnet_nat ■ ■ ■ ■ ■ ■ Full network simulation. it does not support ping and other ICMP utilities. The main differences between these two networking methods are summarized in Table 5-1. Acts as a firewall by default. provided in the simnet device. including the Internet.5 Networking with the VxWorks Simulator 5. Therefore. p.2 Full Network Simulation: simnet 48 5. which is provided through the simnet_nat boot device. By default. This chapter discusses how to configure your system and the required VxWorks simulator instances for use in a simulated subnet or subnets. p. included with the VxWorks simulator is a simulated network drive—a host adapter interface—that you can use to give the host system an address on the simulated subnet.Wind River VxWorks Simulator User's Guide. snoop. It includes general network simulation information. is described in detail in 5. see 5. Tutorials for setting up various types of simulated networks are provided in 6.0.9 Network redirection. 48 . NOTE: The VxWorks simulator supports IPv6. such as tcpdump.5 Configuring a Subnet Across Multiple Hosts Using wrnetdlink.2 Full Network Simulation: simnet The VxWorks simulator provides support for setting up a subnet—or multiple subnets—using a network of VxWorks simulator instances. In addition. can monitor traffic on an internally simulated subnet.2. For IPv6 configuration information. and information on configuring your simulated network.97. For information on using the VxWorks simulator with IPv6. 192.69. Networking Tutorials. 5. these internal subnets do not communicate with the host.0 and 192.71. instructions for setting up the VxWorks simulator network daemon (vxsimnetd) and installing the host connection driver. see the Wind River Network Stack Programmer's Guide. 5. this adapter on the simulated subnet lets you use the host to route packets for the subnet and thus link it with an external network.1 Building Network Simulations Using the VxWorks simulator network daemon. p. see 6. p.168. 6. packet sniffers. simulated on a single host.3.2. NOTE: You can also use the wrnetdlink tool to create and link simulated subnets across multiple host systems.6 IPv6 Tutorial. through the simnet_nat device.3 Network Redirection: simnet_nat. or ethereal.2. However. Volume 1: Transport and Network Protocols: Configuring Transport and Network Protocols. Through the host adapter. Figure 5-1 shows two subnets. It also includes information on the wrnetdlink tool that allows you to set up a simulated subnet over multiple host systems. For more information.168. you can link same-host VxWorks simulator instances into simulated subnets. 0 is an “external” subnet.0 is an entirely internal subnet. If you set up the host system route table correctly.3.3.168.200. As shown in Figure 5-2.168.168.168. the host system can route packets for the 192. although you can use a kernel shell or the target server (using the WDB pipe back end) to access a target. it is possible to create a multiple interface VxWorks simulator instance.168.200. you can use the subnet to communicate with other targets on the subnet.254.2 Full Network Simulation: simnet Figure 5-1 VxWorks Simulator Instances on Simulated Subnets Host Adapter Interface 192.254 VxSIM Network Daemon 192.200.4 VxSIM 3 Virtual Network 192.168.0 VxSIM 4 192. it is possible to route between simulated subnets.200.0 Virtual subnet 192.200. It is networked to the host workstation through the host adapter interface. It is isolated from the host.3.168. After you have access to one target on the subnet.2 VxSIM 2 Virtual Network 192. 192. 49 .3 192.1 External Network Workstation Host’s IP Address VxSIM 1 192.200.3.168.168.168.168.0 subnet.5 Networking with the VxWorks Simulator 5.200. Using such a VxWorks simulator instance. Virtual subnet 192. you must install the VxWorks simulator host connection driver (TAP driver) before configuring and starting the VxWorks simulator network daemon (see 5.63. or from the command line. If you want to set up an externally visible subnet (able to communicate with or through the host).200.3.168. which can then route packets to the external network through its network interface. The VxWorks simulator network daemon can be started either as a service (Windows service or root service on Linux and Solaris). p.2 VxSIM 2 Virtual Network 192. p.4 VxSIM 3 Virtual Network 192. 5.168.168.3 192.200. a connection between the host and a single simulator instance.2.9 Figure 5-2 VxWorks Simulator Instances Can Support Multiple Network Interfaces External Network Workstation Host’s IP Address Host Adapter Interface 192.63).168.2 Setting Up the Network Daemon The VxWorks simulator includes a network daemon that you can use to link multiple VxWorks simulator instances into one or more subnets.168.200. 50 . you can use the VxWorks simulator instances to test any broadcasting or multicasting features you may have built into an application.Wind River VxWorks Simulator User's Guide. which is the recommended method. You can also use this network daemon to link these subnets (or even individual VxWorks simulator instances) to the larger Internet.3 Installing the Host Connection Driver. it is also required for minimal networks—that is.168. NOTE: Although the VxWorks simulator network daemon allows you to set up complex simulated networks. The network daemon can support any protocol over the Ethernet layer (for example.2. The following sections describe how to set up a VxWorks simulator network daemon.3 Installing the Host Connection Driver.0 In Figure 5-2.3.3. 6.168.0 subnet to the greater external network through the host adapter to the host. see 5.3. For more information on the VxWorks simulator host connection driver.168.254 VxSIM Network Daemon 192. the multi-interface VxSIM 3 can route packets from the 192.0 VxSIM 4 192.168.200. TCP/IP).2.3 192.3.1 VxSIM 1 192. Thus. execute the following command from the VxWorks Development Shell: -> vxsimnetds_inst.2 Full Network Simulation: simnet NOTE: If you want to use a VxWorks simulator instance(s) on a simulated network.57. you can install and configure the network daemon service from the VxWorks Development Shell (recommended) or from the Windows command shell (Start > Run. > cmd). To run vxsimnetd directly from the command line (that is. NOTE: The vxsimnetds_inst. p.exe.exe /u 2. To remove it. VxWorks Development Shell To install from the VxWorks Development Shell.exe program is a command-line installer for the vxsimnetd service. Run it just once. Open the VxWorks Development Shell by selecting Start > Wind River > VxWorks N. use vxsimnetd. run the following command: -> vxsimnetds_inst.. or again to modify the parameters of the service. do the following: 1. Windows Hosts On Windows hosts.exe 51 . you must remove the service. to install the service.N and General Purpose Technologies > VxWorks Development Shell. see Removing the Network Daemon Service. Keep in mind that even a connection between the host system and a single instance requires the network daemon.. you must start the VxWorks simulator network daemon before you start the VxWorks simulator instance. (This may be the case even if you removed your previous installation using a Wind River uninstallation utility. From the VxWorks Development Shell. Starting the Network Daemon as a Service Wind River recommends starting vxsimnetd as a Windows service (or a root service on Linux and Solaris) because this method provides full network support for the VxWorks simulator even if you are not logged in with administrator or root privileges on the host system. NOTE: You must remove any previously installed network daemon services before attempting to install a new service. if you installed a network daemon service (vxsimnetds) as part of an earlier VxWorks simulator release. Install the new network daemon.) For information on removing the network daemon service.5 Networking with the VxWorks Simulator 5. 3. not as a service). you must remove the old service before attempting to install a service from the latest release. If you have an existing vxsimnetd service from a previous VxWorks simulator installation. For example. The basic instructions for installing the service are as follows: 1.exe However. p. you must remove the service.exe /u where installDir is the name of your VxWorks installation directory. the directory cannot be created at runtime. and select Run as Administrator. /d The /d option specifies the directory to which the vxsimnetds files are copied.exe (where installDir is the name of your VxWorks installation directory) and click OK to run the file. Install the new network daemon. if User Access Control is set to on. (For more information. Configuring the Network Daemon Service As described above.Wind River VxWorks Simulator User's Guide.x/host/x86-win32or64/bin/vxsimnetds_inst.exe or C:\> installDir/vxworks-6. the configuration parameters are saved and can be reused for the next installation by specifying the /p option..) 52 . see Removing the Network Daemon Service.x/host/x86-win32or64/bin/vxsimnetds_inst.x/host/x86-win32or64/bin/vxsimnetd_inst. To do so. When the service is removed.. default parameters are used. 6. the following configuration options are available: /p The preserve option (/p) allows you to keep a previous network daemon service (vxsimnetds) configuration. 2.. /u The /u option stops and uninstalls the current vxsimnetds service. Browse to installDir/vxworks-6. select Run. Note that this option requires that you specify an existing directory.9 Windows Command Shell To install from the Windows command shell. this option loads the saved configuration parameters from the previously installed network daemon service (parameters are saved when a service is removed). If you have an existing vxsimnetd service from a previous VxWorks simulator installation. If the /p option is omitted.exe with administrator privileges. right-click the executable file. From the Windows Start menu. do the following: NOTE: You must run vxsimnetds_inst. you must use Run as Administrator. 3. the basic command-line execution required to install the network daemon service is as follows: -> vxsimnetds_inst. When used. from the Windows Start menu and execute the following command: C:\> installDir/vxworks-6. To remove it. This option is mandatory if you are installing on a mounted drive. In addition..57. select Run. Log in to the Windows host with administrator privileges.. and specify the desired options before starting the service. For Solaris hosts. right-click Wind River Network Daemon for VxWorks Simulator. SHELL_SERVER. vxsimnetd is located in installDir/vxworks-6.x/host/x86-linux2/bin/. For Linux hosts. and LOG_FILE. LogLevel. Once the network daemon service is started. and LogFile.0 external subnet configuration and with a shell server (-sv option). the network daemon starts with the default 192.5 Networking with the VxWorks Simulator 5. You can install vxsimnetd as a root service using the following steps: 1. 2.2 Full Network Simulation: simnet /get parameter This option allows you to display the following network daemon service parameters: CONFIG_FILE. To change these options.168. select Properties. ShellPort. SHELL_SERVER_PORT. 53 . NOTE: The following steps must be executed with root privileges. and set the startup type to Automatic. Specifying this option without any parameters displays values for all parameters in the following form: Subnet Configuration File: file Shell Server: Enabled Shell Server Port Number: 7777 Logging Level: 1 Log File: file /set parameter This option allows you to set the following network daemon service parameters: ConfigFile. ShellServer.x/host/sun4-solaris2/bin/. Solaris and Linux Hosts On Solaris and Linux hosts. Select Wind River Network Daemon for VxWorks Simulator and start the service by right-clicking and selecting Start. 3. You can then start the service by right-clicking and selecting Start. create scripts for Solaris and Linux systems that start vxsimnetd automatically on reboot (use the -sv option if you want the ability to modify network configuration). Open Control Panel > Administrative Tools. To do this. Copy vxsimnetd to your /usr/sbin directory. non-administrator users can start VxWorks simulator instances and attach them to any configured subnet. right-click Wind River Network Daemon for VxWorks Simulator. vxsimnetd can be run as a root service. LOGGING_LEVEL. vxsimnetd is located in installDir/vxworks-6. Parameters can be set as follows: C:\> vxsimnetds_inst /set ConfigFile=file /set ShellServer=[yes|no] /set ShellPort=value /set LogLevel=value /set LogFile=logFile Starting the Network Daemon Service To start the service: 1. Click Services.200. (If the service is set to Disabled. select Properties.) By default. /etc/rc. *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 On Linux. if [ -f /etc/init.d/functions ] . then echo "Starting vxsimnetd . [ -x /usr/sbin/vxsimnetd ] || exit 0 RETVAL=0 start() { echo -n $"Starting vxsimnetd service: " daemon vxsimnetd -sv RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vxsimnetd || \ RETVAL=1 return $RETVAL } stop() { echo -n $"Shutting down vxsimnetd services: " killproc vxsimnetd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vxsimnetd echo "" 54 ..d/init.d/functions else exit 0 fi # Check that vxsimnetd exists." /usr/sbin/vxsimnetd -sv fi . then . 6.d: On Solaris.. case "$1" in start) if [ -x /usr/sbin/vxsimnetd ] ..Wind River VxWorks Simulator User's Guide. Create a vxsimnetd script as follows in /etc/init. # # pidfile: /var/run/vxsimnetd.." /usr/bin/pkill -x vxsimnetd ..d/init..d/functions elif [ -f /etc/rc. use the following script: #!/bin/sh # # description: Starts and stops the vxsimnetd daemon # used to provide external network access to the # VxWorks simulator. /etc/init. then . stop) echo "Stopping vxsimnetd .d/functions ] . use the following script: #!/bin/sh # # chkconfig: 3 91 02 # description: Starts and stops the vxsimnetd daemon \ # used to provide VxWorks Simulator network services.9 2.pid # Source function library. .2 Full Network Simulation: simnet return $RETVAL } restart() { stop start } rhstatus() { status vxsimnetd } case "$1" in start) start . run: $ /sbin/chkconfig --add vxsimnetd This creates two links on /etc/init. stop) stop . which allows you to use a configuration file to supply some defaults and read in additional configuration files as needed. 4. status) rhstatus .d/vxsimnetd start or reboot your host.d/S91vxsimnetd and /etc/r6. Starting the Network Daemon from the Command Line You can use the vxsimnetd command to start the VxWorks simulator network daemon on your host system. condrestart) [ -f /var/lock/subsys/vxsimnetd ] && restart || : .d/ as follows: # ln -s /etc/init... /etc/rc3. You can configure the daemon using a configuration file statically at startup time or you can configure it interactively using the daemon’s debug shell.d/vxsimnetd.d/K02vxsimnetd.5 Networking with the VxWorks Simulator 5. restart) restart . *) echo $"Usage: $0 {start|stop|restart|status|condrestart}" exit 1 esac exit $? 3.d/vxsimnetd S91vxsimnetd On Linux. You can also combine these configuration methods.. Create a link. in /etc/init.d/. Start vxsimnetd as follows: # /etc/init. 55 . On Solaris. create a link in /etc/rc3.. the debug shell runs in the background and is accessible using telnet. if User Access Control is set to on. the network daemon is started with a default external subnet of 192. To do so. where vxsimnetd. When in background mode. which you can use to specify a different port number. where vxsimnetd. -force Forces the deletion of IPC objects left after vxsimnetd dies (UNIX only). use a command such as the following.57. For example: % telnet hostname portNumber The portNumber defaults to 7777. you must launch the daemon from a task with the appropriate privileges. this means starting the daemon with administrator privileges.conf -s If you use the -sv option instead of the -s option. the default port is 7777. you can telnet to a debug port to access the debug shell.9 NOTE: If the daemon must support an externally visible subnet. To configure the daemon statically.conf To start the VxWorks simulator network daemon interactively.200. The -sv and -s options are mutually exclusive. On a Windows host.conf is a file supplying configuration parameters: % vxsimnetd -f vxsimnetd. For more information on the format of this file. -s or -shell This option starts a debug shell that you can use to control network daemon configuration interactively. and select Run as Administrator. but vxsimnetd supports the -sp parameter. p. vxsimnetd can also be started without any configuration options. you must use Run as Administrator. -sv or -shellserver This option starts the network daemon in server/background mode. In addition. see Creating a Network Daemon Configuration File. right-click the executable file. 6. In this case. see Network Daemon Debug Shell.Wind River VxWorks Simulator User's Guide.168. -sp or -shellport This option specifies the debug port used to start a shell on a network daemon in background mode.0 and with the host node set in promiscuous mode.conf is a file supplying configuration parameters: % vxsimnetd -f vxsimnetd.59. 56 . p. on Windows hosts. use a command such as the following. If not specified. this means starting the daemon with supervisor or root privileges. The vxsimnetd command supports the following options: -f or -file This option specifies the configuration file that is parsed when the network daemon starts. On a Solaris or Linux host. For more information on the debug shell options. the node command displays specifics about the particular node. For example: vxsimnetd> node default NODE INFORMATION: CONFIGURED IN-USE 33 1 MAX 1 TOTAL 1 FAIL 0 Current Nodes of the subnet (default): # COMM STATUS IP PROMISC RCVQ PID 0 special(*) UP 192.5 Networking with the VxWorks Simulator 5. The available shell commands are: subnet [subnetName] This command displays subnet information. A detailed summary is provided when a subnet name is specified.168.200.254 Yes 0 24076 MAC ADDRESS: Mac Address SEND/RECEIVE # of # of # of STATISTICS: receives sends send failures 7a:7a:c0:a8:c8:fe 0 6 6 RECEIVE QUEUE INFORMATION: CONFIGURED CURRENT 64 0 MAX 0 57 .168.254 Yes 0 24076 If you specify a node number (nodeNb) or node IP address (nodeIp). node subnetName [nodeIp] node subnetName [nodeNb] This command displays information about how many nodes are configured and used.exe /u This removes the vxsimnetd service.2 Full Network Simulation: simnet Removing the Network Daemon Service NOTE: The product uninstaller does not uninstall vxsimnetd.200. For example: vxsimnetd> node default 0 # COMM STATUS IP PROMISC RCVQ PID 0 special(*) UP 192. the command lists a summary for all configured subnets. To remove the network daemon service (vxsimnetd). be sure to uninstall vxsimnetd (as described above) before running the uninstaller program. The shell supports command-line completion as well as history with two editing modes. such as the number of packets sent and received. open a VxWorks Development Shell and enter the following: -> vxsimnetds_inst. If you plan to uninstall the product. Network Daemon Debug Shell You can access the network daemon debug shell by starting vxsimnetd with the -s (or -shell) or -sv (or -shellserver) option. emacs (default) or vi. When no subnet is specified. For more information on vxsimnetd options. This feature is provided to simulate packet loss on an actual subnet. 1 sets promiscuous mode to on. timeout subnetName This command sets the subnet timeout value. it allows you to analyze network traffic by connecting a packet sniffer on the external host node interface. If you started vxsimnetd with the -s option.Wind River VxWorks Simulator User's Guide. delete subnetName This command deletes a configured subnet. source configFile This command reads subnet configuration information from a file and adds the corresponding subnets. this command destroys all subnets and vxsimnetd exits. To delete all subnets.168. mode vi mode emacs This command sets the shell editing mode to vi or emacs.254[E] N/A LEN 1514 REFCNT 0 PKTPTR 0xff0e2b14 In this example. If vxsimnetd cannot add all configured subnets. ? Displays a one-line summary for all commands. if the error rate is set at five percent. then this command adds no subnets at all. help [command] This command specifies detailed help for a given command. the packets are picked up by garbage collection.2 Setting Up the Network Daemon.2. The error rate is the percentage of packets that will not be sent without giving error notification to the sender. When the external node is in promiscuous mode (1). use delete all. only one is currently in use. The 0 option sets promiscuous mode to off. errorrate subnetName This command sets the error rate for a given subnet. see 5. The hanging packets section displays packets that are allocated but not yet sent. it receives every packet sent on the subnet.9 packet subnetName This command displays packet information for a subnet.200. and seven packets were used in total. Thus. quit This command exits the shell.50. 58 . 6. If a node does not read any packets for the length of time specified as the timeout. For example: vxsimnetd> packet default PACKET INFORMATION: CONFIGURED IN-USE 100 1 MAX 1 TOTAL 7 FAIL 0 HANGING PACKETS: PKT-# SEND-NODE RECV-NODE 0 192. the default subnet is configured with 100 packets. extpromisc subnetName 0 extpromisc subnetName 1 This command sets the promiscuous mode for the host node of an external subnet. a summary of all available commands is provided. If no command is specified. p. While this heavily impacts network performance. five randomly chosen packets per 100 will be purposely lost. To add a subnet with a different value. enter a semicolon-terminated ( .0. SUBNET_ACCESSMODE = "0600".200. For 192. 1.0".0". 59 . SUBNET_GID = 100. every subsequent dynamically added subnet will use this value. that would be the mask for a class C address.5 Networking with the VxWorks Simulator 5.2 Full Network Simulation: simnet Creating a Network Daemon Configuration File A network daemon configuration file specifies values for the vxsimnetd configuration parameters. SUBNET_ADDRESS = "192. because the network mask is not specified. the default values are not modified. CIDR refers to classless inter-domain routing. This configures the VxWorks simulator network daemon to support a subnet with external access.0 and. you could add the following lines: SUBNET_START user1 { SUBNET_UID = 323.201. you must add it through a configuration file that redefines the value of DEFAULT_MAC_PREFIX. the pre-CIDR1 default mask applies. use the -f option with the vxsimnetd command (the command used to start the network daemon). In your configuration file. See RFCs 1518 and 1519. For example. which is 0xffffff00.168. SUBNET_EXTPROMISC = yes. NOTE: While you can use a configuration file to overwrite the default values for these parameters. if vxsimnetd is started with a configuration in which DEFAULT_MAC_PREFIX is set to 7a7b. where PARAMETER is either a parameter name in capital letters or an alias: PARAMETER = value. ) line with the following format.200. To specify a configuration file. SUBNET_ADDRESS = "192. to assign a value to a parameter. consider the following default configuration file: SUBNET_START default { SUBNET_EXTERNAL = yes. }. For parameters related to a subnet. }. To add another subnet. The parameters supported in a VxWorks simulator network daemon configuration file are described in Table 5-2. through the vxsimnetd shell. For example.168. group those parameters using the following syntax: SUBNET_START subnetName { SUBNET_PARAM = value. The network address for the subnet is 192.168.168. if you add the configuration file dynamically.200. }. 6. For each subnet. DEFAULT_GID Alias: dgid Default Value: group ID of the user that started the network daemon Defines the group ID (UNIX only).Wind River VxWorks Simulator User's Guide.9 Table 5-2 VxWorks Simulator Network Daemon Configuration Parameters Parameter Default Parameters: Description DEFAULT_GARBAGE Alias: dgarbage Default Value: 30 Specifies the number of seconds in the garbage collection interval. DEFAULT_ACCESSMODE Alias: daccessmode Default Value: "0666" Defines access mode (UNIX only). You can use the three parameters (duid. and daccessmode) to restrict access to subnets to a given user or group of users when the network daemon is shared between users on the same host. dgid. DEFAULT_EXTPROMISC Alias: dextpromisc Default Value: yes Defines whether the external subnet host node is set in promiscuous mode. DEFAULT_UID Alias: duid Default Value: user ID of the user that started the network daemon Defines the user ID (UNIX only). the garbage collection thread runs every DEFAULT_GARBAGE seconds. DEFAULT_MACPREFIX Alias: dmacprefix Default Value: 7a:7a Specifies the first bytes of simulator Ethernet addresses. Garbage collection removes any dead nodes from the configured subnets. DEFAULT_ERRORRATE Alias: derrorate Default Value: 0 Defines the default subnet error rate. 60 . DEFAULT_EXTERNAL Alias: dexternal Default Value: no Defines the default subnet type. 61 .2 Full Network Simulation: simnet Table 5-2 VxWorks Simulator Network Daemon Configuration Parameters (cont’d) Parameter Description DEFAULT_TIMEOUT Alias: dtimeout Default Value: -1 Defines how long packets queued to a VxWorks simulator instance are left in the queue. Overrides DEFAULT_GID. Overrides DEFAULT_MACPREFIX. Subnet-Specific Default-Override Parameters: SUBNET_MACPREFIX Alias: macprefix Default: DEFAULT_MACPREFIX Specifies the first two bytes of the Ethernet address on this subnet.0.0. Specifies the subnet mask for this subnet. SUBNET_EXTERNAL Alias: external Default: DEFAULT_EXTERNAL Specifies whether this subnet can communicate with the host on which it runs.5 Networking with the VxWorks Simulator 5. SUBNET_MASK Alias: mask Default: Pre-CIDR mask associated with the address in SUBNET_ADDRESS. Topology Parameters: SUBNET_ADDRESS Alias: address Default: "0. Overrides DEFAULT_UID. and to start the VxWorks simulator network daemon with administrator privileges. SUBNET_GID Alias: gid Default: DEFAULT_GID Specifies the group ID for this subnet. Overrides DEFAULT_ACCESSMODE. SUBNET_ACCESSMODE Alias: accessmode Default: DEFAULT_ACCESSMODE Specifies the access mode for this subnet. The default is forever. This communication requires you to create a VxWorks simulator target with a network interface on the host system’s network.0" Specifies the network address for this subnet. SUBNET_UID Alias: uid Default: DEFAULT_UID Specifies the user IP for this subnet. It allows you to attach a sniffer on the host interface to monitor traffic. it has a dramatically negative impact on network performance. SUBNET_RECQLEN Alias: recvqlen Default: 64 Specifies how many packets can be queued to a simulator. SUBNET_MULTICAST Alias: multicast Default: yes Specifies whether to allow multicast packets. However.9 Table 5-2 VxWorks Simulator Network Daemon Configuration Parameters (cont’d) Parameter Description SUBNET_EXTPROMISC Alias: extpromisc Default: DEFAULT_EXTPROMISC Specifies whether the host sees every packet sent on this subnet. Option Parameters: SUBNET_BROADCAST Alias: broadcast Default: yes Specifies whether to allow MAC broadcast packets. 6.Wind River VxWorks Simulator User's Guide. SUBNET_EXTDEVNUM Alias: extdevice Default: 0 Specifies the host device number to use. SUBNET_MAXNODES Alias: maxnodes Default: 32 Specifies the maximum number of simulators that can attach to this subnet. This parameter is required when using more than one external subnet. SUBNET_ERRORRATE Alias: errorrate Default Value: DEFAULT_ERRORRATE Defines the subnet error rate (the percentage of packet loss on this subnet) 62 . SUBNET_SHMKEY Alias: shmkey Default: IP address Specifies the shared memory key. Resource-Related Parameters: SUBNET_MAXBUFFERS Alias: maxbuffers Default: 100 Specifies the maximum number of packet buffers available. snoop. You only need to install this driver if you want to set up an externally visible subnet (able to communicate with or through the host) of VxWorks simulator instances.3 Installing the Host Connection Driver. (For information on installing and configuring the WRTAP driver. p. p. NOTE: If you are working on a Windows host. or ethereal can then be attached to the host interface to monitor traffic on the internal simulated subnet.2. 5.63.2 Full Network Simulation: simnet Table 5-2 VxWorks Simulator Network Daemon Configuration Parameters (cont’d) Parameter Description SUBNET_TIMEOUT Alias: timeout Default Value: DEFAULT_TIMEOUT Defines how long packets that are queued are left in the queue before garbage collection removes them. review the information in Managing the WRTAP Driver on Windows Hosts.5 Networking with the VxWorks Simulator 5.3 Installing the Host Connection Driver This section provides instructions for installing the optional VxWorks simulator host connection driver. Packet sniffers such as tcpdump.67. On Solaris and Linux hosts: You must specify the device number of all but the first external subnet using the SUBNET_EXTDEVNUM parameter. SUBNET_MTU Alias: mtu Default Value: 1500 Defines the MTU value that a VxWorks simulator instance is configured to use when it attaches to a subnet. Configuring Multiple External Subnets The VxWorks simulator network daemon can be configured with multiple external subnets. 63 . vxsimnetd automatically configures its IP address and mask according to the configuration file.2. see 5. SUBNET_EXTCONNNAME Alias: extconnname Default: Specifies the network interface name to use for this subnet as set in Control Panel > Network Connections (Windows only). After this host driver is installed. Before installing this driver. However. installing the host connection driver (the WRTAP or TAP-Win32 driver) can have an impact on your host system performance. the following caveats should be observed: On Windows hosts: You must install a VxWorks simulator host connection driver (WRTAP) for each external subnet.) You may also want to specify a name for the WRTAP device driver used by a given subnet through the SUBNET_EXTCONNNAME configuration parameter. Answer Yes.9 32-Bit Windows Hosts Use the following instructions to install the WRTAP driver on 32-bit Windows XP. Browse to installDir\vxworks-6. 32-Bit Windows Vista 1. Open the Control Panel and select the classic view. 8. 6. Double-click Add Hardware to open the Add Hardware Wizard. Click the Have Disk. 32-Bit Windows XP 1. click Next. 4. button. click Next.67. 9. For more information on using the WRTAP driver on Windows hosts. Open the Control Panel. 6. Select Network Adapters. 10. For 64-bit hosts. Windows Vista. I have already connected the hardware. 7. or Windows 7 hosts. see Managing the WRTAP Driver on Windows Hosts. 4. 7. Click the Have Disk. 15.. Select Install the hardware that I manually select from a list (Advanced). Click Next. see 64-Bit Windows Hosts. Click Finish to close the wizard.. Select Network Adapters. Select wrtap. Select WindRiver WRTAP. Click Next to start installing the driver. Click OK to select the directory. 5.Wind River VxWorks Simulator User's Guide. NOTE: If you intend to use more than one external subnet.. Select Add a new hardware device (you may need to scroll down to see this option). p. 12. 13.inf and click Open. repeat the installation steps in the appropriate section below for each subnet.65. Click Next. Browse to installDir\vxworks-6. 64 .x\host\x86-win32\bin (installDir is the name of your VxWorks installation directory).x\host\x86-win32\bin (installDir is the name of your VxWorks installation directory).. button. 2. 5. click Next. Click Continue Anyway in the Hardware installation pop-up window. 3. You must install and configure a WindRiver WRTAP driver individually for each subnet that is marked as external. 6. Select Install the hardware that I manually select from a list (Advanced). click Next. 11. click Next. 2. 3. Double-click Add Hardware to open the Add Hardware Wizard. click Next. p. 14. click Next. do the following: 1. Select wrtap. 7. Select Install the hardware I manually select from a list and click Next. Click Finish to close the wizard. 2. 4. Select WindRiver WRTAP.x\host\x86-win32\bin (installDir is the name of your VxWorks installation directory). You do not need any other components of OpenVPN. 11. Click Next to start installing the driver.0. 3. Browse to installDir\vxworks-6. In the OpenVPN Setup Wizard. 6. click Next. Click Have Disk. Right-click your computer and select Manage. deselect all components except the TAP-Win32 Virtual Ethernet Adapter. 65 . In the middle panel of the resulting window. 64-Bit Windows Hosts To set up an externally visible subnet through a 64-bit Windows host. 5. 12. 5. Go to http://openvpn. 2.inf and click Open. 11. You must install it separately from Wind River Workbench. Choose the download method that uses Windows Installer. Click OK to select the directory. Select wrtap. To install it. Click OK to select the directory. click Next and then Finish. select Device Manager. Select Network Adapters. 9. Click Next to start installing the driver.net/ and find the download options for OpenVPN 2. click Next. 8. 32-Bit Windows 7 1. 3. right-click the computer’s hostname and select Install legacy hardware.2 Full Network Simulation: simnet 8. 10. Click Finish to close the wizard. Select WindRiver WRTAP.inf and click Open. 10. The TAP-Win32 driver is distributed as a part of the OpenVPN application.5 Networking with the VxWorks Simulator 5. you must install the TAP-Win32 driver. 9. On the left-hand side. 12. 4. Select Start. Click Next and then Install Once installation is complete. 3. the driver is not available in the core kernel package of Red Hat Workstation 3. the tun module is part of the kernel-unsupported RPM package. However.21-20 and install the kernel-unsupported RPM package. update 4 or earlier. start the network daemon with this updated configuration file. The tun module should be loaded automatically when vxsimnetd is started.Wind River VxWorks Simulator User's Guide. If you are using an earlier release of Red Hat (prior to Linux kernel version 2. Install the tap package as follows: # pkgadd -d tap Select the Universal TAP device driver and answer “yes” to run the install scripts. Linux Hosts The tun module required by the TAP driver must be available in your Linux distribution.o description: <none> author: <none> license: "GPL" 66 . To do this.4. It is also available as part of the default distribution for SuSE Linux 9.2. 6. Wind River recommends you rename the connection to a distinctive string (for example. some OS versions require you to load the module into the kernel. first check that the module is present: $ modinfo tun filename: /lib/modules/2. }.EL/unsupported/drivers/net/tun.9 NOTE: Because the TAP-Win32 driver may be used by several tools. such as Simics.0 and later versions. 5. SUBNET_EXT_CONNNAME="tap-vxsim". Go to the directory to which you copied the tap package. you must update your Linux kernel to version 2. SUBNET_EXTERNAL = yes.0".21-20.x/host/sun4-solaris2/bin/tap to a directory accessible by root. Solaris Hosts To install the VxWorks simulator host connection driver on a Solaris host: 1. 4. update 4 or earlier.4.0. To use the tun module with Red Hat Workstation 3.21-20). Then use a configuration file to specify the new connection name that the network daemon should use.200. For example: SUBNET_START default { SUBNET_ADDRESS="192. However. NOTE: The tun driver is available by default as part of the core kernel package for Red Hat Enterprise Linux Workstation 4.0. Then.168. Copy installDir/vxworks-6. tap-vxsim). 2. Log on with administrator privileges.4. To replace WRTAP as your main network connection. To do this. Certain communication protocols (particularly those which alter the maximum transmission unit (MTU) setting of the interface) can cause problems when the WRTAP driver is in use. You can use the WRTAP driver even if the ULIP driver is installed..3 Installing the Host Connection Driver. To access Windows network connection settings. it becomes the primary network connection type on your host system. NOTE: You need administrator privileges on the Windows host to make the following changes. The change only applies to the WRTAP interface that is used for communication between the host system and the VxWorks simulator. select Advanced > Advanced Settings. right click on each network connection and select Properties. you may need to remove all protocols except TCP/IP.5 Networking with the VxWorks Simulator 5. In some instances. do the following: ■ In the Network Connections (or Network and Sharing Center > Manage network connections) window. see the 5.63.2 Full Network Simulation: simnet To load the module into the kernel. Migrating from the ULIP Driver The WRTAP driver replaces the ULIP driver used in earlier VxWorks simulator releases. p.) Under the Adapters and Bindings tab. For instructions on installing the WRTAP driver. . This can cause other applications to run slowly and can cause failures on the host system. select Start > Control Panel > Network Connections (on Windows XP hosts) or Start > Control Panel > Network and Sharing Center > Manage network conne ctions (on Windows Vista hosts). move your main Ethernet interface to the top of the Connections list. you may need to make certain changes to your Windows network connection settings. NOTE: Removing all protocols except TCP/IP has no impact on the general host system. (On Vista hosts. uncheck all items and components except TCP/IP (Internet Protocol TCP/IP).2. Under the General tab. Handling Networking Problems on Your Host System If you encounter networking problems with the VxWorks simulator or your host system after installing the WRTAP driver. you need to press the Alt key to access the Advanced menu. When you install the WRTAP driver.. ■ 67 . type the following: $ modprobe tun Managing the WRTAP Driver on Windows Hosts The following information may be useful when installing and using the host connection (WRTAP) driver on a Windows host. the WRTAP network connection is turned on immediately following installation and uses DHCP to configure its IP address.4.168.4. The device the interface is using is listed in the Connect using field under the General tab.168.).1:0xffffff0.simnet3=192. To disable the WRTAP network connection. access the Windows network connection settings by selecting Start > Control Panel > Network Connections (on Windows XP hosts) or Start > Control Panel > Network and Sharing Center (on Windows Vista hosts). right-click the WRTAP network interface you want to disable and select Disable. 6. you can disable the WRTAP network connection after installation and allow it to be restarted and configured by the VxWorks simulator network daemon when necessary.4 Configuring a Simulated Subnet This section describes how to configure simulated subnets for use with the VxWorks simulator. In the Network Connections (or Network and Sharing Center) window.1:0xffffff0.168. simnet4=192. by default.2.) as a delimiter. p. (You can see that an interface is connected using the WRTAP driver by right-clicking and selecting Properties.) 5. However.168. see 5.Wind River VxWorks Simulator User's Guide.9 Disabling the WRTAP Driver IP address configuration for the WRTAP network connection is handled automatically by the VxWorks simulator network daemon. The syntax for this option is as follows: -ni deviceNameDeviceNumber:subnet=IP_address:IP_netmask This describes one interface. 68 .1:0xffffff0 NOTE: When launching the vxsim command from the command line on Linux and Solaris hosts. To avoid the DHCP configuration.simnet3=192. For example: % vxsim -ni "simnet2=192.2.69.2. you must use double quotation marks (") around the -ni option parameter values to prevent the UNIX shell from interpreting the semi-colon (.168.5 Configuring a Subnet Across Multiple Hosts Using wrnetdlink. vxsim includes the -ni option.1:0xffffff0" Double quotes should not be used when passing this option to the command line using Workbench or when using the command line on a Windows host.3. You can chain these descriptions together using a semi-colon (. simnet4=192. This command starts a VxWorks simulator instance configured with three simulated network interfaces that link the target with three very small subnets.1:0xffffff0. For information on configuring a subnet using multiple hosts (working with wrnetdlink).1:0xffffff0.3.2. Starting a Simulator Instance with Multiple Network Interfaces If you need to configure a VxWorks simulator instance with multiple network interfaces (a router configuration). For example: % vxsim -ni simnet2=192.168. 2 Full Network Simulation: simnet NOTE: When using the Wind River Workbench New Connection wizard to launch your VxWorks simulator. You can also use the following command: % vxsim -ni simnet0:default Use this command to start a VxWorks simulator instance that attaches to a subnet named default. the -ni option can be passed to the simulator using the Other VxWorks simulator options field of the VxWorks Simulator Miscellaneous Options dialog. NOTE: In this example. you can use the following commands: % vxsim -d simnet % vxsim -ni simnet These commands start a simulator that attaches to the first configured subnet (neither IPv4 address is specified). This tool allows you to link multiple subnets running on any number of multiple hosts by linking the subnets running on each host.3. In this example.5 Networking with the VxWorks Simulator 5. The first attaching simulator instance gets 7a:7a:0:0:0:1. the number of simulators that can be attached is limited by the processing power and the available memory of the host system.5 Configuring a Subnet Across Multiple Hosts Using wrnetdlink If you configure your simulated subnets on a single host using vxsimnetd (as described previously). Wind River provides the wrnetdlink tool. 5.168. you can use the following commands: % vxsim -d simnet -e 192. where 7a:7a is the subnet MAC prefix of the first configured subnet. a MAC address can no longer be deduced from the IP address so a node number is used instead. and the second instance gets 7a:7a:0:0:0:2.168.1 % vxsim -ni simnet1=192. 69 . Figure 5-3 illustrates this linking. To ease this limitation.1 This command sequence starts a VxWorks simulator instance with a simulated subnet interface with a MAC address of 7a:7a:c0:a8:03:01 and an IP address (or addresses) that can be configured later using the ifconfig( ) command.3. It is also possible to get a fixed MAC address by specifying an IPv4 address that is not used to configure the simnet interface if the component INCLUDE_NET_BOOT_CONFIG is not defined.2. For example. Starting a Simulator Instance without an IPv4 Address You can start a VxWorks simulator instance and attach to a subnet through its name. Thus. This may cause a problem with ARP tables. the MAC address is no longer fixed and can change if the simulator instance is rebooted. The MAC address is determined as described in the earlier example. net .168. 70 .1 VxSim<N> 192.2 Setting Up the Network Daemon. The default IP address (ipAddr) is 127.0 Host 1 Host 2 Therefore.168. it is used by default. 6. Note that all of the parameters supplied to wrnetdlink are optional.200.200.168.200. the first subnet configured on the host is used.1 (local host). p. The default subnet name is blank—if only one subnet on the host is available.Wind River VxWorks Simulator User's Guide. The default port number (portNumber) is 5555. using the default settings. which is the default value configured by vxsimnetd.2 Simulated subnet0 192. Start and configure wrnetdlink. Start a network daemon (vxsimnetd) on each host (see 5. portNumberN is the port number that the network daemon uses to accept connections. the general workflow for configuring multiple subnets is as follows: 1. An example command to use the default configuration might be: -> wrnetdlink ..n wrnetdlink VxSim1 192.net ipAddrN:portNumberN:subnetNameN where ipAddrN is the IP address or host name for the host that is running the network daemon (each host you wish to link must be running a network daemon). .net ipAddr1:portNumber1:subnetName1 . default values are used instead.2.200.0.50). You can also start multiple wrnetdlink sessions to connect multiple multi-host subnets. To start wrnetdlink and configure a multi-host subnet issue the following command from a VxWorks Development Shell: -> wrnetdlink .0 Simulated subnet<N> Simulated subnet<N> 192. 2.168.9 Figure 5-3 Linked Subnet across Multiple Hosts External Subnet WRTAP driver WRTAP driver vxsimnetd vxsimnetd VxSim0 192.168.net host2 This command links a subnet on the local host to one on host2.0. Otherwise.200. and subnetNameN is the name of the subnet running on the host. If the parameters are not specified.. 2:80 10.3.2:17185 10. 5.0. a number of ports are automatically redirected.10.2:49156 10. p. see Starting a Simulator Instance with Multiple Network Interfaces.10. Intercept all network packets from the VxWorks guest.5 Networking with the VxWorks Simulator 5. When you start the VxWorks simulator and specify simnet_nat as boot device.2:17476 10. vxsim_nat_redirs. you can configure additional simnet devices using the -ni option.10.10.0.2:49281 10.2:49282 10.10. For detailed information on the -ni option. However.10. No particular setup is necessary in order to access the network from the VxWorks simulator.2:3333 10. 71 .10.1 Using Default Redirections The VxWorks simulator stack is responsible for the following process: 1.0.0.x/host/resource/vxsim/.10.10. only one device can be configured.2:49154 10. For example: Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting Redirecting TCP TCP TCP TCP TCP TCP TCP UDP TCP TCP TCP TCP TCP TCP TCP TCP TCP TCP TCP TCP TCP TCP port port port port port port port port port port port port port port port port port port port port port port 58811 58812 58813 58814 58815 58816 58817 44071 58818 58819 58820 58821 58822 58823 58824 58825 58826 58827 58828 58829 58830 58831 to to to to to to to to to to to to to to to to to to to to to to 10.0.2:49155 10.10. 3. The VxWorks simulator provides network redirection through the simnet_nat device.0.10. The VxWorks simulator stack also performs subsequent tasks: 5.0. 6.10. Monitor the activity on the newly created UDP/TCP sockets.68.10.0. 7. p.2:22 10.0.0. Analyze them.0.txt.10.2:5698 10.2:49152 10.2:49280 10.10. Fix the headers on any received UDP/TCP packets.2:443 10.3 Network Redirection: simnet_nat 5. Forward the TCP/UDP packets to the correct destination by creating a UDP/TCP socket on the host. Filter out non-UDP and -TCP packets.0.10.2:49153 10.2:5678 10.10.0.10.0.10.2:69 10. 2. 4.0.2:23 10. On any given VxWorks simulator instance.48. Redirections are printed to the console.2:21 10.3 Network Redirection: simnet_nat As an alternative to the full network simulation described in 5.0.10.0. located at installDir/vxworks-6.0.2:49284 The default port redirections are also listed in a file. and port redirections are automatic.0.0.0.2 Full Network Simulation: simnet.2:49283 10.10. the VxWorks simulator also provides support for network redirection (NAT). Forward those packets to the VxWorks simulator network driver.2:1534 10.0.10. and so on. such as to connect a custom server application that is running on the simulator. if VxWorks is configured to provide an SSH or telnet server. tcp Redirect a TCP port. hostPortNumber The host port number that will be used to access the specified guestPortNumber. since it is not possible to obtain a value that will always be available. 72 .2 Adding a Network Redirection Besides the default redirections that are automatically performed. you can overwrite the default configuration by specifying a new guest port configuration. ■ ■ So. guestPortNumber The port number of the guest port you want to access. You can do this either from the command line or within Wind River Workbench. An optional parameter.72. 6.2 Adding a Network Redirection. Target TCP port 23 (telnet) can be reached through host TCP port 58813. use the -add_nat_redir (or -anr) option. use the VxWorks simulator command-line option -add_nat_redir.Wind River VxWorks Simulator User's Guide. respectively: ssh -p 58812 hostIp telnet -p 58813 hostIp Overriding Default Redirections Default redirections do not specify the host port value. If you do not define hostPortNumber. see Table 2-2 and 5. you would use the following to reach the target SSH and telnet server. p. This means that in the example in the previous section.3. From the Command Line To add a network redirection from the command line. The command-line setting overrides the default configuration.9 In the console output above: ■ Target or guest (that is. VxWorks) TCP port 21 (FTP) can be reached through host TCP port 58811. For details on the -add_nat_redir option. you can add a custom redirection.3. 5. The syntax for this option is as follows: -add_nat_redir udp|tcp:guestPortNumber[[:hostPortNumber[:portName]] udp Redirect a UDP port. To do so. 58812. the values of 58811. However. Target TCP port 22 (SSH) can be reached through host TCP port 58812. the VxWorks simulator automatically allocates a port number. and 58813 might change if the simulator is restarted. local port (host port). From Workbench To add a network redirection in Workbench.3. Select Network using NAT (simnet_nat) and click Add.5 Networking with the VxWorks Simulator 5. To view the output. For example: C:\WINDOWS>vxsim -list_nat_redir -l %TEMP%\output. ). 3. Go to the Target Connection Properties. do the following: 1. as part of a script. Examples udp:0x4321:2000 Redirects guest UDP port 0x4321 to host UDP port 2000. To specify multiple redirections.tcp:23 Redirects guest UDP port 0x4321 and guest TCP port 23 to random host UDP and TCP ports. 5. You can use this string so that you don’t have to remember the port number. In the dialog that appears. specify the desired protocol. For example: % vxsim -list_nat_redir -p 0 tcp:23:2000:telnet Windows Hosts On Windows hosts. 4. use the -p option to specify the corresponding processor number. and redirection name. and then read the contents of the file. use the -l option to save the simulator’s output to a file. Select the Network Options tab. remote port (guest port). the results of -list_nat_redir are not printed to standard output. To identify which VxWorks simulator instance you want information about. udp:0x4321 Redirects guest UDP port 0x4321 to a random host UDP port. You can get the full list of redirections through the -list_nat_redir (or -lnr) command-line option to the simulator. 2.3 Listing Network Redirections It can be useful to view the list of redirected ports for a particular VxWorks simulator instance—for example. udp:0x4321.txt tcp:23:2000:telnet 73 .txt -lc -p 0 C:\WINDOWS>cat %TEMP%\output. separate them with a semicolon character ( .3 Network Redirection: simnet_nat portName A string that Wind River Workbench uses to identify the port’s purpose when the host port number may vary. x). Multiple instances of the VxWorks simulator that are configured to include network redirection cannot communicate using the network-redirection IP addresses (10. or you can configure it with a simnet_nat device only. You can configure the VxWorks simulator to include both simnet_nat and simnet devices. In either case. ■ ■ ■ ■ ■ 74 . the simnet_nat device must be your boot device. The simnet_nat device cannot be manually loaded from VxWorks.0. However. when you do so each port redirection must be different. You cannot change the gateway IP address and simnet_nat network device IP address from VxWorks. multiple simulator instances cannot use the same host port.10. however. It does not support IPv6. a single redirection-enabled simulator instance can access an IP port on another redirection-enabled simulator instance by means of the host IP address and the host redirected port. in order to use network redirection.Wind River VxWorks Simulator User's Guide.3. 6. The network redirection facility supports IPv4 and TCP/UDP packets only.4 Limitations The VxWorks simulator’s network redirection capability has the following limitations: ■ While you can start several VxWorks simulator instances using the simnet_nat device on the same host. You cannot add a simnet_nat device through the -ni command-line option. That is.9 5. 1 Introduction This chapter presents tutorials that provide step-by-step instruction for setting up a variety of simulated networks with VxWorks simulator instances. Adding a VxWorks simulator to a local network—Tutorial to demonstrate how to plug the VxWorks simulator directly into a local network through a bridge configured on the host system. ■ Simple simulated network—Tutorial to set up a simple network connection between the host system and a single simulator instance. ■ ■ ■ 75 . select Window > Open Perspective > Advanced Device Development.6 Networking Tutorials 6. Networking across multiple hosts—Tutorial illustrating how the wrnetdlink tool can be used to configure subnets across multiple host systems.6 IPv6 Tutorial 97 6.1 Introduction 75 6. The following tutorials are presented: NOTE: Workbench instructions in this chapter assume that the Workbench Advanced Device Development perspective is displayed.3 Basic Simulated Network with Multiple Simulators 79 6.5 Adding a VxWorks Simulator to a Local Network 93 6. To display the Advanced Device Development perspective. Simulated network with multiple simulator instances—Tutorials for setting up a basic network with multiple simulators using both static and interactive configuration methods for the VxWorks simulator network daemon (vxsimnetd).4 Networking Across Multiple Hosts with wrnetdlink 89 6.2 Simple Simulated Network 76 6. The title bar at the upper left of the Workbench window shows the current perspective. 2.9 ■ IPv6—Tutorial to demonstrate how to configure a VxWorks simulator network with IPv6 support.3.simnet4=192. start the network daemon on the host before you configure any VxWorks simulator instances. Test the simulator network by pinging the VxWorks simulator instance from the host. 3. 6.1. If you have not already installed the host connection driver. p. the following line: % vxsim -ni simnet2=192.168. 6.1 should be executed as follows when using the Linux or Solaris command-line interface: % vxsim -ni "simnet2=192.63.200. you must install the VxWorks simulator host connection driver (WRTAP driver). Most of the tutorials in this chapter demonstrate network simulation using the ping( ) routine. This tutorial can be performed with any supported host using the command-line utility. 76 .1. Start a single VxWorks simulator instance. the following tutorial does not require you to reconfigure or rebuild the default VxWorks image provided with the VxWorks simulator BSP.1" Double quotation marks should not be used when passing options to the command line using Workbench or when using the command line on a Windows host. For example. For this tutorial.simnet3=192.168. Installing the VxWorks Simulator Host Connection Driver Before configuring and starting the VxWorks simulator network daemon.3 Installing the Host Connection Driver.1.1 Set Up the Network Daemon The first step in setting up a VxWorks simulator network is to start the network daemon. NOTE: When launching the vxsim command from the command line on Linux and Solaris hosts (as instructed in the tutorials throughout this chapter). 6.4.4. You can set up this simple network using the default VxWorks simulator configuration.2 Simple Simulated Network The most basic (and common) network used by the VxWorks simulator is a network set up between the host and a single VxWorks simulator instance.168.simnet3=192. Set up and start the VxWorks simulator network daemon (vxsimnetd).Wind River VxWorks Simulator User's Guide.168.1. vxprj.168.).2.168. 2. do so now. Instructions for all supported hosts are provided in 5. Therefore.200.simnet4=192. or Wind River Workbench.3. This tutorial describes how to: 1. you must use double quotation marks (") around the -ni option parameter values to prevent the UNIX shell from interpreting the semi-colon (. 51.2 Simple Simulated Network Configuring the Network Daemon This tutorial uses the default configuration for the VxWorks simulator network daemon. vxsimnetd can be started without any options and no custom configuration file is required. see Creating a Network Daemon Configuration File. Open a host shell and log in as root. the default VxWorks configuration is used for this tutorial.x\host\x86-win32\bin\vxsimnetd where installDir is the name of your VxWorks installation directory.. If you have already started the default vxsimnetd as a service or choose to do so now. Again. see Starting the Network Daemon as a Service. Open a host shell and log in as root.x/host/sun4-solaris2/bin/vxsimnetd where installDir is the name of your VxWorks installation directory.59. Log in as administrator or be sure you have administrator privileges. you must change the VxWorks simulator network daemon configuration file. therefore. type the following: # installDir/vxworks-6. On Solaris hosts: 1. Starting the Network Daemon on the Host System NOTE: Wind River recommends that you start vxsimnetd as a service. 2.. 6.200. p. you need to start a VxWorks simulator instance from the command line in the VxWorks Development Shell or from the Workbench New Target Connection wizard. you do not need to reconfigure or rebuild the default VxWorks image for the VxWorks simulator. 2.2. Open a Windows command shell (Start > Run. On Linux hosts: 1. p. you can skip the instructions in this section. Therefore. then type cmd). For complete instructions. 77 . For more information on the default configuration options as well as other network daemon configuration file options. NOTE: The default configuration uses a default subnet of 192. 3.2 Start a VxWorks Simulator Instance Next.6 Networking Tutorials 6.0.x/host/x86-linux2/bin/vxsimnetd where installDir is the name of your VxWorks installation directory. In the command shell.. If this subnet already exists on your host. 2. In the host shell. type the following: C:\> installDir\vxworks-6. In the host shell. To start the VxWorks simulator network daemon in the default configuration: On Windows hosts: 1. type the following: $ installDir/vxworks-6.168. Click the Advanced Boot Parameters.x and General Purpose Technologies > Vx Works Development Shell. Enter 0 in the Processor Number field (this is the default value).200. 4. enter 192. 6. In the Inet on ethernet (e) field. Start the Simulator Instance from Workbench To start the VxWorks simulator instance from Workbench. On Windows hosts.168.1" -f "installDir/vxworks-6. do the following: 1.168.1 -f installDir\vxworks-6.168. Click Next to accept the default options.200. Click OK. On Linux or Solaris hosts: % vxsim -d "simnet" -e "192. On Solaris and Linux hosts. Leave all other fields with their default settings.. select Start > Wind River > VxWorks 6. select simnet from the drop down list. 3. 6. Open the VxWorks Development Shell. 5. click the Standard simulator (Default) radio button (this option should be selected by default). In the VxWorks Development Shell. 2. The VxSim0 console windows appears.x\target\config\simpc\vxWorks where installDir is the name of your VxWorks installation directory. select Wind River VxWorks 6.x/target/config/bsp/vxWorks" where installDir is the name of your VxWorks installation directory and bsp is the name of the BSP directory for the VxWorks simulator on your host (linux for Linux hosts or solaris for Solaris hosts).. run the wrenv utility program to open a development shell as follows: % wrenv. Select Target > New Connection. button. In the boot device field. In the Connection Type dialog box.sh -p vxworks-6. This selects the default VxWorks image for the VxWorks simulator..200. 78 . type the following: On Windows hosts: C:\> vxsim -d simnet -e 192.1 (this is the default value). The VxSim Memory Options dialog appears.Wind River VxWorks Simulator User's Guide.9 Start the Simulator Instance from the Command Line To start a VxWorks simulator instance from the command line. click Next. This returns you to the VxWorks Boot parameters dialog of the New Connection wizard.. The above command starts a VxWorks simulator instance and attaches it to the default subnet. complete the following steps: 1.. Click Next. This launches the New Connection wizard.x Simulator Connection from the selection list. In the Select boot file name field of the VxWorks Boot parameters dialog.x 2. type: % ping 192. If your target connection fails or you encounter problems during configuration. p. (For more information on the VxWorks simulator network daemon.168. if you require more information on building and configuring VxWorks. Two configuration options are described. see 5. see Wind River Workbench By Example: Configuring and Building VxWorks and the user’s guide for your Platform. Click Next to accept the default options (most options are blank by default). The steps required to build and configure the image are included in this tutorial. 9. The Target State Refresh dialog appears. From a host command window or shell. 6.3 Test the Simulated Network To test that the simulated network is working. However. 12. Click Finish. 8.50.3 Basic Simulated Network with Multiple Simulators The following tutorials present the steps required to set up a simulated network with multiple VxWorks simulator instances.2. 79 .2. The Connection Summary dialog appears.1 6. Click Next to accept the default options. Click Next to accept the default options. The Target Server Options dialog appears. The second tutorial launches the VxWorks simulator network daemon (vxsimnetd) in interactive mode.3 Basic Simulated Network with Multiple Simulators 7. 11. 10.200. ping the simulator instance from your host system. The first tutorial creates a subnet with a static configuration. see the Wind River Workbench By Example: Connecting to VxWorks Targets for more information. Click Next to accept the default options. Click Next to accept the default options. This boots VxWorks on the simulator target and launches the VxSim0 console window.) The following tutorials require you to configure and build a new VxWorks image for the VxWorks simulator. The Object Path Mappings dialog appears.2 Setting Up the Network Daemon. The interactive mode starts a vxsimnetd shell that allows you to dynamically configure and monitor the subnet. The VxWorks Simulator Miscellaneous Options dialog appears.6 Networking Tutorials 6. The Debug Options dialog appears. Create a vxsimnetd configuration file. 80 .x\host\x86-win32\bin\vxsimnetd -f vxsimTest. Launch vxsimnetd using the configuration file you just created.168. Configure and Launch vxsimnetd 1. SUBNET_EXTERNAL = no. }. SUBNET_START sub4 { SUBNET_ADDRESS = "192. see Starting the Network Daemon as a Service.0". be sure that you have: ■ Installed the VxWorks simulator host connection driver (WRTAP driver). 6. Step 1: Configure and launch the VxWorks simulator network daemon (vxsimnetd). p.) Stopped any previously started VxWorks simulator network daemons (including those started as a service.168.0".Wind River VxWorks Simulator User's Guide. 3. 4.168. On Windows hosts: Log in with administrator privileges and start vxsimnetd from a command window as follows: C:\> installDir\vxworks-6. The first step in setting up your simulated network is to set up and start vxsimnetd.63.x/host/myHost/bin/vxsimnetd -f vxsimTest.conf: SUBNET_START sub2 { SUBNET_ADDRESS = "192. SUBNET_START sub3 { SUBNET_ADDRESS = "192.83).conf Be sure to provide the full path to your vxsimTest.conf file if it is not in your current directory. Create the following file and save it as vxsimTest.2. On Linux and Solaris hosts: Log in as root and start vxsimnetd from a host shell as follows: # installDir/vxworks-6. For the purposes of this tutorial. Launch the required simulator instances.3 Installing the Host Connection Driver.0". }.4.3.conf In this command. SUBNET_EXTPROMISC = yes. p. SUBNET_EXTERNAL = no. p. SUBNET_EXTERNAL = yes. myHost is your host type: x86-linux2 for Linux hosts or sun4-solaris2 for Solaris hosts. The general workflow is as follows: 1.1 Creating a Static Configuration The following tutorial takes you through the steps of creating a simulated network with a static configuration.200.51). Configure and build a VxWorks image for use with the VxWorks simulator instances.9 6. }. 3. this file is used to configure the network for use with a simulated router (see Configure and Start the Simulated Router. (Instructions for installing the driver are available in 5. Run the ping application. Before completing the following steps. 2.3. ■ 2. you will need to configure the daemon as directed in this section (by passing the -f option to the service) before proceeding with the tutorial.51. NOTE: You can also start vxsimnetd as a service. type the following: On Windows hosts: C:\> vxprj create simpc TOOL network_demo where TOOL is your chosen compiler (diab for the Wind River Diab Compiler or gnu for the GNU compiler). therefore. In this case. you will not be able to connect the host system to the simulated network. vxprj. see Starting the Network Daemon as a Service. This can be done from the command line as follows: In the VxWorks Development Shell.3 Basic Simulated Network with Multiple Simulators Be sure to provide the full path to your vxsimTest. To properly configure the VxWorks image. Because this functionality is not included in the default VxWorks image. On Solaris hosts: % vxprj create solaris TOOL network_demo where TOOL is your chosen compiler (diab for the Wind River Diab Compiler or gnu for the GNU compiler). the VxSim0 simulator instance acts as a router.conf file if it is not in your current directory. On Linux hosts: $ vxprj create linux TOOL network_demo where TOOL is your chosen compiler (diab for the Wind River Diab Compiler or gnu for the GNU compiler). complete the following steps: 1. p.6 Networking Tutorials 6. Once this configuration is in place. If you choose to start vxsimnetd as a service. ping functionality must be enabled. Step 2: Prepare a VxWorks Image for Use with the Simulated Network In this tutorial. However. Prepare Your VxWorks Image Using the vxprj Command-Line Utility To reconfigure the VxWorks image with the necessary components using the command-line project facility. For instructions. all other simulated network functionality is available. Generate a project. you must rebuild the VxWorks image for the simulator. This creates a project directory under installDir with the name network_demo. you must configure and build a new VxWorks image for use with the simulated network. Add the INCLUDE_ROUTECMD and INCLUDE_PING components to the image: % cd network_demo % vxprj component add INCLUDE_ROUTECMD INCLUDE_PING 81 . 2. you must include the INCLUDE_ROUTECMD and INCLUDE_PING components in your custom VxWorks image. This tutorial uses ping to communicate between simulator instances. NOTE: If you do not start vxsimnetd with administrator (or root) privileges. vxsimnetd prints a warning. Click Next. a. To display the Advanced Device Development perspective. execute make. Right-click the selected component and select Include (quick include). select File > New > VxWorks Image Project. d. b. This creates a project directory with the name. select (no profile) from the Profile drop-down list (this is the default). This launches the New VxWorks Image Project wizard. The new project appears in the Project Navigator pane on the left. Now. Rebuild VxWorks. 3. simpc on Windows hosts) and your desired tool chain (for example. In the project directory (installDir/network_demo). In the Options dialog. Prepare Your VxWorks Image Using Workbench 1. In the Project dialog. Right-click in the component tree and select Save. Select the Components tab at the bottom of the kernel configuration pane (if it is not already selected). Select the location for your project in the Location field (Create Project in Workspace is selected by default). e. Build your project. The selected component is highlighted in the component tree. In the Project Setup dialog. right-click on the network_demo project in the Project Navigator (upper left pane) and select Build Project (this executes the make 82 . 6. select the option to set up your project based on a board support package (this option is selected by default). d. In Workbench.9 3. The title bar at the upper left of the Workbench window shows the current perspective. To find a component. Select the appropriate VxWorks simulator BSP for your host (for example. 2. The following steps assume that the Workbench Advanced Device Development perspective is displayed. Click Next. This returns you to the component configuration tool. select Window > Open Perspective > Advanced Device Development. Use the Find tool to locate the INCLUDE_ROUTECMD and INCLUDE_PING components. Select Edit Kernel Configuration. Create a VxWorks image project. b. select the component and click the Find button. c. INCLUDE_PING) in the Pattern field. enter network_demo in the Project name field. diab for the Wind River Diab Compiler). a. Right-click in the component configuration field and select Find. c. Expand the new network_demo project and right-click Kernel Configuration. Click Finish.Wind River VxWorks Simulator User's Guide. In the Configuration Profile dialog. This opens the component configuration tool in the center pane of the Application Development window. type the component name (for example. click Next to accept the default options (no options are selected by default). Configure a custom VxWorks kernel to include the appropriate networking components. When the component appears in the Matching list. a. network_demo. 168.3.168.4.168.1 simnet3 VxSim3 192. Start the VxWorks Simulator Instances from the Command Line If you have not already done so. Once you execute this command.simnet3=192. change to the directory where you built your VxWorks image (for example.4.168.1 simnet2 VxSim1 192.2 VxSim2 192.6 Networking Tutorials 6.200.2 You can launch the simulator instances from the VxWorks Development Shell using the command line. the VxSim0 console window appears.1 simnet4 192.168. or from Workbench. 3.1.254 VxSim0 (router) 192.3. Configure and Start the Simulated Router To configure the VxWorks simulator instance for the simulated router.2 192. type the following in the VxWorks Development Shell: -> vxsim -ni simnet2=192. Step 3: Launch the VxWorks Simulator Instances Start the simulator instances to attach to the configured subnets. installDir/network_demo/default).simnet4=192. The build output appears in the Build Console (lower right pane).168.200.200.4.200.168.168.1.168. This results in a simulated network with the following topology: Host 192.) 83 .3 Basic Simulated Network with Multiple Simulators command in the project directory).1 This command sets up a network interface for the router on each subnet so that it can properly forward packets.168. (The VxSim0 instance acts as the simulated router. . complete the following steps: 1. This option sets up a network interface for the router on each subnet so that it can properly forward packets. 84 . The Object Path Mappings dialog appears. The VxWorks Simulator Miscellaneous Options dialog appears. In the Other VxWorks simulator options field. This launches the New Connection wizard... and VxSim3. Browse to your project location and click Open to select your VxWorks image (for example. In the Select boot file name field of the VxWorks Boot parameters dialog.80). Click Next to accept the default options.3.1. Click Next to accept the default options.168. The VxSim Memory Options dialog appears. 6. p.x Simulator Connection from the selection list. 6. Click Next to accept the default options. 7. The Debug Options dialog appears.3. type the following in the VxWorks Development Shell: -> vxsim -d simnet -e 192.2 -p 3 This command creates three instances on the simulated network. Click Next to accept the default options.simnet3=192. select Wind River VxWorks 6. To start this instance from Workbench. Click Next.4.168. Configure and Start the Simulated Router Start the VxWorks simulator instance that will act as the router in the simulated network.Wind River VxWorks Simulator User's Guide. Click Next.168.168.168. Enter 0 in the Processor Number field.200. 11. 9.9 Configure and Start the Simulated Network Instances To configure three VxWorks simulator instances on the simulated network. Click Next to accept the default options. click the Custom simulator radio button. In the Connection Type dialog box.2 -p 2 -> vxsim -d simnet -e 192. 5. 10.168. One node is created on each of the three subnets you set up when you launched vxsimnetd (see Step 1:Configure and Launch vxsimnetd.1 3. 4. 8.2 -p 1 -> vxsim -d simnet -e 192. The Target Server Options dialog appears.4. Select Target > New Connection.1. The Connection Summary dialog appears. installDir/workspace/network_demo/default/vxWorks). The Target State Refresh dialog appears. 2. Click Next. enter: -ni simnet2=192.200. VxSim2.simnet4=192. Click Finish. VxSim1. Start the VxWorks Simulator Instances from Workbench This section provides instructions for launching the simulated router and networked VxWorks simulator from Workbench using the Advanced Device Development perspective. 6. 4. enter 192. Click Next to accept the default options (most options are blank by default).) Click the Advanced Boot Parameters. 7. Repeat this process three times to create three VxWorks simulator instances. 10. one instance per subnet (repeat the following process for each of the three instances). 5. Click Next. VxSim1.3. complete the following steps: 1.6 Networking Tutorials 6.3 Basic Simulated Network with Multiple Simulators This boots VxWorks on a simulator target and launches the VxSim0 console window. The VxWorks Simulator Miscellaneous Options dialog appears. In the boot device field. In the Connection Type dialog box.200.. Click Next to accept the default options. select simnet from the drop down list. Click OK. and VxSim3. VxSim0 acts as a router on the simulated network. Configure and Start the Simulated Network Instances Configure three VxWorks simulator instances. select Wind River VxWorks 6. button.168. Click Next to accept the default options. Click Next to accept the default options.x Simulator Connection from the selection list. The Debug Options dialog appears. The VxSim Memory Options dialog appears. In the Inet on ethernet (e) field. Select Target > New Connection. 9.. The Target Server Options dialog appears.. Click Finish. 3. p..2 when starting the second instance and 192. (Enter 2 for this option when starting the second instance and 3 when starting the third instance. VxSim2. 2. This launches the New Connection wizard. (Enter 192.2. This results in a node being configured on each of the three subnets you set up when you launched vxsimnetd (see Step 1:Configure and Launch vxsimnetd. Click Next. The Object Path Mappings dialog appears. Enter 1 in the Processor Number field. 11.. 8. In the Select boot file name field of the VxWorks Boot parameters dialog. Browse to your project location and click Open to select your VxWorks image (for example.168. The Target State Refresh dialog appears. Click Next to accept the default options. Click Next to accept the default options. This returns you to the VxWorks Boot parameters dialog of the New Connection wizard. The Connection Summary dialog appears. Leave all other fields with their default settings.80). installDir/workspace/network_demo/default/vxWorks). 12. click the Custom simulator radio button.2 when starting the third instance). 85 . To configure each of the devices.4.168. type the following: -> routec ("add -net 192.3.0/24 192.200.168.2 Creating a Dynamic Configuration Using the vxsimnetd Shell The following steps demonstrate how to dynamically configure the VxWorks simulator using the network daemon shell.168.0/24 192.1").168. specify the saved file as a startup script when invoking vxsim from the command line as follows: % vxsim -d simnet -e 192.9 Step 4: Set Up the Routing Table Before pinging between simulator instances. NOTE: This tutorial is an extension of the static configuration tutorial presented in 6.168. start vxsimnetd with the -sv option as follows: # installDir\vxworks-6. You can also specify the startup script when launching the simulator from Workbench by adding the startup script to the startup script (s) field in Advanced Boot Parameter Options. To do this.1").200.3. 6. In the VxSim2 shell. type the following: -> routec ("add -net 192.168.3.3. be sure to kill all previously started VxWorks simulator instances and then kill the previously started network daemon. In the VxSim1 shell. Step 1: Launch the vxsimnetd Shell Server Before launching a the vxsimnetd shell server.168.0/24 192.0/24 192.168.168.2".1").168.168. type the following: -> routec ("add -net 192.80.4.1").168.3.0/24 192. 5 -> ping "192. p. -> routec ("add -net 192.4.1"). Start the vxsimnetd shell server. NOTE: These route settings can be saved in files and run automatically.0/24 192. From the command shell on Windows or the host shell on Linux or Solaris.Wind River VxWorks Simulator User's Guide.200.200.200.1"). 1. In the VxSim3 shell.168.168.3.2".168. ping VxSim3 and VxSim2 from VxSim1 as follows: -> ping "192. -> routec ("add -net 192. Step 5: Run the Ping Application To verify the network connections.4.3. -> routec ("add -net 192.2 -p 1 -s filename where filename is the name of your startup script.1 Creating a Static Configuration.4. you must set up the routing table for the simulated network. 5 6. You must use the VxWorks image you created in the earlier tutorial to launch the VxWorks simulator instances in this tutorial.x\host\myHost\bin\vxsimnetd -sv 86 .4.168. administrator privileges are no longer required. Source the new configuration file as follows: vxsimnetd> source /myDir/sub_3_4. p.3. Step 4: Launch the VxWorks Simulator Instances Launch the VxWorks simulator instances as described in Step 3:Launch the VxWorks Simulator Instances. From the host shell.conf Subnet(s) <sub3. NOTE: If you have already completed the tutorial in 6. The vxsimnetd debug shell appears. this sets up a simulated network with the following topology: 87 .1 Creating a Static Configuration. 4. SUBNET_EXTERNAL = no. p. sub4> added. you must create an additional subnet configuration file.80. Create and save the following file: SUBNET_START sub3 { SUBNET_ADDRESS = "192. }. SUBNET_START sub4 { SUBNET_ADDRESS = "192. Step 2: Configure vxsimnetd Dynamically Using the Shell 1.83.0".0". Save this file as sub_3_4. 2.conf.3. }.4. p. Again. prepare a VxWorks image according to the instructions in Step 2:Prepare a VxWorks Image for Use with the Simulated Network. Once vxsimnetd is started. type the following: % telnet yourHostName 7777 where yourHostName is the name of your host machine.168. Step 3: Prepare a VxWorks Image If you have not already done so.6 Networking Tutorials 6.3 Basic Simulated Network with Multiple Simulators NOTE: You must start vxsimnetd with administrator (or root) privileges. you can use the VxWorks image you prepared in the network_demo project.168.81. 3. SUBNET_EXTERNAL = no. To configure vxsimnetd using the shell. Connect to the vxsimnetd shell. For Windows hosts: Type the following from the Windows command shell: C:\> route add 192.0 MASK 255.2 Step 5: Set Up the Routing Table In the current configuration.4.168.168.168.1 Next.168. add the appropriate routing information to the VxSim2 instance.168.0 192.1 C:\> route add 192.0 192. NOTE: To run the following route commands. before pinging the host.3.3.0 192. However.0/24 192.168.168.168.255. type the following: -> routec ("add -net 192.200.168. In the VxSim2 console. you must have administrator privileges on Windows and supervisor privileges on UNIX.200. provide the appropriate routing information on your host system.168.255.2 VxSim3 192.2 VxSim2 192.168. First. In the VxSim3 console.200.1 % route add -net 192.168.255. 88 .168. type the following: -> routec ("add -net 192.Wind River VxWorks Simulator User's Guide.0 192.4.4. you must add the appropriate route information.1 192.1").200.3. 6.168.4.9 Host 192.168.200.254 VxSim0 (router) 192.0/24 192. add the appropriate routing information to the VxSim3 instance.168.200.1 For Solaris and Linux hosts: Type the following from the host shell: % route add -net 192.168.1").168. VxSim2 is configured to be externally available so it can be pinged from the host.168. 3.4.200.1 VxSim1 192.200.1 192. Now.255.200.3.0 MASK 255. Before starting the network daemon on each host.200. Note that the WRTAP driver is required for the purposes of 89 . The tutorial then illustrates how to link the simulated subnets using wrnetdlink.0 Note that this tutorial makes a connection between two host systems but any number of host systems can be connected—or chained together—in a similar fashion. The tutorial begins by starting two simulated subnets.4.1 Set Up the Network Daemon on Each Host Before connecting the hosts. Also note that the host systems can be of any supported host type.4.168.168.168.2 % ping 192. one on each of two separate host systems.4 Networking Across Multiple Hosts with wrnetdlink This tutorial describes how to set up a simulated network across multiple hosts. The following figure shows the network topology for this tutorial: Real Subnet Host 1 vxsimnetd vxsimnetd Host 2 VxSim1 192. For example.1 wrnetdlink VxSim2 192.168.168.200.168. To set up the daemon on each host using a static configuration file. do the following: 1.2 Simulated subnet0 192.200.3.6 Networking Tutorials 6. 6.200.2 6. you can connect a Windows host to a Linux host. be sure that you have done the following: ■ Installed the VxWorks simulator host connection driver (WRTAP driver) on each host.0 Simulated subnet0 192. you must configure and launch the network daemon (vxsimnetd) on each host.4 Networking Across Multiple Hosts with wrnetdlink Step 6: Run the Ping Application Verify the network connection by pinging VxSim2 and VxSim3 from the host shell as follows: % ping 192. ■ Stopped any previously started VxWorks simulator network daemons on each host (including those started as a service. Open a host shell and log in as root. WRTAP is not a requirement for using wrnetdlink. 6. Generate a project. Launch vxsimnetd on each host with the default configuration. b.3 Basic Simulated Network with Multiple Simulators. 6.3 Installing the Host Connection Driver. Prepare Your VxWorks Image Using the vxprj Command-Line Utility To reconfigure the VxWorks image with the necessary components using the command-line project facility. b.Wind River VxWorks Simulator User's Guide. Otherwise. c.63. This can be done from the command line as follows: In the VxWorks Development Shell. Log in as administrator or be sure you have administrator privileges. p. p.2 Configure a VxWorks Image on Each Host You must properly configure a custom VxWorks image on each host for use with this tutorial.2.x/host/x86-linux2/bin/vxsimnetd where installDir is the name of your VxWorks installation directory. In the host shell.79. type the following: C:\> installDir\vxworks-6. see 5..4. Open a host shell and log in as root.51). vxprj.. In the command shell. type the following: On Windows hosts: C:\> vxprj create simpc TOOL netdlink_demo 90 . type the following: $ installDir/vxworks-6. then type cmd). For more information and installation instructions. The custom image should include the INCLUDE_ROUTECMD and INCLUDE_PING components. b. follow the instructions below. However. Open a Windows command shell (Start > Run. p. see Starting the Network Daemon as a Service. NOTE: If you already generated a custom VxWorks image as directed in 6..3 Start a Simulator Instance on Each Host.92. p.x/host/sun4-solaris2/bin/vxsimnetd where installDir is the name of your VxWorks installation directory. On Solaris hosts: a. In the host shell. complete the following steps: 1. you can use that image for this tutorial and skip to 6. assuming that you do not require connectivity with the host system.x\host\x86-win32\bin\vxsimnetd where installDir is the name of your VxWorks installation directory. 2. type the following: # installDir/vxworks-6.9 this tutorial. On Linux hosts: a. On Windows hosts: a.4. On Solaris hosts: % vxprj create solaris TOOL netdlink_demo where TOOL is your chosen compiler (diab for the Wind River Diab Compiler or gnu for the GNU compiler). e. In Workbench. a. 91 . In the Options dialog. select (no profile) from the Profile drop-down list (this is the default). Add the INCLUDE_ROUTECMD and INCLUDE_PING components to the image: % cd netdlink_demo % vxprj component add INCLUDE_ROUTECMD INCLUDE_PING 3. The new project appears in the Project Navigator pane on the left. In the project directory (installDir/netdlink_demo). enter netdlink_demo in the Project name field. 2. Rebuild VxWorks. This opens the component configuration tool in the center pane of the Application Development window. In the Configuration Profile dialog. netdlink_demo. select File > New > VxWorks Image Project. b. 2. Right-click in the component configuration field and select Find. Expand the new netdlink_demo project and right-click Kernel Configuration. diab for the Wind River Diab Compiler). Select the appropriate VxWorks simulator BSP for your host (for example. c. Configure a custom VxWorks kernel to include the appropriate networking components. In the Project Setup dialog. d. Select the Components tab at the bottom of the kernel configuration pane (if it is not already selected). Click Next. click Next to accept the default options (no options are selected by default). execute make. Select the location for your project in the Location field (Create Project in Workspace is selected by default).4 Networking Across Multiple Hosts with wrnetdlink where TOOL is your chosen compiler (diab for the Wind River Diab Compiler or gnu for the GNU compiler). This creates a project directory under installDir with the name. Select Edit Kernel Configuration. This launches the New VxWorks Image Project wizard. Click Finish. This creates a project directory with the name. select the option to set up your project based on a board support package (this option is selected by default). On Linux hosts: $ vxprj create linux TOOL netdlink_demo where TOOL is your chosen compiler (diab for the Wind River Diab Compiler or gnu for the GNU compiler). In the Project dialog. Click Next. netdlink_demo.6 Networking Tutorials 6. simpc on Windows hosts) and your desired tool chain (for example. Prepare Your VxWorks Image Using Workbench 1. a. Generate a project. Use the Find tool to locate the b. Right-click the selected component and select Include (quick include). This returns you to the component configuration tool. launch the wrnetdlink utility using the following command: -> wrnetdlink -net -net host2 where hostname2 is the IP address or host name of the second host.3 Start a Simulator Instance on Each Host Start a VxWorks simulator instance on each host. 6. launch the VxWorks simulator instance (VxSim1) from the VxWorks Development Shell as follows: -> vxsim -d simnet -e 192. Right-click in the component tree and select Save. c. specifying the same parameters. a. Build your project.200.168. The second -net flag specifies a connection to the network daemon running on host2 using the default port and connecting to the first configured subnet. INCLUDE_PING) in the Pattern field.4. 92 . d.4 Connect the Simulated Subnets Using wrnetdlink From the VxWorks Development Shell on the first host. 3.1 -p 1 On the second host.200. be sure to change to the directory where you built your VxWorks image (for example.2 -p 2 NOTE: You can also start the VxWorks simulator instances from Workbench. 6.Wind River VxWorks Simulator User's Guide.0). 6. The selected component is highlighted in the component tree. When the component appears in the Matching list. the first -net flag (with no parameters) specifies a connection to the local host network daemon on port 5555 and connecting to the first configured subnet (in this case. launch the VxWorks simulator instance (VxSim2) from the VxWorks Development Shell as follows: -> vxsim -d simnet -e 192. The build output appears in the Build Console (lower right pane). select the component and click the Find button. Before launching each simulator.4. installDir/netdlink_demo/default).200. To find a component. Right-click on the netdlink_demo project in the Project Navigator (upper left pane) and select Build Project (this executes the make command in the project directory).9 INCLUDE_ROUTECMD and INCLUDE_PING components. On the first host.168. In the above command. the default is 192.168. type the component name (for example. you must set up the following routes: 93 .168.10.200.200.10.5 Adding a VxWorks Simulator to a Local Network This tutorial demonstrates how to plug the VxWorks simulator directly into your local network through a bridge configured on your host.10.1 VxSim 192.0).0 In this case. vxsimnetd configures the WRTAP interface with an IP address of 192. 6. The following diagram shows a VxWorks simulator host machine and another host machine on the same local subnetwork.200.168.168.2 VxSim subnet 192.0) and the VxWorks simulator subnet (192. From the VxWorks simulator instance on the second host.10. VxSim host 10.1 Default Subnet Configuration By default.200.10.2 IP forwarding Tap/WRTAP interface 192.200.1 6.0 Host 10.168.10. the host machine appears as a gateway between two subnets: the local one (for example.5 Adding a VxWorks Simulator to a Local Network 6.10.10. you can ping the VxWorks simulator instance on the first host as follows: -> ping 192.200.10.10. 10.4.254 Local subnet 10.1 Local interface 10.168. In this configuration.5.6 Networking Tutorials 6.5 Test the Simulated Network You can now test the simulated network using the ping application.10. if you want to access host 10.168.254.168.200.2 VxSim 192.1 from the VxWorks simulator.10. 5.2 6.10.40 VxSim subnet 10.10.2 to ping any host on the local subnet (without having to set up additional routes).10.254" 2.0 Host1 10.10.30 VxSim1 10. you can connect the VxWorks simulator directly to your local network through a bridge—configured on your host machine—between the local network interface and the WRTAP interface.10. For example.2 VxSim0 10.10.10. The following diagram illustrates this configuration: VxSim host2 10.168. Indicate that you can reach the 10.0 10.1 Local interface 10.10.200.2 Configuring a Bridge To simplify route settings.0 94 .254 Local subnet 10.10.200.0 gw 10.Wind River VxWorks Simulator User's Guide.168.168.255.0 mask 255.10.10.10.168.10.10.200.10. The goal of setting up such a bridge is to allow a VxWorks simulator instance started on 10.10.2 is the gateway to reach the 192.0 network.10. On each remote host.10.10.10. indicate that host 10.10.200.10.10.168.10.10.200.255.0 subnet through the host interface 192.254: -> routec "add -net 10.2 On Linux hosts: % route add -net 192.10. 6.10. execute the following from your host command shell: For Windows hosts: C:\> route add 192.9 1.0/24 192.10.2 Bridge Tap/WRTAP interface 10. 0". Configure the bridge in the same way the local interface is configured (either DHCP or fixed address and gateway).254. the bridge should continue to be available after a reboot of your host. Linux Hosts The tutorial in this section must be performed locally on the host machine and not through a remote connection.255. 4.10.2 Setting Up the Network Daemon. see 5. In addition. SUBNET_MASK = "255. For example. You should now be able to access any other host without modifying routing tables. you will need the brctl command that is available in the bridge-utils package. }.50. You can verify this using the modinfo bridge command.1" 6. 95 .10.0". If necessary. complete the following steps: 1. check the network interfaces in Control Panel > Network Connections.255.10. 5. 2. For example. Any remote connection will be temporarily disrupted during bridge set up. SUBNET_EXTPROMISC = no.2 and WRTAP interface of 10. install the package that contains this module. Select the newly created bridge then right-click and select properties.10. You should be able to see the WRTAP interface configured on the same subnetwork as your local network interface.30 3.10.10.2.10. To set up the bridge. SUBNET_EXTERNAL = yes. For more information on starting the network daemon. control-click to select both interfaces then right-click and select bridge from the pop-up menu. Create a vxsimnetd configuration file for your local subnet (the following example assumes that your local subnet is 10. you must ensure that the bridge module is installed on your Linux host.0): SUBNET_START local_subnet { SUBNET_ADDRESS = "10. you would see a local interface of 10.10. If you started vxsimnetd as a service with your local subnet configuration. Start a VxWorks simulator instance: -> vxsim p 0 -d simnet -e 10. Start vxsimnetd using the configuration file that you created above. p.10.5 Adding a VxWorks Simulator to a Local Network Windows Hosts To configure the bridge on a Windows host.10. NOTE: To use the VxWorks simulator on a local bridge in Linux.6 Networking Tutorials 6.10. Once you have started vxsimnetd.10. you can ping Host1 (as shown in the figure above) from VxSim0 as follows: -> ping "10. 2 netmask 255. Once you have verified that the required modules are available.10. set up the bridge as follows: $ $ $ $ $ $ brctl addbr bridge0 brctl addif bridge0 eth0 brctl addif bridge0 tap1 ifconfig tap1 0. From the VxWorks Development Shell.0.ELhugemem SMP 686 REGPARM 4KSTACKS gcc-3.ELhugemem/kernel/net/bridge/bridge.10. When vxsimnetd is restarted.0 96 .10.0.9-67. To make sure the bridge module is available and loaded on your Linux host. it removes the WRTAP interface from the bridge. 3.0 ifconfig bridge0 10.10. SUBNET_EXTERNAL = yes. start the VxWorks simulator instance using the following command: -> vxsim p 0 -d simnet -e 10. SUBNET_MASK = "255. From a command shell with root privileges. issue the following commands: # modinfo bridge filename: /lib/modules/2.ko license: GPL vermagic: 2.9-67.0.255.conf -sv If vxsimnetd was previously started as root with a shell server. }.6.0.conf $ telnet localhost 7777 vxsimnet> source /tmp/local_subnet.255. 6.Wind River VxWorks Simulator User's Guide. create a vxsimnetd configuration file for your local subnet (10.10. Check your routes and reset if necessary: -> netstat -r Note that when vxsimnetd is stopped. complete the following steps: 1.0 in this example): SUBNET_START local_subnet { SUBNET_ADDRESS = "10. issue the following commands from a command shell: $ cp local_subnet. issue the following command: $ vxsimnetd -f local_subnet.conf subnet(s) <local_subnet> added.255. With root privileges. SUBNET_EXTPROMISC = no.20.30 6.0.0 up 5.6.0".0.20.4 depends: atm # modprobe bridge 2. Start vxsimnetd with this configuration file or source it through an existing vxsimnetd shell. 4.10.0 ifconfig eth0 0. you must run the following commands to install the WRTAP interface into the bridge: $ brctl addif bridge0 tap1 $ ifconfig tap1 0.10.conf /tmp/local_subnet.255.0".0.9 To configure the bridge on a Linux host.0.10. SUBNET_EXTDEVNUM = 1. On Windows hosts.6 IPv6 Tutorial 6. Step 1: Configure Your Host System In order to receive IPv6 packets from the VxWorks simulator subnet. p. Step 2: Configure and Start the Network Daemon This tutorial uses a network configuration that includes two subnets (default and sub3) that are configured with IPv4 addresses. log in with root privileges and issue the following command in the host shell: # ifconfig -a6 If IPv6 support is present the command will be successful.1 Configure the Network This section describes how to set up your host system and the VxWorks simulator network daemon for use with an IPv6 network. If the command is unsuccessful. For more information on IPv6. This tutorial describes how to: ■ Enable IPv6 support on your host system.6. Configure the VxWorks simulator network daemon. see the Wind River Network Stack Programmer's Guide. IPv6 support is configured during setup. NOTE: Before launching vxsimnetd. Volume 1: Transport and Network Protocols: Configuring Transport and Network Protocols. be sure to kill all previously started VxWorks simulator instances and then kill the previously started network daemon. 97 . Start your IPv6 VxWorks simulator network and test your connections. you must configure your host system with IPv6 support.69). Configure a VxWorks image for use as an IPv6-enabled simulator.6 IPv6 Tutorial This tutorial illustrates how to configure your host system and your target simulators to communicate using IPv6 protocol. configure IPv6 support by issuing the following command from a Windows command shell: C:\> ipv6 install On Linux hosts. The IPv4 addresses are used only to identify the subnets and to assign MAC addresses (see Starting a Simulator Instance without an IPv4 Address.6 Networking Tutorials 6. To confirm IPv6 support on your host. see your host system documentation for information on enabling IPv6 support or consult your system administrator. issue the following command in a host shell: $ modprobe ipv6 On Solaris hosts. ■ ■ ■ 6. Then. SUBNET_EXTERNAL = yes. SUBNET_EXTERNAL = no.3.168.3.80 using the following file in place of the vxsimTest.0".168. First. The tutorial requires that you configure your VxWorks image with the following components: 98 . }.6. This tutorial uses a VxWorks simulator configuration to demonstrate router advertisement and solicitation.86.Wind River VxWorks Simulator User's Guide.200. From your host shell.conf Subnet <sub3> added. vxsimnetd> quit 6. see the Wind River Network Stack Programmer's Guide.9 You can configure the VxWorks simulator network daemon (vxsimnetd) using one of the following methods: ■ using a static configuration file dynamically using the shell ■ Start vxsimnetd Using a Static Configuration File Follow the instructions as provided in Step 1:Configure and Launch vxsimnetd. Configure vxsimnetd Dynamically Using the Shell You can also configure the VxWorks simulator network daemon dynamically.conf file (save the file as ipv6_tutorial_static. }. complete the following steps: 1. 2. make sure that your network stack is enabled with IPv6 support. p. Create and save the following file as ipv6_tutorial_dynamic. SUBNET_START sub3 { SUBNET_ADDRESS = "192. type the following: % telnet yourHostName 7777 where yourHostName is the name of your host machine. SUBNET_EXTERNAL = no. 3.2 Configuring VxWorks with IPv6 Components NOTE: Before configuring your VxWorks image.0". source the new configuration file as follows: vxsimnetd> source /myDir/ipv6_tutorial_dynamic. Quit the vxsimnetd shell. For information on building your network stack with IPv6 support.conf: SUBNET_START sub3 { SUBNET_ADDRESS = "192.168. Connect to the vxsimnetd shell. }. SUBNET_EXTPROMISC = yes. In the vxsimnetd debug shell.conf): SUBNET_START default { SUBNET_ADDRESS = "192. 6. launch the vxsimnetd shell server as directed in Step 1:Launch the vxsimnetd Shell Server. p. Volume 1: Transport and Network Protocols: Configuring Transport and Network Protocols. 4.0". and INCLUDE_PING6 components: % vxprj component add INCLUDE_IPD_CMD INCLUDE_IPCOM_SYSVAR_CMD INCLUDE_IPRADVD_CMD INCLUDE_PING6 NOTE: You can also create your project and configure your VxWorks image from Workbench using the kernel configuration tool. p.82 or Wind River Workbench By Example: Configuring and Building VxWorks. For example: % vxprj -inet6 create bsp TOOL demo_router where bsp is the BSP for your host system type (simpc. linux. Change to the demo_router directory: % cd demo_router Add the INCLUDE_IPD_CMD. INCLUDE_IPCOM_SYSVAR_CMD. Also. Start the VxWorks Simulator Instances Before you can test the IPv6 connection.3 Testing the IPv6 Connection This section describes how to test the IPv6 connections in your simulated network. when using Workbench. see Prepare Your VxWorks Image Using Workbench. see the Wind River Network Stack Programmer's Guide. Build Your Projects Build the demo_router project as follows: % vxprj build 6. Volume 1: Transport and Network Protocols: Configuring Transport and Network Protocols and your Platform getting started guide.6. do not to check the Use IPv6 enabled kernel libraries option in the Options dialog of the New VxWorks Image Project wizard). For more information. 3. NOTE: Wind River VxWorks Platforms users must omit the -inet6 option (or. 2. For more information on configuring components using Workbench. or solaris) and TOOL is your desired toolchain (diab or gnu). you must start your VxWorks simulator instances using the VxWorks images you created. be sure that you have built your Platform with IPv6 support. Create a project called demo_router.6 Networking Tutorials 6. 99 . INCLUDE_IPRADVD_CMD.6 IPv6 Tutorial INCLUDE_IPD_CMD INCLUDE_IPCOM_SYSVAR_CMD INCLUDE_IPRADVD_CMD INCLUDE_PING6 Set these components using the vxprj command-line utility using the following steps: 1. This starts a VxWorks simulator instance (VxSim2) with the advertiser configuration on subnet 3.3.168.3. 3.9 Step 1: Start the Simulator Instances on the Default Subnet 1.interfaces simnet0 ipd start ipnet_radvd 2.1 -f installDir/demo_router/default/vxworks -s pathToStartupScript/default_startup Where pathToStartupScript is the full path to your startup script location. Start one advertiser VxWorks simulator instance on the default subnet.168.2 -f installDir/demo_router/default/vxworks This starts a VxWorks simulator instance (VxSim3) with the solicitor configuration on subnet 3. 3.inet6.simnet1=192.168. 6. Start one advertiser and one solicitor instance on subnet 3. Start a solicitor VxWorks simulator instance on the default subnet as follows: -> vxsim -p 1 -d simnet -e 192. Step 2: Start the Simulator Instances on Subnet 3 1.200. create a startup script (sub3_startup) that specifies the prefix to advertise: # switch interpreter cmd # add IPv6 address ifconfig simnet0 inet6 add 2002:A01:202::787A:C0FF:FEA8:C801 # configure advertisement radvdconfig simnet0 add test 2002:0a01:0202::/64 valid 600 preferred 200 L A radvdconfig simnet0 enable test # start advertising prefix sysvar set -o ipnet. Start the advertiser VxWorks simulator instance.inet6. First. Start the solicitor VxWorks simulator instance as follows: -> vxsim -p 3 -d simnet -e 192.radvd.200.2 -f installDir/demo_router/default/vxworks This starts a VxWorks simulator instance (VxSim1) with the solicitor configuration on the default subnet.radvd.3 -f installDir/demo_router/default/vxworks -s pathToStartupScript/sub3_startup where pathToStartupScript is the full path to your startup script location. 100 .1.Wind River VxWorks Simulator User's Guide. You can start the simulator instance from the VxWorks Development Shell using the script you just created: -> vxsim -p 2 -ni simnet0=192.168.168. This starts a VxWorks simulator instance (VxSim0) with an advertiser configuration on the default subnet. You can start the simulator instance from the VxWorks Development Shell using the script you just created as follows: -> vxsim -p 0 -d simnet -e 192. Create a startup script (default_startup) that specifies the prefix to advertise: # switch interpreter cmd # add IPv6 address ifconfig simnet0 inet6 add 2002:A01:201::787A:C0FF:FEA8:C801 # configure advertisement radvdconfig simnet0 add test 2002:0a01:0201::/64 valid 600 preferred 200 L A radvdconfig simnet0 enable test # start advertising prefix sysvar set -o ipnet.interfaces simnet0 ipd start ipnet_radvd 2.200. 1 mask 240. type the following: -> ifconfig "simnet0" simnet0 Link type:Ethernet HWaddr 7a:7a:c0:a8:c8:01 Queue:none inet 192.6 IPv6 Tutorial Step 3: Check Your Connections You can now check to see if the VxWorks simulator instances are correctly configured.200.0. NOTE: You may need to wait 10-30 seconds for the network autoconfiguration to complete.0.0 broadcast 192.255 inet 224.0.0 inet6 unicast 2002:A01:201::787A:C0FF:FEA8:C801 prefixlen 64 inet6 unicast FE80::787A:C0FF:FEA8:C801%simnet0 prefixlen 64 automatic inet6 unicast 3FFE:1:2:3::4 prefixlen 64 inet6 unicast FE80::%simnet0 prefixlen 64 anycast inet6 unicast 2002:A01:201:: prefixlen 64 anycast inet6 unicast 3FFE:1:2:3:: prefixlen 64 anycast inet6 multicast FF02::1:FF00:4%simnet0 prefixlen 16 inet6 multicast FF02::1:FF00:0%simnet0 prefixlen 16 inet6 multicast FF02::1%simnet0 prefixlen 16 automatic inet6 multicast FF02::1:FFA8:C801%simnet0 prefixlen 16 inet6 multicast FF02::2%simnet0 prefixlen 16 UP RUNNING SIMPLEX BROADCAST MULTICAST MTU:1500 metric:1 VR:0 RX packets:0 mcast:0 errors:0 dropped:0 TX packets:11 mcast:10 errors:0 collisions:0 unsupported proto:0 RX bytes:0 TX bytes:966 value = 0 = 0x0 2. In the VxSim1 console.255.0.200.168.255.0 inet6 unicast 2002:A01:201::787A:C0FF:FEA8:C802 prefixlen 64 autonomous inet6 unicast FE80::787A:C0FF:FEA8:C802%simnet0 prefixlen 64 automatic inet6 unicast 3FFE:1:2:3::4 prefixlen 64 inet6 unicast 2002:A01:201:: prefixlen 64 anycast inet6 unicast FE80::%simnet0 prefixlen 64 anycast inet6 unicast 3FFE:1:2:3:: prefixlen 64 anycast inet6 multicast FF02::1:FF00:4%simnet0 prefixlen 16 inet6 multicast FF02::1:FF00:0%simnet0 prefixlen 16 inet6 multicast FF02::1%simnet0 prefixlen 16 automatic inet6 multicast FF02::1:FFA8:C802%simnet0 prefixlen 16 UP RUNNING SIMPLEX BROADCAST MULTICAST MTU:1500 metric:1 VR:0 RX packets:3 mcast:2 errors:0 dropped:0 TX packets:9 mcast:8 errors:0 collisions:0 unsupported proto:0 RX bytes:264 TX bytes:730 value = 0 = 0x0 101 . type the following: -> ifconfig "simnet0" simnet0 Link type:Ethernet HWaddr 7a:7a:c0:a8:c8:02 Queue:none inet 192.1 mask 255.0.0 broadcast 192.200.2 mask 255.6 Networking Tutorials 6. 1.168.255.168. In the VxSim0 console.1 mask 240.255 inet 224.168.200.0.0.0.255. 200.3.3 mask 255.0.0.0.255 inet 224.0.0.0.0.168.0.168.3.255.0.Wind River VxWorks Simulator User's Guide.255.168.9 3.255 inet 224. 6.0 broadcast 192.255.255.0.1 mask 255.0 inet6 unicast 2002:A01:201::787A:C0FF:FEA8:C803 prefixlen 64 autonomous inet6 unicast FE80::787A:C0FF:FEA8:C803%simnet1 prefixlen 64 automatic inet6 unicast 2002:A01:201:: prefixlen 64 anycast inet6 unicast FE80::%simnet1 prefixlen 64 anycast inet6 multicast FF02::1%simnet1 prefixlen 16 automatic inet6 multicast FF02::1:FFA8:C803%simnet1 prefixlen 16 inet6 multicast FF02::1:FF00:0%simnet1 prefixlen 16 UP RUNNING SIMPLEX BROADCAST MULTICAST MTU:1500 metric:1 VR:0 RX packets:1 mcast:1 errors:0 dropped:0 TX packets:7 mcast:6 errors:0 collisions:0 unsupported proto:0 RX bytes:102 TX bytes:550 value = 0 = 0x0 102 . In the VxSim2 console.255 inet 224.200.1 mask 240.1 mask 240. type the following: -> ifconfig lo0 Link type:Local loopback Queue:none inet 127.1 mask 255.0.1 mask 240.0.0.0 inet6 unicast FE80::1%lo0 prefixlen 64 automatic inet6 unicast ::1 prefixlen 128 inet6 multicast FF02::1:FF00:1%lo0 prefixlen 16 inet6 multicast FF01::1 prefixlen 16 inet6 multicast FF02::1%lo0 prefixlen 16 automatic UP RUNNING LOOPBACK MULTICAST MTU:1500 metric:1 VR:0 RX packets:9 mcast:0 errors:0 dropped:5 TX packets:9 mcast:3 errors:0 collisions:0 unsupported proto:0 RX bytes:440 TX bytes:440 simnet0 Link type:Ethernet HWaddr 7a:7a:c0:a8:03:01 Queue:none inet 192.0 broadcast 192.0.255.168.0 inet6 unicast 2002:A01:202::787A:C0FF:FEA8:C801 prefixlen 64 inet6 unicast FE80::787A:C0FF:FEA8:301%simnet0 prefixlen 64 automatic inet6 unicast FE80::%simnet0 prefixlen 64 anycast inet6 unicast 2002:A01:202:: prefixlen 64 anycast inet6 multicast FF02::1%simnet0 prefixlen 16 automatic inet6 multicast FF02::1:FFA8:301%simnet0 prefixlen 16 inet6 multicast FF02::1:FFA8:C801%simnet0 prefixlen 16 inet6 multicast FF02::1:FF00:0%simnet0 prefixlen 16 inet6 multicast FF02::2%simnet0 prefixlen 16 UP RUNNING SIMPLEX BROADCAST MULTICAST MTU:1500 metric:1 VR:0 RX packets:2 mcast:1 errors:0 dropped:0 TX packets:11 mcast:10 errors:0 collisions:0 unsupported proto:0 RX bytes:130 TX bytes:966 simnet1 Link type:Ethernet HWaddr 7a:7a:c0:a8:c8:03 Queue:none inet 192.255. In the VxSim1 console. type the following: -> ifconfig "simnet0" simnet0 Link type:Ethernet HWaddr 7a:7a:c0:a8:03:02 Queue:none inet 192. Subnet 3 (sub3) includes VxSim2 and VxSim3. enter the following: -> cmd [vxWorks *]# ping6 2002:A01:201::787A:C0FF:FEA8:C802 Pinging 2002:A01:201::787A:C0FF:FEA8:C802 (2002:A01:201::787A:C0FF:FEA8:C802) with 64 bytes of data: Reply from 2002:A01:201::787A:C0FF:FEA8:C802 bytes=64 time=0ms Reply from 2002:A01:201::787A:C0FF:FEA8:C802 bytes=64 time=0ms Reply from 2002:A01:201::787A:C0FF:FEA8:C802 bytes=64 time=0ms Reply from 2002:A01:201::787A:C0FF:FEA8:C802 bytes=64 time=0ms hlim=64 hlim=64 hlim=64 hlim=64 --.0 broadcast 192. Ping VxSim1 from VxSim0. VxSim1. and the host system.0. 4 received.6 Networking Tutorials 6.6 IPv6 Tutorial 4.0.0. time 4066 ms rtt min/avg/max = 0/0/0 ms 2.2 mask 255.255. 4 received. 1. In the VxSim0 console.3.168. The default subnet (default) includes VxSim0.255 inet 224. you can ping VxSim0 with the local address as follows: -> cmd [vxWorks *]# ping6 FE80::787A:C0FF:FEA8:C801%simnet0 Pinging FE80::787A:C0FF:FEA8:C801%simnet0 (FE80::787A:C0FF:FEA8:C801%simnet0) with 64 bytes of data: Reply from FE80::787A:C0FF:FEA8:C801%simnet0 bytes=64 time=0ms Reply from FE80::787A:C0FF:FEA8:C801%simnet0 bytes=64 time=0ms Reply from FE80::787A:C0FF:FEA8:C801%simnet0 bytes=64 time=0ms Reply from FE80::787A:C0FF:FEA8:C801%simnet0 bytes=64 time=0ms hlim=64 hlim=64 hlim=64 hlim=64 --. In the VxSim3 console.3.1 mask 240. 0% packet loss.FE80::787A:C0FF:FEA8:C801%simnet0 ping statistics --4 packets transmitted. 0% packet loss.255. time 4066 ms rtt min/avg/max = 0/0/0 ms 103 .168.0 inet6 unicast 2002:A01:202::787A:C0FF:FEA8:302 prefixlen 64 autonomous inet6 unicast FE80::787A:C0FF:FEA8:302%simnet0 prefixlen 64 automatic inet6 unicast 3FFE:1:2:3::4 prefixlen 64 inet6 unicast 2002:A01:202:: prefixlen 64 anycast inet6 unicast FE80::%simnet0 prefixlen 64 anycast inet6 unicast 3FFE:1:2:3:: prefixlen 64 anycast inet6 multicast FF02::1:FF00:4%simnet0 prefixlen 16 inet6 multicast FF02::1:FF00:0%simnet0 prefixlen 16 inet6 multicast FF02::1%simnet0 prefixlen 16 automatic inet6 multicast FF02::1:FFA8:302%simnet0 prefixlen 16 UP RUNNING SIMPLEX BROADCAST MULTICAST MTU:1500 metric:1 VR:0 RX packets:3 mcast:3 errors:0 dropped:0 TX packets:9 mcast:8 errors:0 collisions:0 unsupported proto:0 RX bytes:306 TX bytes:730 value = 0 = 0x0 Step 4: Ping your Simulator Instances You can now ping the VxWorks simulator instances on the same subnet.2002:A01:201::787A:C0FF:FEA8:C802 ping statistics --4 packets transmitted.0. 6. you can also ping VxSim0 at the automatically configured address as follows: -> cmd [vxWorks *]# ping6 2002:A01:201::787A:c0FF:FEA8:C801 Pinging 2002:A01:201::787A:C0FF:FEA8:C801 (2002:A01:201::787A:C0FF:FEA8:C801) with 64 bytes of data: Reply from 2002:A01:201::787A:C0FF:FEA8:C801 bytes=64 time=0ms Reply from 2002:A01:201::787A:C0FF:FEA8:C801 bytes=64 time=0ms Reply from 2002:A01:201::787A:C0FF:FEA8:C801 bytes=64 time=0ms Reply from 2002:A01:201::787A:C0FF:FEA8:C801 bytes=64 time=0ms hlim=64 hlim=64 hlim=64 hlim=64 --. 104 . time 4066 ms rtt min/avg/max = 0/0/0 ms 4. you can also ping the host: -> cmd [vxWorks *]# ping6 2002:A01:201::787A:C0FF:FEA8:C8FE Pinging 2002:A01:201::787A:C0FF:FEA8:C8FE (2002:A01:201::787A:C0FF:FEA8:C8FE) with 64 bytes of data: Reply from 2002:A01:201::787A:C0FF:FEA8:C8FE bytes=64 time=16ms hlim=64 Reply from 2002:A01:201::787A:C0FF:FEA8:C8FE bytes=64 time=0ms hlim=64 Reply from 2002:A01:201::787A:C0FF:FEA8:C8FE bytes=64 time=0ms hlim=64 Reply from 2002:A01:201::787A:C0FF:FEA8:C8FE bytes=64 time=0ms hlim=64 --.79. From VxSim1.2002:A01:201::787A:C0FF:FEA8:C801 ping statistics --4 packets transmitted. 0% packet loss. 4 received.2002:A01:201::787A:C0FF:FEA8:C8FE ping statistics --4 packets transmitted. time 4067 ms rtt min/avg/max = 0/4/16 ms In addition. For an example of how to set up the routing information.3 Basic Simulated Network with Multiple Simulators. From VxSim0 or VxSim1. see the tutorials in 6. 4 received. p.9 3. 0% packet loss.Wind River VxWorks Simulator User's Guide. you can set the routing such that you can ping between the default subnet and subnet 3 through VxSim2. 105 . CPU 0 is the primary CPU.1 Introduction VxWorks supports asynchronous multi-processing (AMP) on multicore processors—VxWorks AMP (see VxWorks Kernel Programmer’s Guide: Overview of VxWorks AMP). This may be useful if your target hardware is still under development. and all other CPUs are considered secondary CPUs.2 Tutorial: Simulating AMP 105 7. To make this possible. You can simulate VxWorks AMP by using a separate instance of the VxWorks simulator for each AMP CPU. the build requirements for the primary CPU are slightly different than the requirements for secondary CPUs.2 Tutorial: Simulating AMP You cannot simulate symmetric multiprocessing (SMP) at the same time that you simulate AMP. Given this. This tutorial shows you how to use the VxWorks simulator to simulate a VxWorks AMP configuration consisting of a primary CPU and three secondary CPUs. you can use it to develop VxWorks AMP applications. This chapter presents a tutorial on how to build and configure instances of the VxWorks simulator for VxWorks AMP.7 Tutorial: Simulating VxWorks AMP 7.1 Introduction 105 7. This makes it possible for independent instances of the VxWorks operating system to run on the individual CPUs of a multicore processor. 7. when you configure VxWorks AMP on a multicore processor. Once you have a simulated VxWorks AMP configuration. The primary CPU always boots first and is then used to boot the secondary CPUs. and select Edit Kernel Configuration. Start the VxWorks Simulation of the Primary CPU. Start the VxWorks Simulation of a Secondary CPU. For the current example. select Window > Open Perspective > Advanced Device Development. Click Next. or solaris on Solaris hosts. 3.2. 7. right-click Kernel Configuration. a. p.1 Create and Build a VxWorks Image Project for Simulating the Primary CPU You can create and build your VxWorks image project from either Workbench or the command line. In the Project name field of the Project dialog. choose to base your project on a board support package and select or confirm your board support package and toolchain. To display the Advanced Device Development perspective. Create a new VxWorks image project. Create and Build a VxWorks Image Project for Simulating the Primary CPU. The title bar at the upper left of the Workbench window shows the current perspective. The toolchain can be either diab (Wind River Diab Compiler) or gnu (GNU compiler). In the Workbench Project Explorer. This launches the New VxWorks Image Project wizard. a. p. p. Workbench In Workbench.112. The appropriate BSP for the VxWorks simulator is simpc on Windows hosts. Select File > New > VxWorks Image Project. Add the required MIPC components to your kernel configuration. the project name is sim_primary.106. 2. For the following steps.Wind River VxWorks Simulator User's Guide. enter a name for your project. To create and build an image project for simulating a primary CPU using Workbench: 1. c. 4. Create and Build VxWorks Image Projects for Simulating Secondary CPUs. you can locate any of the build components and parameters mentioned in this chapter by right-clicking anywhere in the Kernel Configuration Editor and selecting the Find tool. 2. make sure that the Workbench Advanced Device Development perspective is displayed.109. 106 . expand the sim_primary project you created (if it is not already expanded). 6. b. linux on Linux hosts. p. Click Finish.9 The basic steps in simulating VxWorks AMP are: 1. 3. In the Project Setup dialog.112. To include show routines for AMP and a demo application for AMP and MIPC. right-click it. (If you enlarge the Kernel Configuration display by double-clicking the project tab at the top. by adding the following component: tip serial line connection utility (INCLUDE_TIP) In an AMP environment. This parameter is contained in the MIPC over SM (INCLUDE_MIPC_SM) build component. when the Editor is at its default size. add the following components: MIPC demo (INCLUDE_MIPC_DEMO) MIPC Show routines (INCLUDE_MIPC_SHOW) For information on these components. see the VxWorks Kernel Programmer’s Guide: The VxWorks tip Utility. ■ For more information on the tip utility. 107 . which is used with the demo application (see Step 6). (Optional) Add MIPC Network Device (MND) by adding the following component: MIPC Network Device (INCLUDE_MND) MND makes it possible to simulate Ethernet connections between nodes on a multicore processor and then communicate between nodes using IPv4 or IPv6 protocols or TIPC. Display output from CPUs located on the target system. Locate the AMP Primary OS (BUNDLE_AMP_PRI) bundle. 8. 6. This parameter is contained in the MIPC over SM (INCLUDE_MIPC_SM) build component. see Wind River MIPC Programmer’s Guide: Building and Configuring MIPC for VxWorks 7. Set the Maximum nodes per bus (MIPC_SM_NODES) parameter to 4. The Bundles tab is at the bottom left of the Kernel Configuration Editor.2 Tutorial: Simulating AMP b. set the Tip global configuration string (TIP_CONFIG_STRING) parameter as follows: CPU1#dev=/ttyMsd0#tag=CPU1|CPU2#dev=/ttyMsd1#tag=CPU2|CP U3#dev=/ttyMsd2#tag=CPU3 9. Include the tip utility. 5. Set the Number of MSD devices (MSD_NUM_DEVS) parameter to 3.) The BUNDLE_AMP_PRI bundle adds the following components for AMP to your project: MIPC over SM (INCLUDE_MIPC_SM) Multi-Os IPC serial device (INCLUDE_MSD) MIPC WDB Agent Proxy backend (INCLUDE_WDB_PROXY_MIPC) WRLoad (INCLUDE_WRLOAD) 4. and select Add. Select the Bundles tab. the tip utility allows you to establish a terminal connection to one or more CPUs on a target system and: ■ Send commands to individual CPUs that are connected through tip. the Bundles tab at the bottom may not be visible.7 Tutorial: Simulating VxWorks AMP 7. For the tip utility. Wind River VxWorks Simulator User's Guide. For testing purposes. Set the Maximum nodes per bus (MIPC_SM_NODES) parameter as follows: % vxprj parameter set MIPC_SM_NODES 4 This parameter is contained in the MIPC over SM (INCLUDE_MIPC_SM) build component. linux for Linux hosts. From a VxWorks Development Shell. 10. include the Ping client (INCLUDE_PING) build component. create a VxWorks image project using the following command: % vxprj create bsp toolchain project_name In the command sequence above: ■ bsp is the BSP name for your simulator (simpc for Windows hosts. see the VxWorks Kernel Programmer’s Guide: MND: Simulating an Ethernet Connection Between Nodes. For the current example. 6. Command Line Follow the steps below to create and build an image project for simulating the primary CPU from the command line. Change directories to the project directory and add the bundle containing components for an AMP primary CPU as follows: % cd sim_primary % vxprj bundle add BUNDLE_AMP_PRI The bundle includes the following components for AMP: INCLUDE_MIPC_SM INCLUDE_MSD INCLUDE_WDB_PROXY_MIPC INCLUDE_WRLOAD 3. or solaris for Solaris hosts) toolchain is your desired toolchain (diab for the Wind River Diab Compiler or gnu for the GNU compiler) project_name is the name of your project. To include show routines for AMP and a demo application for AMP and MIPC. Build your project: right-click the project in the Project Explorer and select Build Project. 4. the project name is sim_primary.9 For more information on MND. ■ ■ 2. 1. add the following components: % vxprj component add INCLUDE_MIPC_SHOW INCLUDE_MIPC_DEMO 108 . 11. 7. see the VxWorks Kernel Programmer’s Guide: MND: Simulating an Ethernet Connection Between Nodes. 9. For more information on MND. p. by adding the component for tip. For testing purposes.2 Create and Build VxWorks Image Projects for Simulating Secondary CPUs For the current example. include the INCLUDE_PING component in your build: % vxprj component add INCLUDE_PING Build your project by entering the following from the project directory: % vxprj build This builds a VxWorks image in the /default subdirectory. 8.2.106). ■ For more information on the tip utility. set the Tip global configuration string (TIP_CONFIG_STRING) parameter as follows: CPU1#dev=/ttyMsd0#tag=CPU1|CPU2#dev=/ttyMsd1#tag=CPU2|CPU3#dev=/ttyMsd2#tag=CPU3 7. Most of the steps for creating and building an image project for simulating a secondary CPU are the same as those for a primary CPU.2 Tutorial: Simulating AMP 5.2. (Optional) Add MIPC Network Device (MND) by adding the component for MND.7 Tutorial: Simulating VxWorks AMP 7. Create a new VxWorks image project as described for the primary CPU (see Step 1 for Workbench under 7. Display output from CPUs located on the target system. installDir/workspace/sim_primary/default/vxWorks. Include the tip utility.1 Create and Build a VxWorks Image Project for Simulating the Primary CPU. you only need to create and build a single VxWorks image project for a secondary CPU. All three secondary CPUs can use the same image. For example. as follows: % vxprj component add INCLUDE_MND MND makes it possible to simulate Ethernet connections between nodes on a multicore processor and then communicate between nodes using IPv4 or IPv6 protocols or TIPC. the tip utility allows you to establish a terminal connection to one or more CPUs on a target system and: ■ Send commands to individual CPUs that are connected through tip. see the VxWorks Kernel Programmer’s Guide: The VxWorks tip Utility. which is used with the demo application (see Step 4). For the tip utility. 6. 109 . as follows: % vxprj component add INCLUDE_TIP In an AMP environment. Workbench To create and build an image project for simulating a secondary CPU using Workbench: 1. 3. include the Ping client (INCLUDE_PING) build component. and select Edit Kernel Configuration. The Bundles tab is at the bottom left of the Kernel Configuration Editor. Command Line To create and build an image project for simulating a secondary CPU from the command line: 1. Select the Bundles tab. 7. Set the Maximum nodes per bus (MIPC_SM_NODES) parameter to 4.Wind River VxWorks Simulator User's Guide. 5. Build your project: right-click the project in the Project Explorer and select Build Project. In the Workbench Project Explorer. create a VxWorks image project as described in Step 2 for Command Line under Create and Build a VxWorks Image Project for Simulating the Primary CPU. when the Editor is at its default size. right-click on it. the Bundles tab at the bottom may not be visible. see the description at Step 9 for the primary CPU) by adding the following component: MIPC Network Device (INCLUDE_MND) Note that the tip utility. add the following components: MIPC demo (INCLUDE_MIPC_DEMO) MIPC Show routines (INCLUDE_MIPC_SHOW) For information on these components. 8. To include show routines for AMP and a demo application for AMP and MIPC. 6. 4. From a VxWorks Development Shell. see Wind River MIPC Programmer’s Guide: Building and Configuring MIPC for VxWorks 6. (If you enlarge the Kernel Configuration display by double-clicking the project tab at the top. For testing purposes. right-click Kernel Configuration. Locate the AMP Secondary OS (BUNDLE_AMP_SEC) bundle. This parameter is contained in the MIPC over SM (INCLUDE_MIPC_SM) build component. Add the required MIPC components to your kernel configuration: a. does not get included for secondary CPUs. expand the project you created for a secondary CPU (if it is not already expanded). which is included for primary CPUs.9 2. Remove the (INCLUDE_WDB_SYS) build component from your project. and select Add. % vxprj create bsp toolchain project_name 110 . (Optional) Add MIPC Network Device (MND.) The bundle adds the following components for AMP to your project: MIPC over SM (INCLUDE_MIPC_SM) Multi-Os IPC serial device (INCLUDE_MSD) WDB MIPC connection (INCLUDE_WDB_COMM_MIPC) WRLoad image build (INCLUDE_WRLOAD_IMAGE_BUILD) b. installDir/workspace/sim_secondary/default/vxWorks. see the description at Step 9 for the primary CPU). 7. add the following components: % vxprj component add INCLUDE_MCB_SHOW INCLUDE_MIPC_DEMO For information on these components. the project name is sim_secondary. For testing purposes. does not get included for secondary CPUs. linux for Linux hosts. Set the MIPC_SM_NODES parameter as follows: % vxprj parameter set MIPC_SM_NODES 4 This parameter is contained in the MIPC over SM (INCLUDE_MIPC_SM) build component. 4. see Wind River MIPC Programmer’s Guide: Building and Configuring MIPC for VxWorks 6.7 Tutorial: Simulating VxWorks AMP 7. For example. ■ ■ 2. 5. 8. For the current example. 111 . Change directories to the project directory and add the bundle containing components for an AMP secondary CPU as follows: % cd sim_secondary % vxprj bundle add BUNDLE_AMP_SEC The bundle contains the following components for AMP: INCLUDE_MIPC_SM INCLUDE_MSD INCLUDE_WDB_COMM_MIPC INCLUDE_WRLOAD_IMAGE_BUILD 3. add the following component: MIPC Network Device (INCLUDE_MND) Note that the tip utility. Remove the INCLUDE_WDB_SYS build component from your project: % vxprj component remove INCLUDE_WDB_SYS To include show routines for AMP and a demo application for AMP and MIPC.2 Tutorial: Simulating AMP In the command sequence above: ■ bsp is the BSP name for your simulator (simpc for Windows hosts. (Optional) To include MIPC Network Device (MND. or solaris for Solaris hosts) toolchain is your desired toolchain (diab for the Wind River Diab Compiler or gnu for the GNU compiler) project_name is the name of your project. which is included for primary CPUs. include the INCLUDE_PING component in your build: % vxprj component add INCLUDE_PING Build your project by entering the following from the project directory: % vxprj build This builds a VxWorks image in the /default subdirectory. Wind River VxWorks Simulator User's Guide, 6.9 7.2.3 Start the VxWorks Simulation of the Primary CPU You can start the VxWorks simulation of the primary CPU from either Workbench or the command line. Workbench To launch the VxWorks simulator for the primary CPU from Workbench: 1. Select Target > New Connection... This brings up the Select Remote Connection Type dialog. 2. Select Wind River VxWorks 6.x Simulator Connection and click Next. This brings up the VxWorks Boot parameters dialog. 3. In the VxWorks Boot Parameters dialog, click to the left of Custom simulator, then click Browse and navigate to the VxWorks image under the sim_primary project directory that you just created. For example: installDir/workspace/sim_primary/default/vxWorks 4. 5. Select the image, vxWorks, and click Open. In the VxWorks Boot Parameters dialog, Set Processor number to 0 which, in this case, counts as CPU 0, and click Finish. This launches the simulator instance for the primary CPU as vxsim0. Command Line To start the VxWorks simulator for the primary CPU from Workbench: 1. Change directories to the default directory under the sim_primary project directory that you just created. For example, change directories to: installDir/workspace/sim_primary/default 2. Enter the following command for processor 0, which in this case, counts as CPU 0. % vxsim -p 0 This launches the simulator instance for the primary CPU as vxsim0. 7.2.4 Start the VxWorks Simulation of a Secondary CPU To start the VxWorks simulation of a secondary CPU, you need to use the wrload utility (For information on wrload, see VxWorks Kernel Programmer’s Guide: Booting VxWorks for AMP and the wrload( ) API reference page). ■ To start the VxWorks simulation of a secondary CPU without specifying boot line parameters for networking, enter the following: % wrload "-f path_to_VxWorks_image -cpu n" 112 7 Tutorial: Simulating VxWorks AMP 7.2 Tutorial: Simulating AMP For example: % wrload "-f installDir/workspace/sim_secondary/default/ vxWorks -cpu 1" This launches the simulator instance for the secondary CPU as vxsim1. ■ To start the VxWorks simulation of a secondary CPU with the inclusion of boot line parameters for networking, enter the following: % wrload "-f path_to_VxWorks_image -cpu n -tsym \"*sysBootLine=network_device path_to_VxWorks_image\"" For example: % wrload "-f VxWorks_path_to_workspace/workspace/sim_secondary/ default/vxWorks -cpu 1 -tsym \"*sysBootLine=passDev(0,1) host:workspace/sim_secondary/default/vxWorks\"" This launches the simulator instance for the secondary CPU as vxsim1. Note that the quotes around *sysBootLine and the parameters that follow it are inside a quoted string and must be escaped with a backslash (\). The following is sample output for wrload: host:<...>/sim_secondary/default/vxWorks\"" Loading... 0x60010000 - 0x60184cd3 loaded 0x60184cd4 - 0x60184cdf zeroed 0x60186000 - 0x60194eef loaded 0x60194ef0 - 0x601bd12f zeroed Attempting string write of *sysBootLine (0x60000700) to "passDev(0,0) host:<...>/sim_secondary/default/vxWorks": OK value = 0 = 0x0 7.2.5 Verifying Connectivity Using the mipcShowBus Command You can now use the mipcShowBus command to verify that the VxWorks simulations for primary and secondary CPUs can communicate with each other. To do this, from any of the VxWorks simulations (for example, VxSim0 or VxSim1), enter the following: -> mipcShowBus This command displays the nodes (CPUs, in the present context) that are currently present on bus 0 and can, therefore, communicate with each other. The following is sample output: MIPC-SM BUS 0 { bus name: "main" maximum nodes: 4 my node number: 0 active nodes: { 0, 1, 2, 3 } statistics mode: local buffer messages: sent=0 received=6 buffer bytes: sent=0 received=4620 buffer tracking: allocated=0 freed=6 buffer not available: blocking=0 non-blocking=0 buffer available events: sent=0 received=0 express messages: sent=0 received=0 event exceptions: unavailable=0 interrupts: sent=0 received=3 deferred=3 socket usage: bound=1 closed=0 socket exceptions: rx queue full=0 } 113 Wind River VxWorks Simulator User's Guide, 6.9 Running mipcShowBus from the tip Utility You can also verify that the tip utility is active and that connectivity to nodes through tip is working by issuing the mipcShowBus command from the tip console, as follows: ->-> tip "CPU1" Connected to CPU1 - /ttyMsd0. Press ~? for the list of available commands. [Now listening to session 1 (CPU1 - /ttyMsd0)] [Input wired to session 1 (CPU1 - /ttyMsd0)] CPU1Target Name: vxTarget CPU1User: target ... CPU1-> mipcShowBus CPU1 CPU1MIPC-SM BUS 0 CPU1{ CPU1 bus name: "main" CPU1 maximum nodes: 4 CPU1 my node number: 1 CPU1 active nodes: { 0, 1, 2, 3 } CPU1 CPU1 statistics mode: local CPU1 buffer messages: sent=0 received=15 CPU1 buffer bytes: sent=0 received=75 CPU1 buffer tracking: allocated=16 freed=14 CPU1 buffer not available: blocking=0 non-blocking=0 CPU1 buffer available events: sent=0 received=0 CPU1 express messages: sent=0 received=0 CPU1 event exceptions: unavailable=0 CPU1 interrupts: sent=15 received=15 deferred=15 CPU1 socket usage: bound=2 closed=0 CPU1 socket exceptions: rx queue full=0 CPU1} 7.2.6 Run the MIPC Demo Application Once you have verified that your VxWorks simulators can communicate with each other, you can further test communication by running the MIPC demo application. The application allows you to send packets between two CPUs and prints out messages about the operations being performed during transmission. For more information on the MIPC demo application, see Wind River MIPC Programmer’s Guide: MIPC Demo. 7.2.7 Configure MND Devices and Confirm Connectivity To simulate AMP with the use of MND devices, you need to configure MND interfaces on two or more CPUs. To configure MND devices and check connectivity, perform the following steps: 1. 2. Configure an MND interface on CPU0, as in the following example: -> ifconfig "mnd0 inet 10.0.0.1 up" Use the tip utility to establish a terminal connection to another CPU and configure an interface on it, as in the following example: -> tip "CPU1" CPU1-> ifconfig "mnd0 inet 10.0.0.2 up" 114 7 Tutorial: Simulating VxWorks AMP 7.2 Tutorial: Simulating AMP 3. Test the connectivity between the two CPUs: CPU1-> ping "10.0.0.1" For more detailed information on configuring MND devices, see VxWorks Kernel Programmer’s Guide: MND: Simulating an Ethernet Connection Between Nodes. 115 6.9 116 .Wind River VxWorks Simulator User's Guide. see the reference entry for vxsimapi.2 Accessing Host OS Routines 118 A.A Accessing Host Resources A.3 Loading a Host-Based Application 118 A. 117 .1 Introduction 117 A. That is.4 Host Application Interface (vxsimapi) 118 A. see the reference entry for vxsimHostArchLib. For information on the available host access routines. and accessed through. vxsimHostArchLib also provides a host library (vxsimapi) for VxWorks simulator host application development. the VxWorks simulator.1 Introduction The VxWorks simulator provides support to access the underlying host OS routines from a VxWorks application and to call host code stored in a dynamic-link library (DLL). you can write a generic DLL (on any host) to control a hardware device connected to the host. For more information. The DLL can then be loaded by.5 Tutorials and Examples 120 A. you must always lock interrupts before calling the routine. /* unlock interrupts */ You should observe the following guidelines when making a call to host code: ■ When you call a host routine from VxWorks code. the routines will not only block the VxWorks task from which it was called. The method described for Windows simulators cannot be used on Linux or Solaris simulators because these simulators do not support multithreading. intUnlock (lvl). p.119.2 Accessing Host OS Routines. see A. A. For more information on using this method.2 Configuring a Host Device to Generate interrupts (UNIX Only).9 A. The exported symbols of the DLL can then be retrieved using the vxsimHostProcAddrGet( ) routine described in A.3 Loading a Host-Based Application The vxsimHostDllLoad( ) routine provides the ability to load a DLL in the VxWorks simulator process. the following code retrieves the address of the underlying host OS malloc( ) routine: /* Get underlying host OS malloc() address */ pHostMalloc = vxsimHostProcAddrGet ("malloc"). 6.Wind River VxWorks Simulator User's Guide. /* lock interrupts */ pHostBuf = (*pHostMalloc) (0x1000). For example. see A. On these hosts.2 Controlling a Host Serial Device.118. To avoid blocking on a Windows simulator.2 Accessing Host OS Routines The vxsimHostProcAddrGet( ) routine allows you to retrieve the address of a host routine.122. For example. p. p. this facility can be used to add code to control 118 . if the blocking system call is a device access. For an example of this. /* Allocate a buffer on host side of VxWorks Simulator */ lvl = intLock ().4 Host Application Interface (vxsimapi) The vxsimapi library provides the ability to extend VxWorks simulator capabilities with native OS code to perform operations that cannot be done directly using VxWorks code. but will also block the entire VxWorks simulator. ■ A.4. the solution is to configure the host device to generate an interrupt when data becomes available. create a specific thread that is responsible for calling the potentially blocking host code and set up a simple communication mechanism between VxWorks and the thread you have created. When you call a host routine and the routine is system blocking.5. Failure to do so can result in unexpected VxWorks simulator behavior. re-initializing peripherals. To install an ISR that runs whenever data is ready on some underlying host device.4. the task normally requires a blocking read. and the ISR can be disconnected using intDisconnect( ). A. Then. ISRfunc. This includes items such as releasing resources. This routine gives you the ability to specify a routine to perform any necessary cleanup when the VxWorks simulator exits or reboots. The VxWorks simulator exit hook facility provides the vxsimExitHookAdd( ) routine. O_NONBLOCK). or to add any functionality that requires host-specific code. to add code for graphic applications. 0). 0). Host side (DLL code linked with the vxsimapi library): /* open host device in non-blocking mode */ fd = open ("/dev/ttyb". In this case. see the reference entry for vxsimapi. For example: Host side (DLL code linked with the vxsimapi library): /* Disable interrupts on file descriptor */ vxsimFdIntDisable (fd). On the target side. put the file descriptor in asynchronous mode using the vxsimFdIntEnable( ) routine. Because Linux and Solaris simulators are mono-threaded. you can open the file in non-blocking mode and then put the device into asynchronous mode.A Accessing Host Resources A. ISRfunc. The following code example shows how to do this on a host serial port. Target side: /* disconnect the interrupt service routine from file descriptor */ intDisconnect (FD_TO_IVEC (fd).4 Host Application Interface (vxsimapi) peripherals connected to the host machine. 119 . This ensures that the host will send a SIGPOLL signal when data is available. you must first open the host device in non-blocking mode. A. and unblocks the waiting task. and other cleanup operations. As an alternative. an interrupt service routine (ISR) is connected using intConnect( ). This causes a SIGPOLL signal to be sent whenever data becomes available. If a VxWorks task reads from a host device. For more information. puts it in a buffer.1 Defining User Exit Hooks Applications often need to perform specific actions on exit. such that VxWorks sends a SIGPOLL signal is sent to the VxWorks simulator when data becomes available. an input ISR reads the data. /* Enable interrupts on file descriptor */ vxsimFdIntEnable (fd). Interrupts can also be disabled using vxsimFdIntDisable( ). this action stops the VxWorks simulator process entirely until data is ready.2 Configuring a Host Device to Generate interrupts (UNIX Only) You can put the host file descriptors in asynchronous mode.4. Target side: /* connect the interrupt service routine */ intConnect (FD_TO_IVEC (fd). 5 Tutorials and Examples The following sections provide simple tutorials and examples illustrating host resource accessing. A.25. This range is defined in the config. allow you to convert a message number to a vector number. For more information on Windows simulator interrupt assignments. and conversely. you can raise an interrupt to VxWorks when data has been read from the device. 6.9 A. When an interrupt needs to be acknowledged. 120 . For example. see Table 3-4 in 3.3 Simulating interrupts From a User Application (Windows Only) The vxsimIntRaise( ) routine provides a host side application with the ability to notify VxWorks of a given event. The vxsimWindowsHandleGet( ) routine can be used with the VxWorks simulator to get a windows handle for sending messages. A. On the target side of the application. This routine is called immediately after the interrupt handling. an ISR can be connected to the interrupt vector using intConnect( ).5. allowing VxWorks to take the appropriate action. and start a Tcl interpreter. Now.Wind River VxWorks Simulator User's Guide.5. each time vxsimIntRaise( ) is called. p. the vxsimIntAckRtnAdd( ) routine can be used to connect an acknowledgement routine for a given interrupt vector.5 Interrupts. A range of interrupt vectors are available on Windows simulators.1 Running Tcl on the VxWorks Simulator This section provides a simple tutorial that illustrates how to load a standard Tcl DLL on the VxWorks simulator.4. the ISR is called to handle the read data. if you have an application collecting data from a device.h file of the simpc BSP: USER_INT_RANGE_BASE USER_INT_RANGE_END User interrupts range base User interrupts range end The routines vxsimIntToMsg( ) and vxsimMsgToInt( ) allow you to convert an interrupt vector number to a Windows message number. /* lock interrupts */ evalResult = (*pTcl_Eval) (pInterp. while (gets (tclCommand) != NULL) { lvl = intLock ().dll" #else #define TCL_DLL "libtcl8. intUnlock (lvl).h" #if (CPU==SIMNT) #define TCL_DLL "tcl84. ("Tcl_Init"). TCL_DLL). ("Tcl_DeleteInterp"). ("Tcl_GetStringResult").h" #include "vxsimHostLib. pTcl_GetStringResult.4. tclCommand[400]. lvl. if (evalResult != 0) { printf ("Tcl Error: "). tclCommand). #include "vxWorks. } tclLoaded = TRUE.5 Tutorials and Examples Code Sample The following code sample can be built as a downloadable kernel module for all simulator types. } /* retrieve some Tcl routine address from the loaded Dll */ pTcl_CreateInterp pTcl_Init pTcl_Eval pTcl_GetStringResult pTcl_DeleteInterp = = = = = vxsimHostProcAddrGet vxsimHostProcAddrGet vxsimHostProcAddrGet vxsimHostProcAddrGet vxsimHostProcAddrGet ("Tcl_CreateInterp"). return (ERROR).so" #endif BOOL tclLoaded = FALSE. pTcl_Eval.A Accessing Host Resources A. pTcl_DeleteInterp. STATUS tclStart (void) { /* Function pointers for Tcl Dll routines */ FUNCPTR FUNCPTR FUNCPTR FUNCPTR FUNCPTR char int int void * pTcl_CreateInterp. /* Create and Initialize Tcl interpreter */ lvl = intLock (). ("Tcl_Eval"). (*pTcl_Init) (pInterp). pTcl_Init. /* /* /* /* buffer for Tcl command */ Tcl command evaluation result */ interrupt lock level */ Tcl interpreter Id */ /* Windows Tcl Dll name */ /* UNIX Tcl Dll name */ /* load Tcl Dll */ if (tclLoaded == FALSE) { if (vxsimHostDllLoad (TCL_DLL) != OK) { printf ("Error: Failed to load %s\n". pInterp. pInterp = (void *)(*pTcl_CreateInterp) (). evalResult. } 121 . /* /* /* /* lock interrupts */ Create interpreter */ Initialize interpreter */ unlock interrupts */ printf ("Tcl Ready (Type CTRL+D to exit interpreter)\n\ntcl> "). 4..so . succeeded. } /* unlock interrupts */ Running The Code The sample code can be executed directly from the VxWorks kernel shell or using the host shell. A sample host shell session is as follows: -> ld < tclInterp. Tcl Ready (Type CTRL+D to exit interpreter) tcl> glob * tclInterp. 6. For an example of this application type. The examples provided for commSio and ttySio exercise most of the features described in this chapter.tcl tcl> source hello. 122 .o value = 1634769168 = 0x61709910 -> tclStart Loading libtcl8.c tclInterp.5. intUnlock (lvl)..9 if (strlen ((*pTcl_GetStringResult)(pInterp)) != 0) printf ("%s\n". (*pTcl_GetStringResult)(pInterp)). see the reference entry for commSio (Windows simulators) or ttySio (Linux or Solaris simulators). /* unlock interrupts */ return (OK). printf ("tcl> ").Wind River VxWorks Simulator User's Guide.2 Controlling a Host Serial Device Controlling a host serial device is a more complex application. intUnlock (lvl).o hello. /* lock interrupts */ (*pTcl_DeleteInterp) (pInterp).tcl Hello ! tcl> ^Dvalue = 0 = 0x0 -> A. } /* Delete Tcl interpreter */ lvl = intLock (). 2 Simulator Exceptions for Windows 123 B. see B. the VxWorks simulator name for an exception has a corresponding POSIX name. Table B-1 Windows VxWorks Simulator Exceptions VxWorks Software Signal POSIX Software Signal Simulator Exception Name Description SIGFPE SIGEMT SIGSEGV SIGEMT SIGSEGV SIGFPE SIGTRAP SIGBUS SIGTRAP SIGSEGV EXC_INT_DIVIDE_BY_ZERO EXC_SINGLE_STEP EXC_DATATYPE_MISALIGNMENT EXC_BREAKPOINT EXC_IN_PAGE_ERROR Divide by zero Single step Datatype misalignment Breakpoint In page error 123 . p.1 Introduction The VxWorks simulator generates separate sets of exceptions for Windows (SIMNT.123) and UNIX-based (SIMLINUX and SIMSPARCSOLARIS.2 Simulator Exceptions for Windows Table B-1 lists exceptions generated for the Windows operating system. B. p. In both cases.B VxWorks Simulator Exceptions B.3 Simulator Exceptions for UNIX-Based Operating Systems 124 B.124) operating systems.3 Simulator Exceptions for UNIX-Based Operating Systems.1 Introduction 123 B. see B.2 Simulator Exceptions for Windows. 9 Table B-1 Windows VxWorks Simulator Exceptions (cont’d) VxWorks Software Signal POSIX Software Signal Simulator Exception Name Description SIGILL SIGILL SIGBUS SIGILL SIGILL SIGILL SIGSEGV SIGFPE EXC_ILLEGAL_INSTRUCTION EXC_INVALID_DISPOSITION EXC_ARRAY_BOUNDS_EXCEEDED EXC_FLT_DENORMAL_OPERAND Illegal instruction Invalid disposition Array bounds exceeded Floating point denormal operand Floating point divide By Zero Floating point inexact result Floating point invalid operation Floating point overflow Access violation Floating point stack check Floating point underflow Integer overflow Private instruction Stack overflow Unknown exception SIGFPE SIGFPE SIGFPE SIGFPE SIGFPE SIGFPE EXC_FLT_DIVIDE_BY_ZERO EXC_FLT_INEXACT_RESULT EXC_FLT_INVALID_OPERATION SIGFPE SIGSEGV SIGBUS SIGFPE SIGFPE SIGILL SIGBUS SIGILL SIGFPE SIGSEGV SIGBUS SIGFPE SIGFPE SIGILL SIGBUS SIGILL EXC_FLT_OVERFLOW EXC_ACCESS_VIOLATION EXC_FLT_STACK_CHECK EXC_FLT_UNDERFLOW EXC_INT_OVERFLOW EXC_PRIV_INSTRUCTION EXC_STACK_OVERFLOW EXC_UNKNOWN B.3 Simulator Exceptions for UNIX-Based Operating Systems Table B-2 lists exceptions generated for UNIX-based operating systems. 6. Table B-2 UNIX VxWorks Simulator Exceptions VxWorks Software Signal POSIX Software Signal Simulator Exception Name Description SIGSEGV SIGBUS SIGILL SIGFPE SIGTRAP SIGSEGV SIGBUS SIGILL SIGFPE SIGTRAP V_SEGV IV_BUS IV_ILL IV_FPE IV_TRAP Segmentation violation BUS error Illegation instruction Floating-point exception Trap exception 124 .Wind River VxWorks Simulator User's Guide. 81 with vxprj 8 with Workbench 7 building applications 18 D -d 9 debugging 20 DEFAULT_ACCESSMODE 60 DEFAULT_ERRORRATE 60 DEFAULT_EXTERNAL 60 DEFAULT_EXTPROMISC 60 DEFAULT_GARBAGE 60 DEFAULT_GID 60 125 . 9 boot parameters 8. 34 configuring a simulated subnet 68 IPv6 support on the host 97 multiple external subnets 63 multiple network interfaces 13 VxWorks with IPv6 components 98 connecting simulated subnets with wrnetdlink 69.h 18. 12. 33 BOOT_NO_AUTOBOOT 15 bootChange( ) 8.h 18 BSPs 7. 111 BUNDLE_AMP_SEC 110 byte order 24 C C++ modules 19 commSio 122 compiler options 18 -g 20 -O 21 -O0 21 -Xno-optimized-debug 21 -XO 21 config. 9 -backplane 7. 27 15 BUNDLE_AMP_PRI 107. 108. 92 connection timeout 23 console SMP 43 uniprocessor 12 CPU 18 B -b 7. 43. 45 -add_nat_redir 9 syntax 72 AMP tutorial 105 AMP Primary OS (bundle) 107 AMP Secondary OS (bundle) 110 -anr 9 application compatibility 2. 34 -Br 23 bspname. 17 linux 7 Makefile 18 simpc 7 solaris 7 -Bt 23 building a VxWorks image 7.Index A accessing host OS routines 118 the VxWorks Simulator from a remote host -add_dev 9. 45 assigning a processor number 13 AUX_CLK_RATE_MAX 39 AUX_CLK_RATE_MIN 39 auxiliary clock 39 auxiliary clock interrupts 25. 56 file system support 3. 91 INCLUDE_SM_COMMON 7. 110. 23 pass-through file system 23. 120 intDisconnect( ) 119 interrupt assignments Windows simulator 27 interrupt simulation 25 host signals 25 on Linux and Solaris 25 on Windows 26 Windows messages 26 F -f 9. 41 INCLUDE_SYS_TIMESTAMP 40 INCLUDE_TIMESTAMP 40 INCLUDE_TIP 107. 110. 110. 109. 45 -device 9 devs( ) 39 diab 18 DLL 117 dynamic-link library see DLL host connection driver 63 32-bit Windows 64 64-bit Windows 65 Linux 66 Solaris 66 host system requirements 5 HOST_SIO_PORT_NUMBER -hostinet 9 -hostname 9. 38 -flags 9 floating-point routines 24 support 24 -force 56 G -g 9 -gateway 9 gnu 18 H -h 9 hardware breakpoint support 24 hardware simulation 37 -help 9 -hn 9. 37 virtual disk 23. 90. 37 host application interface 118 126 .Wind River VxWorks Simulator User's Guide. 111 INCLUDE_NET_BOOT_CONFIG 69 INCLUDE_PASSFS 37 INCLUDE_PING 81. 119. 41 INCLUDE_SM_NET 7.9 DEFAULT_MACPREFIX 60 DEFAULT_TIMEOUT 61 DEFAULT_UID 60 development limitations 3. 111 INCLUDE_MND 107. 6. 90. 111 INCLUDE_PING6 99 INCLUDE_ROUTECMD 81. 111 INCLUDE_MIPC_SHOW 107. 109. 110. 13 ELF object module format 20 emacs 57 -ethernet 9 examples vxsimnetd configuration file 80 exit hook facility 119 exiting the VxWorks Simulator 15 -exitOnError 9. 56 -file 9. 27. 15 I ifconfig( ) 69 INCLUDE_BOOT_LINE_INIT 7 INCLUDE_HOST_SIO 40 INCLUDE_IPCOM_SYSVAR_CMD 99 INCLUDE_IPD_CMD 99 INCLUDE_IPRADVD_CMD 99 INCLUDE_KERNEL 28 INCLUDE_MCB_SHOW 108. 91. 111 INCLUDE_MIPC_DEMO 107. 111 INCLUDE_MSD 107. 111 -inet6 option 99 intConnect( ) 26. 108. 41 INCLUDE_SM_OBJ 7. 108 INCLUDE_WRLOAD_IMAGE_BUILD 110. 108. 12. 110 INCLUDE_MIPC_SM 107. 110. 109 INCLUDE_VIRTUAL_DISK 38 INCLUDE_WDB_PROXY_MIPC 107 INCLUDE_WDB_SYS 111 INCLUDE_WRLOAD 107. 108. 37 hostSio 40 40 E -e 9. 111 MMU see memory management unit MMU simulation 21 MND configuring 114 MSD_NUM_DEVS 107 Multi-Os IPC serial device (component) 107. 108. 73 -lnr 10 loading a VxWorks image 8 LOCAL_MEM_LOCAL_ADRS 34 LOCAL_MEM_SIZE 34 -logclean 10 -logfile 10 memory management unit 3. 108. 111 MIPC Show routines (component) 107. 108. 110. 110. 110 MIPC Network Device (component) 107. 111 MIPC Network Device (MND) 107. 18 Maximum nodes per bus 107. 110.Index IPv6 configuring into the VxWorks image 98 configuring support on the host 97 support 48 testing the connection 99 tutorial 97 ISR_STACK_SIZE 28 K -k 9 -kill 9 L -l 10 launching VxWorks simulator instances 83 -lc 10 linux 7 -list_dev 10 -list_dev all 10 -list_nat_redir 10. 109. 111 configuring 114 MIPC over SM (component) 107. 110 memory configuration 34 layout 28 memory management support running without MMU 22 127 . 110 N -n.nvram 10 -netif 10 network daemon configuration file parameters 59 configuration files 59 setting up 76 starting on the host 77 network simulation 47 full network simulation 48 building 48 configuring a subnet 68 host connection driver 63 network daemon 50 network redirection 71 adding a redirection 72 default redirections 71 listing redirections 73 networking address space 28 -ni 10. 74 syntax on Linux and Solaris hosts 76 non-volatile RAM support 39 Number of MSD devices 107 NV_RAM_SIZE 39 -nvram 39 M MACH_EXTRA 18 macros AUX_CLK_RATE_MAX 39 AUX_CLK_RATE_MIN 39 HOST_SIO_PORT_NUMBER 40 INCLUDE_SM_NET 7 LOCAL_MEM_LOCAL_ADRS 34 LOCAL_MEM_SIZE 34 MACH_EXTRA 18 NV_RAM_SIZE 39 SYS_CLK_RATE_MAX 39 SYS_CLK_RATE_MIN 39 Makefile 7. 13. 110 MIPC WDB Agent Proxy backend (component) 107 MIPC_SM_NODES 107. 110. 34 migrating applications 45 MIPC demo 114 tutorial 105 verifying connectivity 113 MIPC demo (component) 107. 21 limitations 22 MMU simulation 21 page size 22 translation Model 22 memory protection level 36 -memsize 11. 68. 12 devs( ) 39 ifconfig( ) 69 intConnect( ) 119. 34 SM_MEM_SIZE 7 SM_OBJ_MEM_SIZE 7 smEnd 7 SMP support 3 creating an image 43 system requirements 5 solaris 7 -sp 56 specifying the passFS device name 37 standard I/O 18. 120 intDisconnect( ) 119 sysAuxClkRateSet( ) 39 sysBusToLocalAdrs( ) 18 sysClkRateSet( ) 39 sysMemTop( ) 28 sysNvRamGet( ) 39 sysNvRamSet( ) 39 virtualDiskClose( ) 39 virtualDiskCreate( ) 38 virtualDiskInit( ) 38 vxsimExitHookAdd( ) 119 vxsimFdIntDisable( ) 119 vxsimFdIntEnable( ) 119 vxsimHostDllLoad( ) 118 vxsimHostProcAddrGet( ) 118 vxsimIntAckRtnAdd( ) 120 vxsimIntRaise( ) 120 vxsimIntToMsg( ) 120 vxsimMsgToInt( ) 120 vxsimWindowsHandleGet( ) 120 RTP support 3. 57 serial I/O driver 40 serial line support 40 setting up the network daemon 76 shared memory address space 28 END driver 7 pool size 7 size 7 shared memory network 40 -shell 56. 39 starting a standalone VxWorks Simulator instance 12 a VxWorks simulator instance 77 simulator instances for use with network services 13 the network daemon on the host 77 the VxWorks Simulator from Workbench 14 -startup 11 subnet configuring 68 wrnetdlink 69 SUBNET_ACCESSMODE 61 SUBNET_ADDRESS 61 SUBNET_BROADCAST 62 SUBNET_ERRORRATE 62 SUBNET_EXTCONNNAME 63 P -p 10. 13 packet loss 58 packet sniffers 48. 119 SIGUSR1 26 SIGUSR2 26 SIMLINUX 19 simnet 48 simnet_nat 71 SIMNT 19 simpc 7 SIMPENTIUM 20 SIMSPARCSOLARIS 20 simulated hardware support 3 simulating packet loss 58 SIO driver 39 -size 11. 57 SIGALRM 25 SIGPOLL 25. 6. 37 -password 10 physical memory address space 34 Ping client (component) 110 -pl 11 -processor 10 -prot-level 11.9 O -o 10 -other 10 S -s 11.Wind River VxWorks Simulator User's Guide. 36 -pw 10 R remote host 15 router configuration 13 routines bootChange( ) 34 bootChange( ) 8. 57 shell vxsimnetd 86 -shellport 56 -shellserver 56. 63 passDev 9 passFS see pass-through file system pass-through file system 23. 56. 23 running the MIPC demo 114 128 . 58. 12 configuration options 8 vxsimapi 117. 57 SYS_CLK_RATE_MAX 39 SYS_CLK_RATE_MIN 39 sysAuxClkRateSet( ) 39 sysBootLine 18 sysBusToLocalAdrs( ) 18 sysClkRateSet( ) 39 sysLib.c 18 129 . 23. 35 VxMP 7 vxprj 81. 38 virtual memory address space 35 virtualDiskClose( ) 39 virtualDiskCreate( ) 38 virtualDiskInit( ) 38 VM_PAGE_SIZE 22 VM_STATE_CACHEABLE 22 VM_STATE_CACHEABLE_NOT 22 VM_STATE_VALID 22 VM_STATE_VALID_NOT 22 VM_STATE_WRITEABLE 22 VM_STATE_WRITEABLE_NOT 22 VMEbus 40 -vsize 11. 63 SUBNET_EXTERNAL 61 SUBNET_EXTPROMISC 62 SUBNET_GID 61 SUBNET_MACPREFIX 61 SUBNET_MASK 61 SUBNET_MAXBUFFERS 62 SUBNET_MAXNODES 62 SUBNET_MTU 63 SUBNET_MULTICAST 62 SUBNET_RECQLEN 62 SUBNET_SHMKEY 62 SUBNET_TIMEOUT 63 SUBNET_UID 61 supported VxWorks features 2. 118 vxsimExitHookAdd( ) 119 vxsimFdIntDisable( ) 119 vxsimFdIntEnable( ) 119 vxsimHostArchLib 117 vxsimHostDllLoad( ) 118 vxsimHostProcAddrGet( ) 118 vxsimIntAckRtnAdd( ) 120 vxsimIntRaise( ) 120 vxsimIntToMsg( ) 120 vxsimMsgToInt( ) 120 vxsimnetd 50. 39 -user 11 USER_INT_RANGE_BASE 120 USER_INT_RANGE_END 120 -username 11 V -v 11 -vaddr 11.Index SUBNET_EXTDEVNUM 62. 6 -sv 56.c 18 sysMemTop( ) 28 sysNvRamGet( ) 39 sysNvRamSet( ) 39 system clock 39 U -unit 11 UNIX disk driver library 38 unixDrv 38 unixSio. 109. 77 command-line options 55 configuration file example 80 debug shell 57 dynamic configuration 86 removing the Windows service 57 shell 86 shell commands 57 T TAP driver 63 TAP-Win32 driver 65 WRTAP driver 64 TAP-Win32 driver 65 -targetname 11 testing an IPv6 connection 99 timers 39 timestamp driver 40 tip serial line connection utility 107 tip utility 107. 35 -version 11 vi 57 virtual disk support 3. 114 -tmpdir 11 -tn 11 TOOL 18 ttySio 122 tun module 66 tutorial AMP with MIPC 105 IPv6 97 networking across multiple hosts with wrnetdlink 89 running the simulator on the local network 93 simple simulated network 76 simulated network with multiple simulators 79 tyLib.c 18. 90 VxSim accessing the console through a Telnet client 45 exceptions 123 vxsim 8. 111 INCLUDE_MIPC_SHOW 107. 111 INCLUDE_MIPC_DEMO 107. 39 wrenv 78 WRLoad (build component) 107. 111 VxWorks image vxWorks 7 vxWorks.c 18. 111 INCLUDE_PING6 99 INCLUDE_ROUTECMD 81. 41 INCLUDE_SM_NET 41 INCLUDE_SM_OBJ 7. 110.st 7 VxWorks image projects (VIPs) 7 VxWorks simulator network daemon see vxsimnetd vxWorks. 109. 90.Wind River VxWorks Simulator User's Guide.9 ? 58 delete 58 errorrate 58 extpromisc 58 help 58 mode emacs 58 mode vi 58 node 57 packet 58 quit 58 source 58 subnet 57 timeout 58 starting as a root service 53 starting as a Windows service 53 static configuration 80 vxsimnetds_inst. 27 WDB back end 23 WDB_POOL_SIZE 28 Wind River System Viewer 40 winSio. 91. 110. 110 wrnetdlink 69 connecting simulated subnets 92 tutorial 89 WRTAP driver 63. 91 INCLUDE_SM_COMMON 7. 111 INCLUDE_NET_BOOT_CONFIG 69 INCLUDE_PASSFS 37 INCLUDE_PING 81. 108.st 7 W watchdog timer facilities 25. 41 INCLUDE_SYS_TIMESTAMP 40 INCLUDE_TIMESTAMP 40 INCLUDE_VIRTUAL_DISK 38 INCLUDE_WDB_PROXY_MIPC 107 INCLUDE_WDB_SYSVxWorks 111 INCLUDE_WRLOAD 107. 108 INCLUDE_WRLOAD_IMAGE_BUILD 110. 111 BUNDLE_AMP_SEC 110 VxWorks components INCLUDE_BOOT_LINE_INIT 7 INCLUDE_HOST_SIO 40 INCLUDE_IPCOM_SYSVAR_CMD 99 INCLUDE_IPD_CMD 99 INCLUDE_IPRADVD_CMD 99 INCLUDE_MCB_SHOW 108. 110 INCLUDE_MIPC_SM 107. 110. 108. 109. 110. 108. 90. 111 INCLUDE_MSD 107. 110. 6. 64 X xterm 8 130 . 111 INCLUDE_MND 107. 108. 107.exe 52 vxsimWindowsHandleGet( ) 120 vxWorks 7 VxWorks AMP tutorial 105 verifying connectivity 113 VxWorks bundles BUNDLE_AMP_PRI 107.
Copyright © 2024 DOKUMEN.SITE Inc.