Timesys Getting Started Guide for Intel Atom Z530 with US15W

Contents

Introduction

This document will describe in detail the procedures for booting a Linux kernel image and mounting a root file system over NFS on the Intel Atom Z530 with US15W.

Prerequisites

Host Requirements

To properly boot a board using software from Timesys, your host machine must meet the following requirements:

  • Modern GNU/Linux Distribution. While you can use nearly any modern Linux distribution released in the last 24 months, Timesys recommends one of the following:
    • Ubuntu (Most recent release or LTS)
    • Fedora (Most recent release)
  • An internet connection on the Development Host.
  • Root or sudo permission on the Development Host.
  • A copy of the Linux Kernel ( bzImage) and Root File System (rootfs.tar.gz) for the Target Board downloaded from Factory. These are found in the output directory of your online build, or in the directory build_i686-timesys-linux-<libc>/images/ on the command line.
  • If you are booting your root file system over the network, you will need two network cards installed and configured in the Development Host. One to communicate normally with your LAN/WAN while installing host packages, the other to communicate solely with the target board.
  • An available serial port on your Development Host.

Target Requirements

To boot the Intel Atom Z530 with US15W, you will need the following items:

  • Intel Atom Z530 with US15W Board
  • Serial NULL Modem Cable
  • Ethernet Crossover Cable or Ethernet hub/switch and Ethernet Patch Cables

Once you have all of the necessary components, you should perform the following steps:

  1. Connect the debug port of the board to the serial port of your workstation using the null modem cable.
  2. If you are using a cross-over cable, connect the Ethernet port of the board to the second Ethernet port of your workstation.
  3. If you are using an Ethernet hub or switch, connect the board to the hub with a straight-through Ethernet cable, then connect the hub to the second Ethernet port of your workstation.
  4. Connect the power supply to your board.

Preparing the Target

Configuring Serial Communication

The Atom Z530 with US15W uses a serial debug port to communicate with the host machine.

The commands discussed in this section are meant to be performed by a privileged user account. This requires the root login or prepending each command with sudo.

Using Minicom

  1. Start minicom on your host machine in configuration mode. As root:

    # minicom -o -s -w

  2. A menu of configuration should appear. Use the Down-arrow key to scroll down and select the Serial port setup option, and press Enter.
  3. Verify that the listed serial port is the same one that is connected to the target board. If it is not, press A, and enter the correct device. This is /dev/ttyS0 on most Linux distributions.
  4. Set the Bps/Par/Bits option by pressing the letter E and using the next menu to set the appropriate values. You press the key that corresponds to the value 9600, then press Enter.
  5. Set Hardware flow control to No using the F key.
  6. Set Software flow control to No using the G key.
  7. Press Enter to return to the main configuration menu, and then press Esc to exit this menu.
  8. Reset the board, and wait for a moment. If you do not see output from the board, press Enter several times until you see the prompt. If you do not see any output from the board, and have verified that the serial terminal connection is setup correctly, contact your board vendor.

TIP: If you experience an error similar to Device /dev/ttyS0 is locked when starting minicom, it usually means that another process is using the serial port (which is usually another instance of minicom). You can find the process that is currently using the serial port by executing the following:

# fuser /dev/ttyS0
/dev/ttyS0:         28358

# ps 28358
  PID TTY      STAT  TIME COMMAND
  28923 pts/0    S+    0:00 minicom

This process can also be killed directly with fuser as root. Please use this command with caution:

# fuser -k /dev/ttyS0

Using GNU Screen

To quickly connect to a board using Gnu Screen, execute the following:

# screen /dev/ttyS0 9600

For more information about using screen, please consult the man page, or view the manual online at http://www.gnu.org/software/screen/manual/screen.html

Configuring the Network Interface with Grub

Changing the IP Address

The IP address can be set manually by using the ifconfig command, or automatically using either the dhcp or the bootp command.

grub> ifconfig -address=10.0.0.10 -server=10.0.0.1 -gateway=10.0.0.1

