|
PlatformDeveloperGettingStart
IntroductionThis page describes how to compile the whole platform of tmlinux (includding linux kernel, uclibc and so on) and how to populate sysroot for application developer. DetailsPreparation0. Environment setupIn the following section, let's suppose:
1. Get and Install TCS Linux editionFirst of all, you should install TCS Linux edition on your Linux machines. Please goto http://www.tcshelp.com to get it. Of course, you should have the license for it. In the following section, let's suppose the installation directory of your TCS is /opt/NXP/TCS520/ Note that To make sure the TCS tools(such as tmcc, tmld) are in the PATH environment export PATH=$PATH:/opt/NXP/TCS520/bin/ guohr@ghr-notebook-02:~/worktest> tmcc -V tmcc: V7.1.0 of TCS V5.1(0042rc6_Linux) tmcc warning : no work 2. Get and install NDK editionThen, you should install NDK on your windows machine. And then pack the whole NDK directory and copy it to your linux machine (work machine of tmlinux). On your linux machine, unpack it to /opt/NXP/NDK6.0. Note that 3. Install CIL (C intermedia language)Note that: before continuing, you need to make sure you have installed OCaml language compiler. OCaml can be downloaded from http://caml.inria.fr/ocaml/. After downloading and unpacking the source distribution, in the ocaml directory, do: ./configure make world make opt make install Before building Linux kernel image, you need to setup and install cil in your Linux machine, which is used to process GNU C extension options when compiling Linux kernel. Use the following command to check it out and compile, setup it. svn checkout http://tmlinux.googlecode.com/svn/trunk/cil cd cil/ ./configure make export PATH=$PATH:/home/guohr/worktest/cil/obj/x86_LINUX/ To validate the environment, type the following command and you will get the following message: guohr@ghr-notebook-01:~/worktest/cil> cilly.asm.exe Error: No arguments for CIL Fatal error: exception Errormsg.Error Build Linux Kernel1. checkout Linux kernel of tmlinux and setup environmentcheckout Linux kernel of tmlinux using the following command (at /home/guohr/worktest/): git clone git://github.com/camelguo/linux-2.6-trimedia.git linux and run setup.sh to setup the compilation enviroment using the following commands: cd /home/guohr/worktest/linux/ export NDK=/opt/NXP/NDK6.0/ ./setup.sh the evironment NDK should be set to your NDK directory. 2. Configure Linux kernelFirst configure the linux kernel using default configuration files by the following command (at /home/guohr/worktest/linux/ directory). To compile kernel for PNX1500 simulator make sim1500_defconfig To compile kernel for PNX1005 simulator make sim1005_defconfig To compile kernel for MBE1500 make mbe1500_defconfig Then adjust the configuration if necessary by the following command make menuconfig 3. Build Linux kernelTo build linux kernel image, use the following command at /home/guohr/worktest/linux: make After building kernel, the TMLinux-pnx1500-*-el.out at /home/guohr/worktest/linux/arch/trimedia/boot/ is the executable Linux kernel image. Build uClibc and generate sysroot1. Checkout sysroots and uClibcCheckout sysroots and uClibc using the following commands: svn checkout http://tmlinux.googlecode.com/svn/trunk/sysroots svn checkout http://tmlinux.googlecode.com/svn/trunk/uClibc 2. Setup TCS for tmlinux build environmentTo create the whole TCS environment for building tmlinux uClibc and applications, you need to goto sysroots/sysroots/tcs/5.1.0 and then use the following command: cd /home/guohr/worktest/sysroots/tcs/5.1.0 TCS=/opt/NXP/TCS510 ./creat-tcs.sh Please set TCS using your TCS installation path (In the above example, it is /opt/NXP/TCS510). 3. Configure, build and install uClibcTo build uClibc, you need to set the following configuration options correctly using the following command: make menuconfig TCS include search pathTarget Architecture Features and Options -> tmcc compiler include search path In this example, it is /home/guohr/worktest/sysroots/tcs/5.1.0 Linux locationTarget Architecture Features and Options -> Linux Kernel header location In this example, it is /home/guohr/worktest/linux uClibc installation directoriesLibary Installation Options -> uClibc runtime library directory for pnx1500 simulator, it is /home/guohr/worktest/sysroots/pnx1500_ttisim_uclibc/sysroot; for pnx1005 simulator, it is /home/guohr/worktest/sysroots/pnx1005_ttisim_uclibc/sysroot; for pnx1500 standalone board, it is /home/guohr/worktest/sysroots/pnx1500_nohost_uclibc/sysroot; Libary Installation Options -> uClibc development environment directory for pnx1500 simulator, it is /home/guohr/worktest/sysroots/pnx1500_ttisim_uclibc/sysroot/usr; for pnx1005 simulator, it is /home/guohr/worktest/sysroots/pnx1005_ttisim_uclibc/sysroot/usr; for pnx1500 standalone board, it is /home/guohr/worktest/sysroots/pnx1500_nohost_uclibc/sysroot/usr; Build and install uClibc using the following commands: make make install After installing uClibc, it is the time to deliver sysroots to application developers: For how to build applications, please refer ApplicationDeveloperGettingStart; For how to build busybox, please refer BusyboxGuide. Generate target root filesystemThe target root filesystem is formed by a set of basic files (device node files and system configuration files) and lots of optional software package. This section describes how to form the target root filesystem for tmlinux. 1. Install the basic files for the filesystemIn SVN repository, there is a package call filesystem, which contains the basic files for target root filesystem of tmlinux. First, check it out from svn (suppose the directory of filesystem is /home/guohr/workdir/tmlinux/filesystem): cd /home/guohr/workdir/tmlinux/ svn co http://tmlinux.googlecode.com/svn/trunk/filesystem Second, install it to the target root filesystem directory (Let suppose the directory /home/guohr/workdir/tmlinux/export contains the whole content of the target root filesystem): mkdir /home/guohr/workdir/tmlinux/export/ cd /home/guohr/workdir/tmlinux/filesystem/ vi Makefile And then, set TARGET_ROOTFS=/home/guohr/workdir/tmlinux/export/. At directory /home/guohr/workdir/tmlinux/filesystem/ make Now the basic files should be installed into the target root filesystem (/home/guohr/workdir/tmlinux/export) 2. Install busybox for the filesystemBusyBox combines tiny versions of many common UNIX utilities into a single small executable. It is optional for the target root filesystem, but you are well advised to install it into target root fs. To Build it, please refer BusyboxGuide. To install it, you need to set Busybox Settings -> Installation Options -> Busybox installation prefix to the target root filesystem directory, in the above example, it is /home/guohr/workdir/tmlinux/export. And then type make install. 3. pack the target root filesystem and deliver it to application developerAfter install your software package for the target root filesystem, it is the time to deliver it to application developers, so that they can boot the whole linux system using it. To pack the target root filesystem, please use the following commands: tar -C /home/guohr/workdir/tmlinux/export -cpf - . | bzip2 -9f > trimedia-uclibc_small-small-dist.tar.bz2 Above, the /home/guohr/workdir/tmlinux/export is the target root filesystem directory, the trimedia-uclibc_small-small-dist.tar.bz2 contains the whole target root fs. The application developers should unpack it using the following commands: tar xvfjp trimedia-uclibc_small-small-dist.tar.bz2 -C /home/guohr/export Above, the /home/guohr/export is the directory which contains the target root filesystem content. referencesFor more information about booting linux on trimedia, please refer BootingLinuxOnTriMedia. |
Do not try to build tmlinux on cygwin. I have never tested on cygwin.