All Forums
 Embedded Linux
 Linux FAQ
 Setting up a cross-development environment
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

jlackey

213 Posts

Posted - 06 May 2002 :  11:01:12  Show Profile  Email Poster
This topic will step you through the process of setting up a cross-development environment on an x86 PC, building a linux kernel, and loading the kernel and a ramdisk root file system on your board.
    Note: If you have a full Debian evaluation system, you do not need to follow these instructions. Full Debian systems include a complete native-devopment environment so you can develop your software on your evaluation system. If you did not purchase a full Debian evaluation system but want to set one up, see these topics: Running Debian on a Microdrive, Debian without a Microdrive, and for the latest release, Root File Systems.
These instructions and examples assume you are running linux on a x86 PC and that you are using the bash shell and X windows.

1. Cross Compiler

The first thing you'll need is a cross compiler. A cross compiler is used to build user programs, kernels, and modules. You can find one along with installation instructions in the Cross Compiler topic.

Some kernel versions have specific compiler requirements. If you want to build a kernel for your board - instead of using one of our pre-compiled kernels - and the version you've selected has specific compiler requirements, this will be noted in the Warnings and Requirements secion on the kernel's download page.

2. ADS Kernel

Next you'll need a kernel. You can use one of the precompiled kernel images or you can build your own from source code. You're probably going to need the kernel source during development anyway, so you might as well get it now.

2.1 Kernel Source Code

Links to the source code and patch files for versions of the kernel compatible with ADS boards are also provided on the kernel image pages. Usually, you'll want to use the most recent kernel release.

Each version starts with a baseline and then has various patches applied by Linux, ARM, and ADS maintainers. Patches must be applied consecutively. For example, to build the Linux 2.4.19-rmk2-ads1 kernel, you start with the Linux 2.4.19 source code, then apply the rmk2 (Russell King - arm.linux.org) patch, and finally the ads1 patch (Applied Data Systems). Version specific instructions are provided with the source file links.

2.2 Building the Kernel

If you are using one of the precompiled images, you can skip this section.

To build the kernel, change directories to the linux directory where you installed the source code (e.g. cd /usr/local/src/linux) and issue the command:
    make distclean
    [Return to this step if you need to build a different board type from the same source.]
Then issue one of the following commands:
    make adsbitsyx_config (for the BitsyX)
    make adsagx_config (for the AGX)
    make adsvgx_config (for the VGX)
    make adsgcx_config (for the GCX)
    make adsbitsyplus_config (for a Bitsy Plus)
    make adsbitsy_config (for the Bitsy)
    make adsagc_config (for the Advanced GraphicsClient)
    make graphicsclient_config (for a GraphicsClient Plus)
    make graphicsmaster_config (for the GraphicsMaster)
Then:
    make oldconfig
Use this command to change the kernel configuration (optional):
    make menuconfig
    [Return to this step if you need to change the kernel configuration later.]
Then:
    make dep
and finally:
    make zImage
    [Return to this step if you make changes to the kernel source code.]
You'll find the compressed kernel zImage file in the linux/arch/arm/boot directory (e.g. ls arch/arm/boot).

3. Root File System

Now you need a root file system to go with your kernel. This section assumes you'll be using a ramdisk root file system although other options can be found here. You can modify the ramdisk to suit your needs but start with the one for your version of the kernel. (In the past, we've supplied a ramdisk root file system for each kernel version. Beginning with linux-2.4.26-vrs1-pxa1-adsx1, this is no longer the case.) If you can't get the one you need from the Linux kernel version link you selected above, visit the Root File Systems topic.

To make permanent changes to the ramdisk, issue these commands:
    gunzip ramdisk.gz
    mkdir /mnt/loop
    mount -o loop ramdisk /mnt/loop
Now make your changes and then:
    umount /mnt/loop
    gzip ramdisk
4. Loading the Kernel and Ramdisk

Copy the compressed zImage and ramdisk.gz files to an ATA Flash Card. If your development system has a PC Card slot you can do this:
    mkdir /mnt/flash1
    mount -t vfat /dev/hde1 /mnt/flash1 (you can usually leave the '-t vfat' option out)
    cp linux/arch/arm/boot/zImage /mnt/flash1
    cp ramdisk.gz /mnt/flash1
Don't forget to unmount the card before you eject it:
    umount /mnt/flash1
To boot from an ATA flash card, follow the instructions in the Boot ROM Manual. Then insert the card in your board and press the reset switch.

To program these files in the on board flash memory, follow the instructions in the Boot ROM Manual.

5. Login

Connect a serial cable from your PC to the debug port on the board.
Run a terminal program on the PC set to:
    38400 baud rate
    no parity
    8 bit data
    1 stop bit
    no flow control
Press the reset switch on the board to watch it boot. Type 'root' at the Linux login prompt with no password. After your board boots, you can remove the flash card or mount it as needed for your development.

01-Dec-2004: jlackey - delete obsolete info, add debug port link, rename topic to emphasize cross-development
23-Jun-2004: jlackey - update stale info and add notes related to running a full Debian system
10-Oct-2003: jlackey - update cross-compiler discussion and links


Edited by - adrian on 07 Jan 2008 15:15:37

adrian

17 Posts

Posted - 14 Jan 2008 :  10:49:26  Show Profile  Email Poster
Note that this topic mostly concerns itself with older hardware and software (2.4 kernels). For more recent hardware and software, please see Getting Started with Linux on ADS Computers.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000