grub> dhcp                                                                     
Address: 10.0.0.10
Netmask: 255.255.255.0
Server: 10.0.0.1
Gateway: 110.0.0.1

Configuring the Network Interface for use with PXELINUX

In order to use PXELINUX, you must have a PXE capable network device. The default boot configuration in the firmware or BIOS should include this device.

Preparing the Host

Setting up the network

The commands discussed in this section are meant to be performed by a privileged user account. This requires the root login or prepending each command with sudo.

Identify the network adapter connecting the Host to the Target

Timesys only supports direct Ethernet connections from the development Host to the Target board. Ideally, the development Host would have two network adapters; one adapter to connect to your LAN, and one Ethernet card to connect directly to the Target board with a crossover cable or Ethernet hub. If your development Host only has one network interface it must be directly connected to the Target board.

The Ethernet adapter connected directly to the target board must be:

  • Configured with a proper static IP address and Subnet Mask.
  • Connected directly to the target board with either a crossover cable or its own Ethernet hub.

From a command prompt issue the command:

# /sbin/ifconfig

Each interface will report its IP address, Subnet Mask, and Default Gateway information:

eth0 Link encap:Ethernet HWaddr 00:19:bb:49:ff:0e      
        inet addr:192.168.3.244 Bcast:192.168.3.255 Mask:255.255.254.0
        inet6 addr: fe80::219:bbff:fe49:ff0e/64 Scope:Link      
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1      
        RX packets:57214 errors:0 dropped:0 overruns:0 frame:0      
        TX packets:47272 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000      
        RX bytes:43109083 (41.1 MB) TX bytes:6308206 (6.0 MB)
        Interrupt:16
eth1 Link encap:Ethernet HWaddr 00:10:b5:4a:c1:a9      
        inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.0.0.0      
        UP BROADCAST MULTICAST MTU:1500 Metric:1      
        RX packets:0 errors:0 dropped:0 overruns:0 frame:0      
        TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     
        collisions:0 txqueuelen:1000      
        RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)      
        Interrupt:21 Base address:0x1100
lo  Link encap:Local Loopback      
        inet addr:127.0.0.1 Mask:255.0.0.0      
        inet6 addr: ::1/128 Scope:Host      
        UP LOOPBACK RUNNING MTU:16436 Metric:1      
        RX packets:1974 errors:0 dropped:0 overruns:0 frame:0      
        TX packets:1974 errors:0 dropped:0 overruns:0 carrier:0     
        collisions:0 txqueuelen:0      
        RX bytes:226637 (221.3 KB) TX bytes:226637 (221.3 KB)

Note the IP address and Subnet Mask of the appropriate network connection. You will use this to configure the DHCP server.

Installing the server daemons on the development host

  • On Ubuntu 11.04 and newer:

    # apt-get install xinetd tftp tftpd isc-dhcp-server \
                      nfs-kernel-server portmap

  • On Ubuntu 10.11 and older:

    # apt-get install xinetd tftp tftpd dhcp3-server \
                      nfs-kernel-server portmap
    NOTE: Older versions of Ubuntu use nfs-common and nfs-user-server in place of nfs-kernel-server

  • On Fedora Core:

    # yum install xinetd tftp tftp-server dhcp nfs-utils

Important:

After installing these packages the DHCP server software may start automatically. Having the DHCP server running while you are connected to a LAN can interfere with the operation of other computers. After the DHCP service installs and starts issue these commands to stop the DHCP service and prevent it from starting automatically at boot:

  • To stop the dhcp service:

    • On Ubuntu 11.04 and newer:

      # service isc-dhcp-server stop

    • On Ubuntu 10.11 and older:

      # service dhcp3-server stop

    • On Fedora Core:

      # /etc/init.d/dhcp stop

  • To prevent the service from starting automatically:

    • On Ubuntu 11.04 and newer:

      # chmod 644 /etc/init.d/isc-dhcp-server

    • On Ubuntu 10.11 and older:

      # chmod 644 /etc/init.d/dhcp3-server

    • On Fedora Core:

      1. Click the System Menu
      2. Select Administration
      3. Select Services
      4. Select dhcpd
      5. Click the Customize button
      6. Uncheck Runlevel 2, 3, 4 and 5

