S A N K H Y A Copyright (c) 2002 Sankhya Technologies Private Limited. All rights reserved. SANKHYA Varadhi: Development Notes for using SANKHYA Varadhi for Windows CE =========================================================================== SANKHYA Varadhi has been ported to Microsoft Windows CE Operating System. Applications can be developed using SANKHYA Varadhi for the following WindowsCE environments. - x86 device emulation (Handheld PC) - ARM (Pocket PC). Refer to the Microsoft Windows CE release notes for more information on developing applications for Windows CE. The platform specific Varadhi configuration files for Windows CE are arm-wince.cfg - for ARM platform x86em-wince.cfg - for x86 device emulation platform sh-wince.cfg - for SH platform mips-wince.cfg - for MIPS platform The rest of the document explains how to use Varadhi with Embedded Visual C++ for developing applications for Windows CE Handheld PC (x86em) and Windows CE Pocket PC (ARM). Pre-requisites Host : x86 PC Host OS : Windows NT 4.0/Windows 2000 Target OS : Windows CE 3.x Tools : Microsoft SDK for Windows CE, Handheld PC/Pocket PC, Microsoft Embedded Visual C++ 3.0, Microsoft ActiveSync 3.x, Varadhi Host Tools and Host Run-time for Win32, Varadhi Modules for cross-platforms support for WinCE. Building and Running the Demo Applications Currently the 'pingpong' and 'coloc' demos are available as sample Windows CE applications for a Handheld PC emulation (x86em) and ARM Pocket PC environments. Pingpong Demo: 1. Set environment variables Varadhi tools require the following environment variables to be set: * VARADHI - Directory path pointing to the root of installation * VARADHI_HOST - Host platform name like sol2, linux and win32 In order to set these variables and PATH variable, run varadhi.cmd in the SANKHYA Varadhi installation root directory. In Windows Command Prompt, run varadhi.cmd as below. C:\> \varadhi.cmd where is the directory where Varadhi is installed. 2. Copy the demo program "pingpong" to your work area To build and run the demo, copy the demo to a work directory and build/run from there. This will ensure that the original installation directory doesn't get modified accidentally. Determine a work directory (e.g. my_varadhi) where you will run the demo and change directory to it. In Windows Command Prompt C:\> cd \> set WORK_DIR= \> copy %VARADHI%\samples\pingpong . 3. Create a Varadhi Target Platform (For using a pre-built target platform, skip this and the next step, and continue from Step5) Varadhi can be customized for a particular target configuration using 'vconf'. Varadhi configuration files are provided under %VARADHI%\etc\config directory to create Varadhi Targets For example, to create a default platform for Windows CE, Handheld PC for x86em, use the following: 3.a Change directory to your workspace In Windows Command Prompt C:\> cd %WORK_DIR% 3.b Invoke 'vconf' with three config files, one providing configuration options for the ORB, another one specifying the target platform (x86 Emulation on WinCE) and another one for licensing. In Windows Command Prompt %WORK_DIR%\> vconf defaults x86em-wince license.cfg For building a platform for ARM Pocket PC environment, use arm-wince.cfg configuration file as below In Windows Command Prompt %WORK_DIR%\> vconf defaults arm-wince license.cfg To create Varadhi plaforms for other Windows CE target platform for ARM, change the value of the configuration variable "target_platform" in arm-wince.cfg. For e.g., to create a Varadhi Target platform for ARM Handheld PC, change the value to "hpc_arm" declare target_platform -type string -default "hpc_arm" -flag target_platform -action make_macro 4. Setup the Varadhi Target Platform Environment The above configuration places a batch file in the %VARADHI_PLATFORM% directory to setup Varadhi Target Environment. Here, VARADHI_PLATFORM refers to the root directory where Varadhi Platform is created. In Windows Command Prompt %WORK_DIR%\> cd %WORK_DIR%\varadhi %WORK_DIR%\varadhi\> platform.bat This will set the following variable: VARADHI_PLATFORM - Directory path pointing to the root of the created Target Platform 5. Use pre-built Varadhi Target Platform (If you used steps 3 and 4 for creating a Varadhi Target platform, skip this step) Varadhi ships with pre-built Target platform for Handheld PC for x86 emulation. This can be used for testing the demos. Step-1: List available pre-built Varadhi Platforms. In Windows Command Prompt %WORK_DIR%\> dir %VARADHI%\platforms Step-2: Set Varadhi Target Platform Environment In Windows Command Prompt %WORK_DIR%\> %VARADHI%\platforms\%VARADHI_TARGET%\platform.bat Here, VARADHI_TARGET refers to the directory name of one of the pre-built Varadhi Target Platform for Windows CE from Step-1. 6. Build the demo program To build the demo program, change directory to the demo directory and run nmake. For example In Windows Command Prompt %WORK_DIR\> cd pingpong %WORK_DIR%\pingpong\> nmake /f makefile.nt Note: This assumes that EVC++ paths are properly set before. This can be done as follows: a) Change Directory to the location where .bat is available. Usually, this location is C:\Program Files\Microsoft eMbedded Tools\EVC\\BIN b) Run .bat from command line after changing to the above directory. Here, refers to the WindowsCE target platforms - x86em, ARM 7. Running the demo program 'pingpong' on x86 emulator Requirements: * For this demo, build one pingpong server for WinCE H/PC emulation using steps 1 -6 mentioned above. * Build another pingpong server for Windows NT Native. Refer to the SANKHYA Varadhi user guide or the README file in %VARADHI%\samples directory to build the pingpong server on Windows NT host. Running the demo involves the following steps: 1) Start the Naming Server (ns.exe) on Windows Host In Windows Command prompt C:\> ns 2) Run one pingpong application (server.exe) from the Handheld PC object store as follows. a) Copy the server.exe built using steps 1-6 to H/PC object store In H/PC emulation environment command prompt: empfile -c %WORK_DIR%\pingpong\server.exe wce:\windows b) Run the server.exe from H/PC object store empfile -r wce:\windows\server 3) Run the other pingpong server on Windows NT, which was built on Windows NT, as follows C:\> server --VaradhiPORT 2001 b a 1 8. Running the demo program 'pingpong' on Pocket PC Requirements: * For this demo, build one pingpong server for WinCE Pocket PC environment using steps 1 -6 mentioned above. * Build another pingpong server for Windows NT Native. Refer to the SANKHYA Varadhi user guide or the README file in %VARADHI%\samples directory to build the pingpong server on Windows NT host. Running the demo involves the following steps: 1) Start the Name Server (ns.exe) on Windows Host In Windows Command prompt C:\> ns 2) Run one pingpong application (server.exe) from the Pocket PC as follows. a) Copy the server.exe built using steps 1-6 to Pocket PC using Microsoft ActiveSync. b) Run the server.exe from PocketPC 3) Run the other pingpong server on Windows NT, which was built on Windows NT, as follows C:\> server --VaradhiPORT 2001 b a 1 Limitations: * Currently the application has been hard coded to take the command line arguments "a b 0" inside the application. So no argument is required to be passed for running the pingpong server on WinCE. * Name server (ns.exe) should run on the same host and in the default ns port due to the command line limitation. Coloc Demo: 9. Build the 'coloc' demo program Using the steps 1-6 mentioned above, the 'coloc' application can be built for x86 H/PC emulation environment and ARM Pocket PC environment. 10. Run the demo program 'coloc' on x86 emulator Running the demo involves the following steps: a) Copy the coloc.exe built using steps 1-6 to H/PC object store In H/PC emulation environment command prompt: empfile -c %WORK_DIR%\coloc\coloc.exe wce:\windows b) Run the coloc.exe from H/PC object store empfile -r wce:\windows\coloc 11. Run the demo program 'coloc' on Pocket PC Running the demo involves the following steps: a) Copy the coloc.exe built using steps 1-6 to Pocket PC using Microsoft ActiveSync. b) Run the coloc.exe from PocketPC --------------------------------------------------------------------------