Red Hat Docs  >  Manuals  >  EDK Manuals  > 

Contents

Previous

Next



Installing the Red Hat EDK

To install the EDK software, see System Requirements and Installation Steps. The EDK software provides a full suite of tested tools, as well as many unsupported tools (even though those tools may successfully work).

To configure your host and target for embedded development work with these tools, see Setting Up for Embedded Work, Setting Up Servers on the Host, Creating a Target Filesystem Image and Setting Up Targets.

To start working, see Embedded DevKit Basics and Developing for Embedded Systems.

For basic understanding of GNUPro Toolkit, see Sources and Tools within Embedded DevKit, PowerPC Target-Specific issues for PowerPC-specific issues, and x86 Target-Specific Issues for x 86-specific issues.

For unfamiliar terms and concepts, see Glossary.

System Requirements

To use the EDK, you must have the following system requirements.

Information about your specific hardware configuration is available in your equipment manufacturer's documentation; be sure to observe all of its safety precautions. After installing, see Setting Up for Embedded Work, Creating a Target Filesystem Image, and Setting Up Targets.

Installation Steps

Follow these steps to install the EDK software. See the README file on the CD or on ftp.redhat.com for the most current issues. The release will install in the /opt/redhat/edk-000221 directory.

  1. Log in as root to install.
    You cannot install the software onto your system unless you have root permission.
  2. Install the following RPMs from disk 1 of your Linux distribution; this step assumes that they are not already installed.
    To mount the Linux CD, type:
      mount /mnt/cdrom
      rpm -i /mnt/cdrom/RedHat/RPMS/dhcp-2.0-3.i386.rpm
      rpm -i /mnt/cdrom/RedHat/RPMS/dhcp-2.0-3.i386.rpm
      rpm -i /mnt/cdrom/RedHat/RPMS/knfsd-1.4.7-7.i386.rpm
      rpm -i /mnt/cdrom/RedHat/RPMS/tftp-0.15-1.i386.rpm

    If the RPM successfully installs, the command prompt will return with no output. For instance, if DHCP was already installed on your system, you will see a "package dhcp-2.0-3 is already installed" message.

    To unmount the CD, type:
      umount /mnt/cdrom
  3. Install the EDK RPMs in the order of the following steps.
    The EDK RPMs are located at the top level of the EDK CD; alternatively, download the RPMs from the ftp.redhat.com site.

    To mount the EDK CD, type:
      mount /mnt/cdrom
      cd /mnt/cdrom

    To download by ftp, connect to ftp.redhat.com, copy the files to /tmp (or some other temporary directory), and change to that directory.

    1. To install the basic files required by EDK, type:
        rpm -i edk-core-1.0-1.i386.rpm
    2. To install the native binaries and libraries, type:
        rpm -i edk-native-1.0-1.i386.rpm
    3. To ensure that you install the correct cross-compiler for your target board, use the following instructions.
      • For an x 86 target board, type:
            rpm -i edk-i686-elix-1.0-1.i386.rpm
      • For a PowerPC target board, type:
            rpm -i edk-powerpc-elix-1.0-1.i386.rpm
    4. To install the EDK HTML documentation, type:
        rpm -i edk-html-1.0-1.i386.rpm
    5. To install the sources for EDK (optional), type:
        rpm -i edk-source-1.0-1.i386.rpm
    6. Log out as root, and set the path to include the following directory:
        /opt/redhat/edk-000221/H-i686-pc-linux-gnulibc2.1/bin/

      This directory should be added to the path of all users who want to run the EDK tools; if necessary, get assistance from your systems administrator.

    7. To determine what you installed, type:
      rpm -q -a | grep edk
    8. To uninstall, type:
      rpm -e <programname>
      Replace <programname> with the short name of the RPM which you want to uninstall (the short name is everything before ".i386.rpm").
    9. Configure and set up the host.
      See Setting Up for Embedded Work.

    IMPORTANT!

    It is not necessary to reboot your system to proceed with the configuration process.

    To Report Installation Problems

    If you are having problems installing the EDK software, go to http://www.redhat.com/.

Setting Up for Embedded Work

IMPORTANT!

Before you begin the configuration procedure, complete Your network information in Network Information. You might want to print a copy of Network Information for your convenience during the following procedures.