Disable SELinux and Firewall on Fedora Core

On Fedora Core, SELinux and the firewall will interfere with many of the services that are needed to work with the target board. These should be disabled before continuing.

Generally Ubuntu does not have these services running by default.

  1. Disable SELinux:

    1. Click the System Menu
    2. Select Administration
    3. Select SELinux Management
    4. Change System Default Enforcing Mode to Disabled

  2. Disable Firewall:

    1. Click the System Menu
    2. Select Administration
    3. Select Services
    4. Select iptables
    5. Click the Customize button
    6. uncheck Runlevel 2, 3, 4 and 5

Setting up DHCP

  1. Edit the dhcpd configuration file:

    • On Ubuntu, edit /etc/dhcp/dhcpd.conf and include the following lines (note: on older versions of Ubuntu this file is at either /etc/dhcp3/dhcpd.conf or /etc/dhcpd.conf):

      subnet 10.0.0.0 netmask 255.0.0.0 {
       host targetboard {
        fixed-address 10.0.0.10;
        hardware ethernet 12:34:56:78:9a:bc;
        option root-path "/full/path/to/rfs";
        filename " bzImage";
       }
      }

    • On Fedora Core, edit /etc/dhcpd.conf and include the following lines:

      ddns-update-style ad-hoc;
      subnet 10.0.0.0 netmask 255.0.0.0 {
       host targetboard {
        fixed-address 10.0.0.10;
        hardware ethernet 12:34:56:78:9a:bc;
        option root-path "/full/path/to/rfs";
        next-server 10.0.0.1;
        filename " bzImage";
       }
      }

  2. Test the DHCP server on the network card that is connected to your development board. For this example assume eth1. This command will start the DHCP server in the foreground and output any status or error messages to the screen.

    • On Ubuntu up to 12.04 LTS:

      # service dhcp3-server restart

    • On Ubuntu 12.04 LTS and later:

      # service isc-dhcp-server restart

    • On Fedora Core:

      # /usr/sbin/dhcpd -d eth1

    • It is recommended to start the DHCP server in this manner each time you need to boot your Target board.

Setting up TFTP

  1. Edit the xinetd.conf file

    • On Ubuntu, edit /etc/xinetd.conf and add the following lines just above the line that reads includedir /etc/xinetd.d.

      service tftp
      {
       socket_type = dgram
       protocol = udp
       wait = yes
       user = root
       server = /usr/sbin/in.tftpd
       server_args = -s /tftpboot
       disable = no
      }

    • On Fedora Core, the tftp-server package creates a /etc/xinetd.d/tftp file. Edit this file and change the disable line from yes to no. The contents of the file are:

      service tftp
      {
       socket_type     = dgram
       protocol      = udp
       wait       = yes
       user       = root
       server       = /usr/sbin/in.tftpd
       server_args     = -s /tftpboot
       disable      = no
       per_source      = 11
       cps       = 100 2
       flags       = IPv4
      }

  2. Create the /tftpboot folder if it does not exist:

    # mkdir /tftpboot

  3. Copy the kernel image to the /tftpboot directory:

    # cp /path/to/kernel/image/bzImage \
                      /tftpboot/bzImage

    NOTE Also copy other files that are required for booting, such as a device tree blob, to /tftpboot.

  4. Restart the xinetd server with the following command:

    # /etc/init.d/xinetd restart

  5. Test the TFTP server with the following commands

    # tftp localhost
    tftp> get  bzImage
    Received 1456898 bytes in 0.4 seconds
    tftp> quit

  6. Set xinetd to start automatically on Fedora Core.

    Ubuntu users will skip this step.

    1. Click the System Menu
    2. Select Administration
    3. Select Services
    4. Select xinetd
    5. Click the Customize button
    6. Check Runlevel 2, 3, 4 and 5

