Next Previous Contents
3. Building a MontaVista Kernel

In order to install the preview kit onto a Linux machine, you must have root access.

3.1 Installing the MontaVista Preview Kit

Begin by downloading the MontaVista Preview Kit. To download the MontaVista Linux Preview Kit, fill out the registration form at the bottom and you will be sent a download location and installation key. Select "Xilinx Virtex-II Pro ML300" as the platform when completing the preview kit download form. Once all required fields are complete, submit the form and accept the license agreement. And email will be sent to the address entered into the "E-mail address" field which contains an FTP link and a password used during the installation process.

Download the Preview Kit's image file from the FTP link sent to your email address. The filename should look somthing like previewkit-mvl310_xilinx-ml300-encrypt.img. Once the download is complete, create a directory to mount the image file to.

$ mkdir <mount_dir>

Now switch user to root, mount the previewkit image file as an iso9660 filesystem, enter the <mount_dir> and start the install script. NOTE: this install script requires a bash shell for propper installation.

$ su
# mount previewkit-mvl310_xilinx-ml300-encrypt.img -t iso9660 -o loop <mount_dir>
# cd <mount_dir>
# ./install_previewkit

The install script prompts for the password that was included in the email from MontaVista from the registration process. Once you've entered that it requests a path to be the top installation directory. Default is /opt, which is fine. Next, the script prompts for choices of architectures to install binaries for. The selection screen should look something like:

      Architecture   Linux Support Package
      ------------   ---------------------
  1.       ppc_405   xilinx-ml300-previewkit
                     Xilinx® ML300

Choose the LSP/Architecture to install by number.

If so, press '1' and hit enter to start the actual installation. After several minutes, the script should politely thank you for installing the MontaVista(R) Linux(R) Preview Kit and terminate. To release the mount of the image file, change directory out of <mount_dir> and issue a umount to it.

# cd ../
# umount <mount_dir>

3.2 Configuring / Building the Kernel

After the preview kit is installed, there is no more need for root access. To keep things clean, exit the root shell.

# exit

The preview kit supplies a PowerPC crosscompiler. In order to make use of this toolchain, simply add <previewkit_dir>/montavista/preview/ppc/405/bin to your PATH. From a bash shell:

$ PATH=$PATH:<previewkit_dir>/montavista/preview/ppc/405/bin

Now copy the MontaVista kernel source from the install directory to somewhere convenient in your home directory.

$ cp -R <previewkit_dir>/montavista/previewkit/lsp/xilinx-ml300-previewkit-ppc_405/linux-2.4.20_mvl31 <kernel_src_dir>

Next, you need to copy the Board Support Packages into the kernel source directory. The Board Support Packages (BSPs) are definitions and drivers generated by the Xilinx System Platform. For information on building the BSPs, consult the Xilinx tools. Once the BSPs are built, copy them directly into the top kernel source directory.

$ cd <kernel_src_dir>
$ cp -R <BSP_dir>/* .

To verify which files have been changed between hardware definitions, issue a diff command:

$ diff -r <BSP_dir>/arch/ arch/ | grep diff

The output can be something like the following, which means that only xparameters_ml300.h has changed. A similar command can also be used to check differences in the driver files.

diff -r <BSP_dir>/arch/ppc/platforms/xilinx_ocp/xparameters_ml300.h arch/ppc/platforms/xilinx_ocp/xparameters_ml300.h

The kernel source is now final, and the configuration must be specified to continue. You can either start with a default configuration and customize the kernel parameters however you see fit, or you can download the configuration we have derived. To load a configuration, start the kernel configuration menu with one of the following make commands from the top kernel source directory.

$ make xconfig
  - or -
$ make menuconfig

If you intend to load the default configuration, select the option to load a configuration from file, and load <kernel_src_dir>/arch/ppc/configs/xilinx_ml300_defconfig. On the other hand, if you plan to load our modified configuration, simply save the file and load it instead of the default configuration file. Once the configuration in loaded and modified to your liking, exit the kernel configuration manager saving the configuration in the process. Now you must build the kernel. This can be accomplished with the following sequence of make commands.

$ make dep
$ make bzImage
$ make modules

NOTE: If you are using our modified configuration, Loadable Module Support is removed from the kernel. So disregard the make modules command and all installation directions for modules.

3.3 Installing the Kernel

Once the compile is finished, all that's left is to install the kernel and modules on the ML300. The System.map file contains the symbol information for this kernel, which will be required if you need to report a problem. System.map can be found in the root directory of the kernel source tree.

The kernel itself is named zImage.elf and can be found in

<top_kernel_dir>/arch/ppc/boot/

The modules need to be installed to some directory other than your workstation's /lib directory. To this end, run

$ make modules_install INSTALL_MOD_PATH=<mod_install_dir>

This will place the modules into <mod_install_dir>/lib/modules/x.y.z on the host, which can then be transferred to the target machine. The target directory for the modules on the ML300 should be /lib/modules/x.y.z.


Next Previous Contents


Please send corrections, information, and comments to webpage maintainer
This page last updated on 25 Oct 04

©2004 Board of Trustees, University of Illinois.
All rights reserved.