Do not set up your target hardware before the instructions suggest.

If you don't already know the values in Network Information, ask your system administrator for help or see Determining the Network Configuration.

For your embedded target's Ethernet address, see Find an x86 Ethernet Address; for PowerPC target board, look for a sticker on the target board or see Find a PowerPC Ethernet address.

You should already be familiar with the basic concepts of networking, such as working with Ethernet, TCP/IP, filesystems and logging in to the host system as root user.

Network information

Network information requirements

Your network information

host-IP-address

  

domain-name

  

domain-name-servers

  

broadcast-address

  

router-IP-address 1

  

subnet2

  

netmask

  

target-ethernet-address 3

  

target-IP-address

  

target-hostname

  

Be sure that Network information is complete before proceeding.

Setting Up Servers on the Host

To do embedded development, your host machine must have services running on it so that the embedded target system can download software.

Set up the TFTP (Trivial File Transfer Protocol) and DHCP (Dynamic Host Configuration Protocol) services to allow network booting of a target. The DHCP services from the host system will provide the target with an IP address and the file name of a specific boot image to download from the host. The target will use the TFTP services, a simplified version of FTP (File Transfer Protocol), to download the boot image. In order to run, a root filesystem must be available to the target, using the NFS (networked filesystem) or RAM Disk6 method; the NFS method is more convenient than the RAM Disk method while you are developing. Once the root filesystem has been mounted, you can then execute the software on the target board.

IMPORTANT!

You must complete Your network information in Network information; replace text in <angle brackets> with your values from Network information.

  1. Enable the TFTP service.

    Create the directory and a sub-directory like the following command shows for the TFTP server; replace <target-IP-address> with value in Network Information.
      mkdir -p /tftpboot/<target-IP-address>
      chmod -R o+x /tftpboot

    Edit the /etc/inetd.conf file to uncomment the line that corresponds to the TFTP server; the following example's last line is how the line should appear.

      # Tftp service is provided primarily for booting. Most sites
      # run this only on machines acting as "boot servers." Do not
      # uncomment this unless you *need* it.
      #
      tftp dgram udp wait root /usr/sbin/tcpd in.tftpd Restart the inetd service5 that manages TFTP services:

      /etc/rc.d/init.d/inet restart
    
    

    You should then see the following output.

      Stopping INET services: [OK]
      Starting INET services: [OK]

    You may instead see the following output.

      Stopping INET services: [FAILED]
      Starting INET services: [OK]

    This means that inet was not running, that you just started it; this is good. Be sure to configure your system to start the inet service starts at boot time; see your system administrator or the Red Hat Linux documentation.

  1. Test the TFTP service.

    Change to the /tftpboot/<target-IP-address> directory which you created in Log in as root to install and run the following commands.

      cd /tftpboot/<target-IP-address>
      echo HELLO > zImage
      chmod o+r zImage

    This creates a file called zImage and sets readable permissions by other so that the TFTP server can access it.

    Use the following commands to test the TFTP server by attempting to download the zImage boot file with the TFTP client.

      cd /tmp
      tftp <host-IP-address>

    Use the following command at the tftp> prompt:

      tftp> get /tftpboot/<target-IP-address>/zImage
      Received 6 bytes in 0.0 seconds

    If you see the previous output, your TFTP server is working properly; type quit to exit the TFTP client.

    If you get a "Transfer timed out" message, the TFTP server is not running.

    If you get a "access violation" message, your file or directory permissions are not correctly set.

  2. Enable the DHCP service.

    The DHCP server assigns an IP address and provides a boot file name to a target. Type:

      mkdir -p /var/state/dhcp
      touch /var/state/dhcp/dhcpd.leases

    If you already have a /etc/dhcpd.conf file, get your system administrator to help merge the new target settings into your existing configuration. Otherwise, type:

      cp /opt/redhat/edk-000221/examples/example_dhcpd.conf /etc/dhcpd.conf

    Open the /etc/dhcpd.conf file in an editor, and add your network settings; for instance, Red Hat employees would replace the following line:

      option domain-name "<domain-name>";

    with:
      option domain-name "redhat.com";

    IMPORTANT!

    Go to Network information and substitute all your actual values from Network information into the dhcpd.conf file before continuing.

    Once you set up the dhcpd.conf file, activate the dhcpd server. Type:

      /etc/rc.d/init.d/dhcpd start

    If the DHCP service starts successfully, the following output displays:

      Starting dhcpd:                    [ OK ]

    The server now waits for a target to request an IP address during its boot process.

  3. Enable NFS to export a root filesystem6 for the target board.

    Be very careful to export only the parts of the host filesystem that you intend, since it could create a security risk. If you have questions about NFS security issues, see your system administator.

    Edit the /etc/exports file, adding a line like the following example shows and substituting your value for <target-IP-address> from Network information.

      /tftpboot/<target-IP-address> <target-IP-address>(rw,no_root_squash)

    Once you set up the /etc/exports file, activate the NFS server. Type:

      /etc/rc.d/init.d/nfs restart

    If the NFS service starts successfully, the following output displays:
    done.rting NFS services: rpc.mountd  [ OK ]

    To verify that the NFS server is exporting the filesystem, run the exportfs command and the following displays.

      /tftpboot/<target-IP-address>
      <target-IP-address>