Setting up NFS

  1. As root, extract rootfs.tar.gz to a directory and note the path. This path will be referred to as /full/path/to/rfs in this document.

    # mkdir /full/path/to/rfs
    # cd /full/path/to/rfs
    # sudo tar xvf rootfs.tar.gz

  2. Export this path by editing /etc/exports to include a line similar to the following:

    /full/path/to/rfs 10.0.0.10(rw,no_root_squash)

  3. Restart the NFS services

    • On Ubuntu issue the following commands in order:

      # service portmap stop
      # service nfs-kernel-server stop
      # service portmap start
      # service nfs-kernel-server start
      NOTE: Older versions of Ubuntu use nfs-common and nfs-user-server in place of nfs-kernel-server

    • On Fedora Core:

      # /etc/init.d/nfs restart

  4. Set nfsd to start automatically on Fedora Core. Ubuntu users will skip this step.

    1. Click the System Menu
    2. Select Administration
    3. Select Services
    4. Select NFS
    5. Click the Customize button
    6. Check Runlevel 2, 3, 4 and 5

Booting the Board

Using Grub

For more information on Grub, see http://www.gnu.org/software/grub/.

For more information on installing grub built by the factory, see https://linuxlink.timesys.com/docs/wiki/engineering/howto_install_grub_built_by_the_factory.

The following sections describe how to use Grub Legacy using the second stage networking images described here: http://www.gnu.org/software/grub/manual/grub.html#Diskless. This requires a custom build of grub that includes a custom NBI loader for supported hardware.

Serial Configuration Using Grub

Configure Grub to display on both the video and the serial console with the following configuration from the Grub console.

grub> serial -unit=0 -speed=9600 -word=8 -parity=no -stop=1
grub> terminal -timeout=10 serial console

Setup Grub Configuration

You must set a few configuration values in order to boot the board over TFTP with DHCP. This is can be done from the /boot/grub/menu.lst file or from the Grub console.

dhcp
root (nd)
kernel /bzImage ip=dhcp root=/dev/nfs rw noinitrd console=ttyS0,9600

Use TFTP with Grub

grub> root (nd)                                                                
 Filesystem type is tftp, using whole disk

Load The Kernel with Grub

You can use kernel command load the kernel. Note that the DHCP server needs to be set up for bootp, and tftp is necessary for both.

Example

grub>kernel /bzImage ip=dhcp root=/dev/nfs rw noinitrd console=ttyS0,9600
 [Linux-bzImage, setup=0x2a00, size=0x30a190]

Boot the Kernel with Grub

The boot command is used to boot the kernel. It loads the file that was previously uploaded using the kernel command.

Example

grub> boot

Using PXELINUX

PXELINUX requires an Ethernet device that supports PXE booting.

For more information on PXELINUX, see http://syslinux.zytor.com/wiki/index.php/PXELINUX.

Setup PXELINUX Configuration

In order for the PXELINUX loader pxelinux.0 to be provided via TFTP to the target it must be copied into the /tftpboot directory on the host. The TFTP configuration option filename value should be changed from bzImage to pxelinux.0:

  filename " pxelinux.0";

The PXELINUX loader looks for configuration files stored within a pxelinux.cfg subdirectory within /tftpboot. The PXELINUX configuration should be placed either in the default configuration file name default or in a file named using all lowercase hexadecimal characters representing the Ethernet MAC address such as 01-88-99-aa-bb-cc-dd.

The PXELINUX configuration needs to contain a label that points to the kernel and specifies the serial configuration and kernel boot arguments.

Example

prompt 1
default timesys
timeout 100
serial 0 9600

label timesys
kernel bzImage
append ip=dhcp root=/dev/nfs rw noinitrd console=ttyS0,9600

Boot the Kernel with PXELINUX

Once the PXELINUX loader and configuration are fetched via TFTP, the PXELINUX boot prompt will be displayed. Hitting enter will accept the defined default label.

Example

PXELINUX 3.63 Copyright (C) 1994-2008 H. Peter Anvin
boot:
Loading linux_kernel.................................................ready.

Using EXTLINUX

