S A N K H Y A Copyright (c) 2004 Sankhya Technologies Private Limited. All rights reserved. SANKHYA Varadhi: Development Notes for using SANKHYA Varadhi for CE Linux ========================================================================= SANKHYA Varadhi supports cross-platform development environment for Consumer Electronics Linux (CE Linux) for x86 target. Applications can be developed using SANKHYA Varadhi for the following CE Linux environment. - x86 target - 2.4.18 CE Linux kernel - Red Hat 8.0 kernel modules Pre-requisites Host : x86 PC Host OS : Red Hat Linux 8.0 Target : x86 Target OS : Consumer Electronics Linux Kernel Version : 2.4.18 Tools : gcc 2.96 and g++ 2.96 Building and Running the Demo Applications ========================================== SANKHYA Varadhi supports cross-platform development environment for Consumer Electronics Linux for x86 target (CE Linux kernel is built on Red Hat 8.0 with gcc 2.96 version). The Varadhi samples are built on Red Hat 8.0 and run on CE Linux. Following are the steps to build and run the samples. 1. Set up the Varadhi Host environment 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 linux In order to set these variables and PATH variable, run varadhi.csh in the SANKHYA Varadhi installation root directory. In csh, run varadhi.csh as below. % source /varadhi.csh where is the directory where Varadhi is installed. By default Varadhi is installed under /opt/sankhya/varadhi in Linux. 2. Copy the demo program(s) to your work area. To build and run the samples, it is better to copy the demo to a work directory and build/run from there. This will make sure that the original installation directory doesn't get modified accidentally. In csh % cd % set WORK_DIR=`pwd` % cp -r $VARADHI/samples . 3. Create a Varadhi Target Platform (For using a pre-built target platform, skip this and the next step, and continue from Step-5) Varadhi can be customized for a particular target configuration using 'vconf'. On Linux, Varadhi configuration files are provided under '$VARADHI/etc/config' directory to create various Varadhi Target Platforms. For example, to create a default platform for your host (native target) that supports C++ Exception and with no support for static Heap allocation, use the following. 3.a Change directory to your work area In csh % cd $WORK_DIR 3.b Invoke vconf with two config files, one providing configuration options for ORB and another one that specifies the target platform. In csh % vconf defaults linux-gcc The configuration that is built with 'defaults' configuration file enables C++ Exception support. 4. Setup the Varadhi Target Platform Environment The above configuration places a script file in the $VARADHI_PLATFORM directory to setup the Varadhi Target Environment. Here, VARADHI_PLATFORM refers to the root directory where Varadhi Platform is created. In csh % cd $WORK_DIR/varadhi % source platform.csh 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 Varadhi ships with pre-built Target platform for native host development on Linux. This can be used for testing the demos. In this case, step (3) and (4) can be skipped. 5.a List available pre-built Varadhi platforms. In csh % ls $VARADHI/platforms/linux 5.b Set Varadhi Target Platform Environment. In csh % source $VARADHI/platforms/linux//platform.csh Here, refers to a pre-built Target platform directory name. The available pre-built target platforms are "defaults", "defaults-mt and "static". defaults - Platform created with defaults.cfg and se.cfg This configuration enables C++ Exception/RTTI support. defaults-mt - Platform created with defaults.cfg, mt.cfg and se.cfg This configuration enables C++ Exception/RTTI support and multi-threaded request handling on the server-side. static - Platform created with static.cfg This configuration disables C++ Exception/RTTI support and enables Varadhi memory management for dynamic memory allocation. 6. Build the sample program On Unix host, a makefile is provided for building the demo application using g++ on Linux host. You may have to modify it if you want to use different compiler. To build the sample program, change directory to the demo directory and run make. For example, In csh % cd $WORK_DIR % cd samples\adder % make 7. Running the demo program on CE Linux Copy the executables (for e.g., 'server' and 'client' for adder demo) to a common location for CE Linux and the host on which you have built the samples. Then boot the CE Linux. Now, follow the below steps to run the demo program on the CE Linux. For example, to run the adder demo, start the 'server' application and then run the 'client' application. 7.a Start the Server Application In tcsh % ./server & 7.b Run the Client Application In tcsh % ./client Note: The server and client executables are built on Red Hat Linux 8.0 and executed on CE Linux system. Steps to build and boot the CE Linux kernel =========================================== Sources: -------- Sources are downloaded from the below URL released on May 03, 2004. URL : http://tree.celinuxforum.org/ File: celinux-040503.tar.bz2 Steps to build the kernel: -------------------------- Step-1: Copy the source package to work directory ($WORK_DIR) and uncompress the package using "bunzip2" utility. $ tar --bzip -xvf celinux-040503.tar.bz2 Step-2: After uncompressing the CE Linux source it will create a directory named as 'celinux-040503'. Go to 'celinux-040503' directory. $ cd $WORK_DIR/celinux-040503 Step-3: Follow the below steps to configure and build the CE Linux kernel image: $ make config $ make dep $ make bzImage Note : The built CE Linux kernel image (File: bzImage) will be created under "./arch/i386/boot/" directory. Steps to boot the Kernel ------------------------ Step-1: To boot the CE Linux kernel image, copy the '.config', 'System.map' 'vmlinux' and 'bzImage' to some specific boot location. The 'bzImage' must be copied as 'vmlinuz'. For example: $ cp .config /embedded/celinux/boot/config.2.4.18-celf3 $ cp System.map /embedded/celinux/boot/System.map.2.4.18-celf3 $ cp vmlinux /embedded/celinux/boot/vmlinux.2.4.18-celf3 $ cp ./arch/i386/boot/bzImage /embedded/celinux/boot/vmlinuz.2.4.18-celf3 Step-2: Update the '/boot/grub/grub.conf' file with the CE Linux kernel image and native linux (ie. Red Hat Linux 8.0) initrd image locations for booting system. For example: title CE Linux root (hd0,5) kernel /embedded/celinux/boot/vmlinuz.2.4.18-celf3 initrd /boot/initrd-2.4.18-14.img Note: The grub.conf file should be modified by 'root'. Step-3: To check the CE Linux kernel version after booting the system, use the following command: $ uname -a Linux linux4 2.4.18-celf3 #1 Thu Nov 4 15:22:17 IST 2004 i686 i686 i386 GNU/Linux Note: The CE Linux kernel image can be built on Red Hat Linux 8.0 and above versions. -------------------------------------------------------------------------------