Now your host operating system is ready for setting up an embedded target.

Setting Up Targets

The following documentation discusses special issues for configuring the x86 and MBX target boards for embedded development.

IMPORTANT!

For further information on Linux hardware compatibility, see Red Hat's website: http://www.redhat.com/hardware.

Setting Up the x86 Target

For the x 86 target, after reviewing System Requirements, use the following steps to ensure that you have a working connection over the network.

  1. Connect the power supply to the target.
  2. Connect the floppy drive to the target board.
  3. Connect the hub to the network.
  4. Connect the host and the target to the hub using the Ethernet cables.

Testing TFTP and DHCP services for the x86 target

  1. Create a boot ROM for the x 86 target to test the TFTP and DHCP services.

    IMPORTANT!

    The Ethernet address may need to be hard-coded into the boot ROM that the x 86 target uses. If you change network cards or if you change the slot for the card, you must remake a boot ROM. For documentation, see:
      /opt/redhat/edk-000221/src-redist/etherboot-4.5.6.tar.gz

    Extract the files into the /tmp directory:
      tar -xzvf /opt/redhat/edk-000221/src-redist/etherboot-4.5.6.tar.gz

    See the README file in the etherboot-4.2/netboot-0.8.1/ directory.

    To recompile the boot ROM, provide the hardware address of the slot in which the network card installs, the IRQ (interrupt request number) for the board and the Ethernet card address.

  2. Take the floppy disk from the host's floppy drive and insert it into the target floppy drive.
  3. Activate the power to the target board.
  4. A successful boot would add entries to your /var/log/messages system log; see System log after a successful boot. You will have to be root in order to read the log.

System log after a successful boot

dhcpd: BOOTREQUEST from 08:00:3e:2d:35:af via eth0

dhcpd: BOOTREPLY for 205.180.4.5 to <target-hostname> (08:00:3e:2d:35:af) via eth0

tftpd[7121]: tftpd: trying to get file: /tftpboot/205.180.4.5/zImage

If you do not see such output, see Troubleshooting boot problems with an x86 target.

Troubleshooting boot problems with an x86 target

