Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Getting Started
Booting the Kernel
Booting the kernel using st40load
ST Logo
Previous   Contents   Next

To boot a kernel onto the target board through the JEI or ST Micro Connect, a utility called st40load is used. This will connect to the target, configure any registers needed to set up the memory interface and download the kernel. In addition it can download a RAM disk image and set up the kernel command line.

Before you start, you will need to obtain some information about the host Linux PC and the network setup. Assuming your PC is correctly configured you can get most of this information by running a few commands on the PC:

JEIIP (mandatory)
This is the name or IP address of the JEI, HTI or STMicroConnect which is to be used to boot the target.
TARGETIP (mandatory unless using DHCP)
This is the IP address of the ST40 target's Ethernet card. You will need to obtain this address from your local network administrator, as it must be unique within your local network.
SERVERIP (mandatory)
This is the IP address of your host Linux PC and is used to tell the Linux kernel running on the ST40 which machine it should contact for its root file system. You can find this out by running /sbin/ifconfig eth0 and look for the inet addr: field.
GWIP (optional)
This is the IP address of the gateway on your local network. It is used whenever the target needs to send a message to a machine which is not on your local network. Note that specifying this does not necessarily give you Internet access, it depends on how your local network and firewall are configured. This field is optional, but it may be needed for correct operation even within a single office. You can find if your PC has a gateway configured by running /sbin/route -n and looking for a destination of 0.0.0.0.
NETMASK (optional)
This value tells the Linux networking code how to decide whether an arbitrary network address is on the local network (and so can be contacted directly) or a remote network (in which case it should use the gateway). You can determine this value by running /sbin/ifconfig eth0 and look for the Mask: field.

Note that you must use addresses for all fields except the JEIIP, you cannot use names.

The the rest of these instructions are tailored to recent versions (0.08 or later) of st40load. Older versions have a different interface, which is described here.

st40load has full documentation available in PDF. You can also view the README which is part of the download.

Before you can use st40load for the first time, it is necessary to create a file in your home directory: .st40loadrc. This is automatically read when st40load starts executing, and is normally used to read further configuration files and define targets. A target is used by st40load to combine the details of how to connect to the target board and any configuration which needs to be done.

So for example, a simple .st40loadrc would contain:

include vmlinuxprocs.cfg
target fred bkends4si "-little -ip jei02" db457_HCMOS8_setup

The include statement pulls in the file vmlinuxprocs.cfg, which is provided with st40load, and which defines a number of procedures used to load the Linux kernel. The second line defines a target called fred, which is connected to the JEI called jei02 (an IP address could also be used here). Finally db457_HCMOS8_setup is the name of a command language procedure which will be called after connecting to the target, which configures memory interface registers for that board. A number of these are provided with st40load for ST boards.

See the st40load documentation(PDF) for more details on the features available and the command language syntax.

All necessary kernel configuration can be performed by passing command line options to st40load. All options which are recognised by st40load itself must appear first on the command line, all remaining options are passed through to the kernel as its command line. If there is any risk of conflict, the option -- can be used to separate st40load options from kernel options.

As the number of options which have to be passed can be quite large, we recommend that you write a small shell script, similar to the one below:

#!/bin/sh

JEI=fred                # Name of the JEI, HTI or MicroConnect
TARGETIP=10.0.0.56      # IP address to be given to the target
SERVERIP=10.0.0.96      # IP address of your NFS server
GWIP=10.0.0.1           # IP address of your network gateway
NETMASK=255.255.255.0   # Local network subnet mask
NAME=jim		# Initial hostname for the target
AUTOCONF=off		# Try to determine addresses automatically?

# Root of target's file system
SERVERDIR=/opt/STM/ST40Linux-1.0/devkit/sh4/target

# Kernel image
KERNEL=$SERVERDIR/boot/vmlinux-stb1overdrive

st40load \
        -t $JEI \
        -b $KERNEL \
        -p BootLinuxKernel \
        console=ttySC0 \
        root=/dev/nfs \
        nfsroot=$SERVERIP:$SERVERDIR \
        ip=$TARGETIP::$GWIP:$NETMASK:$NAME::$AUTOCONF \
        mem=32m

If you want to change the serial port speed, simply add extra parameters to the console= option, for example:

console=ttySC0,115200

The command language procedure BootLinuxKernel is called after connecting to the target and downloading the kernel image. It is used to set up the kernel parameters including the command line.

These options can also be stored in the .st40loadrc file. See the st40load README for a simple example.

Previous   Contents   Next
Valid HTML 4.01! Last updated: 2004/03/16 18:48:51
© Copyright STMicroelectronics Limited, 2005
Printer