EXTLINUX is a lightweight bootloader for Linux ext2/ext3/ext4 or btrfs filesystems. For more information on EXTLINUX, see http://syslinux.zytor.com/wiki/index.php/EXTLINUX.

EXTLINUX requires a block device supported by the Linux kernel. For example, EXTLINUX can be used on a hard disk or a USB mass storage device.

Typically a bootable partition must reside on the block device. The following example assumes an MBR parition table is required (rather than a GUUID partition table) and that the block device is /dev/sdc:

  1. As root, run the fdisk utility on the drive.
    $ sudo fdisk /dev/sdc
  2. In fdisk, delete any existing partition table and create a new one using the o command.
  3. Create a new primary partition using the n command. Set it as partition 1 and accept the defaults for first and last cylinders.
  4. Set the new primary partition as bootable using the a command.
  5. This step will destroy all data on the SD Card - Write the partition table to the card using the w command.

Create an EXT3 filesystem on the parition:

  mkfs.ext3 /dev/sdc1

The partition must be mounted in order to install EXTLINUX. If the partition is mounted on /mnt, use the following command to install EXTLINUX to the partition:

  extlinux -i /mnt

The kernel, bzImage, must then be copied to the mounted filesystem on /mnt.

Setup EXTLINUX Configuration

In order for the EXTLINUX loader to load the kernel, an EXTLINUX configuration must be present in the same directory that EXTLINUX was installed into. The following is an example default extlinux.conf configuration that can be created in /mnt:

prompt 1
default timesys
timeout 100
# optional
# serial 0 9600

label timesys
kernel bzImage
append ip=dhcp root=/dev/nfs rw noinitrd console=ttyS0,9600

An master boot record is provided with syslinux, typically found in /usr/lib/syslinux/mbr.bin. This can be installed into the block device using the following command:

  cat /usr/lib/syslinux/mbr.bin > /dev/sdc

Boot the Kernel with EXTLINUX

The Atom Z530 with US15W must be set to boot from the block device.

The kernel will load and boot after the specified default timeout. Hitting enter will accept the defined default label.

Using SYSLINUX

SYSLINUX is a lightweight bootloader for MS-DOS FAT filesystems. For more information on SYSLINUX, see http://syslinux.zytor.com/wiki/index.php/SYSLINUX.

SYSLINUX requires a block device supported by the Linux kernel. For example, SYSLINUX can be used on a hard disk or a USB mass storage device.

Typically a bootable partition must reside on the block device. The following example assumes an MBR parition table is required (rather than a GUUID partition table) and that the block device is /dev/sdc:

  1. As root, run the fdisk utility on the drive.
    $ sudo fdisk /dev/sdc
  2. In fdisk, delete any existing partition table and create a new one using the o command.
  3. Create a new primary partition using the n command. Set it as partition 1 and accept the defaults for first and last cylinders.
  4. Set the new primary partition as bootable using the a command.
  5. This step will destroy all data on the SD Card - Write the partition table to the card using the w command.

Create a VFAT filesystem on the partition:

  mkfs.vfat /dev/sdc1

The partition must not be mounted in order to install SYSLINUX. The following command installs SYSLINUX to the partition:

  syslinux /dev/sdc1

The kernel, bzImage, must then be copied to the mounted filesystem on /mnt:

  mount /dev/sdc1 /mnt
  cp bzImage /mnt/

Setup SYSLINUX Configuration

In order for the SYSLINUX loader to load the kernel, an SYSLINUX configuration must be present in the root directory of the file system that SYSLINUX was install on. The following is an example default syslinux.cfg configuration that can be created in /mnt:

prompt 1
default timesys
timeout 100
# optional
# serial 0 9600

label timesys
kernel bzImage
append ip=dhcp root=/dev/nfs rw noinitrd console=ttyS0,9600

Boot the Kernel with SYSLINUX

The Atom Z530 with US15W must be set to boot from the block device.

The kernel will load and boot after the specified default timeout. Hitting enter will accept the defined default label.

Additional Information

Factory Documentation