The following discussion details some solutions to problems with your configuration.

  1. Go to a non-root shell and type minicom to start the terminal program.

    Typing minicom should display the "Initializing Modem" message; if Minicom is able to access /dev/modem, you will see the following output.

      Welcome to minicom 1.82
      ...
      Press CTRL-A Z for help on special keys

    IMPORTANT!

    To terminate a Minicom session, press C-A, X. Don't terminate now.

  2. Power up the board.

    The LED indicators will illuminate when the power supply is on (see MBX board for the location on the board); if not, check all your connections to your power supply. Version and setting information will display in the Minicom window, you will get the EPPC-Bug> prompt. If you do not see the EPPC-Bug> prompt, the null modem cable connection or Minicom is not working. Ensure that your Minicom configuration is correctly set.

  3. Test that there is a network connection between the target and the host.

    In the Minicom window, issue the NPING command at the EPPC-Bug> prompt:

      NPING <CLUN> <DLUN> <Source IP> <Destination IP> <NUM-PACKETS>

    The MBX target uses a CLUN  (Controller Logical Unit Number) of 20 and a DLUN  (Device Logical Unit Number) of 0 as the device identifier for the network adapter. The following command is an example of what to use; use your values from Network information for the <target-IP-address> and <host-IP-address>.

      nping 20 0 <target-IP-address> <host-IP-address>
    If <target-IP-address> is 205.180.4.5 and <host-IP-address> is 205.180.4.8, you would see output like the following example.

    NPING output

    EPPC-Bug> NPING 20 0 205.180.4.5 205.180.4.8

    Source IP Address    = 205.180.4.5

    Destination IP Address = 205.180.4.8

    Number of Packets Transmitted =5, Packets Lost =0, ...

    Wait for a few moments and press C-A, F to stop NPING. The number of packets transmitted depends on how long NPING runs. If the network connection fails and you get an "Error Status: 0014" message, check your connections, your IP address, or see your system administrator.

Testing TFTP and DHCP services for the PowerPC target

Test the TFTP and DHCP services by using the following procedure for the PowerPC target board.

  1. Configure your MBX target to contact the DHCP server every time it boots.

    By default, an MBX target will save and re-use the DHCP information which it got the very first time that it booted. Use the NIOT command at the EPPC-Bug> prompt. You will see output like the following example.

      EPPC-BUG> NIOT
    
      Controller LUN =00?
    
    

    Type 20 and press Enter.

    Press Enter 14 times to accept the default value for the entries. You will then see the following prompt.

      BOOTP/RARP Request Control: Always/When-Needed (A/W)=W?
    
    

    Press A and press Enter. You will then see the following prompt.

      BOOTP/RARP Reply Update Control: Yes/No (Y/N)      Y?
    
    

    Press N and press Enter. You will then see the following prompt.

      Update Non-Volatile Memory (Y/N) =Y?
    
    

    Press Y and press Enter.

    The last action saves the changes that you just made to NVRAM.

  2. Initiate a fake target boot.
    Use the PLH command at the EPPC-Bug> prompt to download a boot image from the host and to test the TFTP and DHCP servers. The PL command is similar except that it will automatically boot the image once the image loads over the network. If <target-IP-address> is 205.180.4.5 and if <host-IP-address> is 205.180.4.8, and if the <target-ethernet-address> is 08:00:3e:2d:35:af, then you would see something similar to Downloading an image from the host system.

    Downloading an image from the host system

    EPPC-Bug> PLH 20 0

    Network Booting from: MPC860, Controller 20, Device 0

    Loading: Operating System

     

    Client IP Address    = 205.180.4.5

    Server IP Address    = 205.180.4.8

    Gateway IP Address   = 0.0.0.0

    Subnet IP Address Mask = 255.255.255.0

    Boot File Name      = /tftpboot/205.180.4.5/zImage

    Argument File Name   =

     

    Bytes Received =&6, Bytes Loaded =&6

    Bytes/Second  =&6, Elapsed Time =1 Second(s)

    Note that the contents of the zImage file were transferred (6 bytes, the five HELLO characters and the EOL character).

    A successful boot would add entries to your /var/log/messages system log; see System log after a successful boot. You will have to be root in order to read the log.

    System log after a successful boot

    dhcpd: BOOTREQUEST from 08:00:3e:2d:35:af via eth0

    dhcpd: BOOTREPLY for 205.180.4.5 to < target > (08:00:3e:2d:35:af) via eth0

    tftpd[7121]: tftpd: trying to get file: /tftpboot/205.180.4.5/zImage

    If you do not see output such as the previous samples show, see Troubleshooting boot problems with a PowerPC target. To exit Minicom, press C-A, X.

    See the Motorola documentation, EPPCBug Firmware Package User's Manual, for more information on EPPCBug firmware commands.

Troubleshooting boot problems with a PowerPC target

The following discussion details some solutions to problems with your MBX target board's configuration.

Now, see Creating the rhedk group.

Creating the rhedk Group

Create the rhedk group and add users to that group. Users in the rhedk group can then put kernels in the /tftpboot directory.

  1. Log in as root.
  2. Add the rhedk group to the system.
      groupadd rhedk
  3. Get the lists of groups to which a given user belongs.
      groups <username>
      <username> : <group1> <group2> ...
  4. To set a user's group list, use the group names to the right of the colon.
      /usr/sbin/usermod -G <group1>,<group2>,...,rhedk <username>
  5. Verify that the user was added to the rhedk group, making sure that the rhedk group is listed in the output of the following command.
      groups <username>
      <username> : <group1> <group2> ... rhedk

    To add users to the existing rhedk group, use Step 3 through Step 5.

    You are now ready to set up a target filesystem image.

Creating a Target Filesystem Image

Create the basic filesystem that your embedded application will use.

  1. Run the mktargetfs script to make the special files for the target filesystem.
    Run:
      cd /tftpboot/< target-IP-address>/
      /opt/redhat/edk-000221/H-i686-pc-linux-gnulibc2.1/bin/mktargetfs.sh

    The mktargetfs.sh command will create all the default directories that the target uses (/dev, /proc, /bin, and /etc) along with all the files necessary to run the Linux kernel.

  2. Copy the data file for the httpd-demo.
    Run:

      cp /opt/redhat/edk-000221/examples/httpd-demo/data     \
      /tftpboot/<
    target-IP-address >/
  1. Set group permissions for the contents of the /tftpboot directory.
    Run:

      chgrp -R rhedk /tftpboot
      chmod -R g+w /tftpboot
  1. Log out as root, and log in as the user that you added to the rhedk group in the previous procedures.

IMPORTANT!

If you used the su command to become root, fully log out and then log back in as normal user, so the rhedk group change will take effect.

IMPORTANT!

If you are logged in to X Windows as a normal user, you may need to log out of your X session and then log back into X to get the new group permissions to work.

You are now ready to configure and build the kernel.

Configuring and Building the Kernel

IMPORTANT!

/opt/redhat/edk-000221/H-i686-pc-linux-gnulibc2.1/bin/ must be on your path. You must now be running as a non-root user.

  1. Make a directory for building the Linux kernel.
      mkdir ~/kernels
      cd ~/kernels

    • For the x86 embedded kernel, type:
      tar -xzf /opt/redhat/edk-000221/src-redist/linux-2.2.14-5.tar.gz

      Type:
      cd linux-2.2.14-5

    • For the PowerPC embedded kernel for the MBX motherboard, type8:
        tar -xzf /opt/redhat/edk-000221/src-redist/mpc8xx-2.2.13.tar.gz

      Type:
      cd mpc8xx-2.2.13

  2. Use one of the following two kernel configuration programs before you compile the kernel.
  3. Save the work for the kernel. The kernel configuration supplied with the EDK is already set for use with an embedded target. See the kernel README for further information on customization.

  4. Use the following make commands to build the kernel.
      make dep
      make zImage
      make modules

IMPORTANT!

Do not install the kernel with the make install or the make modules_install rules; the EDK will handle the copying of the kernel to the /tftpboot directory.

Now, see Embedded DevKit Basics.


1. Your router's IP address, also known as the default route. Return to text.

2. If host-IP-address is 205.180.4.8, the subnet would be 205.180.4.0, for instance. Return to text.

3. Enter the Ethernet address in ##:##:##:##:##:## format.Return to text.

4. If using RAM Disk as the target filesystem, see the description with Setting Up a Target Configuration; see also the User's Guide from the Source-Navigator's Help menu for information on configuring from the IDE; also, for information on using RAM Disk, see the Red Hat Linux documentation. Return to text.

5. Get more information by running the 'man tftpd' command for the man page documentation. Return to text.

6. If using RAM Disk as the target filesystem, see the description with Setting Up a Target Configuration; see also the User's Guide from the Source-Navigator's Help menu for information on configuring from the IDE; also, for information on using RAM Disk, see the Red Hat Linux documentation. Return to text.

7. To communicate with the PowerPC target board through the serial port, our recommendation is for using Minicom, the UNIX telecommunications program, to verify a connection. Minicom is part of the general Linux distribution. Return to text.

8. The EDK provides specially modified kernel sources for the MBX target board. When you distribute an application that uses this kernel, you must ship the kernel sources (from src-redist directory). Return to text.


Contents

Previous

Next