Difference between revisions of "Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine"

From IGEP - ISEE Wiki

Jump to: navigation, search
(Example 1: Hello world (built with cross toolchain))
(Example 2: Hello world (built with autotool+cross toolchain))
Line 127: Line 127:
 
$ tar xzvf hello-2.4.tar.gz
 
$ tar xzvf hello-2.4.tar.gz
 
$ cd hello-2.4
 
$ cd hello-2.4
 +
$ source /usr/local/poky/eabi-glibc/environment-setup-arm-none-linux-gnueabi
 
$ ./configure --target=arm-none-linux-gnueabi --host=arm-none-linux-gnueabi
 
$ ./configure --target=arm-none-linux-gnueabi --host=arm-none-linux-gnueabi
 
$ make
 
$ make

Revision as of 14:13, 22 December 2010

Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine HOWTO

Overview of this HOWTO

This How-To is meant to be a starting point for people who use the Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine and wants to learn how to add some enhancements to the VM.

Requirements

Feedback and Contributing

At any point, if you see a mistake you can contribute to this How-To.

Which IGEP SDK Virtual Machine do I have ?

At this moment (2010-December), your IGEP SDK Virtual Machine could be:

  • 20101124 version ( based on: Ubuntu 8.04.4 + Poky 20101124 version + IGEP0020-RC board )
  • 20091222 version ( based on: Ubuntu 8.04.1 + Poky 20090721 version + IGEP0020-RB board )

Which Poky SDK toolchain do I have ?

You could see "Poky SDK toolchain" version at '/usr/local/poky/eabi-glibc/version-arm-none-linux-gnueab' file:

jdoe@ubuntu:~$ cat /usr/local/poky/eabi-glibc/version-arm-none-linux-gnueabi
Distro: poky
Distro Version: 3.2.1
Metadata Revision: 949b440e52d637ef52eadb50c87e615eebd64ed4
Timestamp: 20100331130432

Which Poky SDK toolchain do I have ?

You could see "Poky nfs exported rootfs demo" version at '/srv/nfs/poky/poky-image-sato/igep0020/etc/version' file:

jdoe@ubuntu:~$ cat /srv/nfs/poky/poky-image-sato/igep0020/etc/version 
201011231602



Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine (version 20101124)

Overview (version 20101124)

  • This is the lastest available IGEP SDK Virtual Machine (2010-December)
  • IGEPv2 boards could boot from TFTP+NFS exported installed demos
  • It provides installed demos at "/srv/" directory
    • TFTP exported Linux kernels at "/srv/tftp/poky/poky-image-XXXXX/igep0020/uImage" files
    • NFS exported rootfs at "/srv/nfs/poky/poky-image-XXXXX/igep0020/" directories
  • It provides a compiled toolchain demo at "/usr/local/poky/eabi-glibc" directory
  • There is a project source code example at "/home/jdoe/staging/x-loader/" directory, that is git cloned from http://git.igep.es public source code repositories
  • It is based on Ubuntu 8.04.4 distribution
  • It provides quick links to ISEE IGEP boards ecosystem

Virtual Machine Enhancements (version 20101124)

Software updates

  • (Not available)


Upgrade the Poky's SDK

  • (Not available)


Examples

Example 1: Hello world (built with cross toolchain)

  • Create source code text file

First of all you need to initialize a suitable environment in a bash console inside your virtual machine. You can do this sourcing once the environment-setup script.

$ source  source /usr/local/poky/eabi-glibc/environment-setup-arm-none-linux-gnueabi

Create a single .c file (hello-world.c), using your preferred editor (vi, nano, gedit, ...)

hello-world.c:

#include <stdio.h> 
int main (int argc, char **argv)
{
  printf("Hello world !\n");
  return 0;
}
  • Build arm binary executable

Cross toolchain tools are available into the built-in virtual machine Poky SDK. You only need open bash terminal prompt and write commands:

$ arm-none-linux-gnuabi-gcc -o hello-world hello-world.c
$ file hello-world
hello-world: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
  • Transfer arm executable file from virtual machine to IGEPv2 board

Copy the binary result to your NFS-mounted root filesystem on your local virtual machine path

$ sudo cp hello-world /srv/nfs/poky/poky-image-sato/igep0020a/home/root
[sudo] password for jdoe: letmein
  • Execute arm executable file inside IGEPv2 board

And run the program in your target device (serial console or ssh network terminal)

# cd /home/root
# ./hello-world
Hello World !

Example 2: Hello world (built with autotool+cross toolchain)

Using the SDK with autotool enabled packages is straightforward; just pass the appropriate host option to configure

$ ./configure --target=arm-none-linux-gnueabi --host=arm-none-linux-gnueabi

Now, it shows how you can download the GNU Hello program and build for your device

See log example:

$ wget http://ftp.gnu.org/gnu/hello/hello-2.4.tar.gz
$ tar xzvf hello-2.4.tar.gz
$ cd hello-2.4
$ source /usr/local/poky/eabi-glibc/environment-setup-arm-none-linux-gnueabi
$ ./configure --target=arm-none-linux-gnueabi --host=arm-none-linux-gnueabi
$ make
$ file src/hello
src/hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.
$ scp src/hello root@192.168.254.254:/home/root

Demos (version 20101124)

Rootfs demos using an NFS-TFTP environment for IGEP v2

IGEP SDK Virtual Machine comes with 2 installed demos:

  • poky-image-sato (271M)
  • poky-image-minimal (137M)


TFTP Linux kernel:

  • TFTP exported Linux kernels at "/srv/tftp/poky/poky-image-XXXXX/igep0020/uImage" files
jdoe@ubuntu:~$ cat /etc/inetd.conf 
tftp		dgram	udp	wait	nobody	/usr/sbin/tcpd	/usr/sbin/in.tftpd /srv/tftp


NFS rootfs:

  • NFS exported rootfs at "/srv/nfs/poky/poky-image-XXXXX/igep0020/" directories
jdoe@ubuntu:~$ cat /etc/exports 
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#

# Poky rootstraps
/srv/nfs/poky/poky-image-sato/igep0020		*(rw,no_root_squash,no_subtree_check,sync)
/srv/nfs/poky/poky-image-minimal/igep0020	*(rw,no_root_squash,no_subtree_check,sync)

HOWTOs

This section describes related manuals and HOWTOs.

The bootloader X-loader

This HOWTO should be readed for advanced developers who wants hacking first stage bootloader.

The bootloader U-Boot

This HOWTO should be readed for developers who wants hacking second stage bootloader and change some board features (GPIO MUX configuration, rootfs location,...)

The Linux kernel

This HOWTO should be readed for developers who wants hacking IGEP Linux kernel and built-in drivers. People who knows hardware and ajusts Linux kernel feature. Also, developers who add more feature to Linux kernel like network protocol, new filesystems, patching buggy Linux kernel,...

How to upgrade and recover the factory firmware

This HOWTO should be readed for USERS who wants change enviroment configuration and default boot sequence of IGEPv2. You need connect your workstation to IGEPv2 board with UART3 serial debug port (USB to serial converter + DB9-IDC cable to J960 IGEPv2 connector).



OTHER REFERENCES

Frequency Asked Questions (FAQ)

Useful webpage is "Frequency Asked Questions" or FAQ page. Users could find common questions about IGEPv2 board and very quick answers about IGEPv2 software and hardware issues.

FORUM

Free [Support Forum] could be found a lot of knowledge. People who has some issue, they should read forum threads. Then, if you don't find anything about your issue, you should write new post.



Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine (version 20091222)

Overview (version 20091222)

  • Older IGEP SDK Virtual Machine (2009-December)

Demos (version 20091222)

Rootfs demos using an NFS-TFTP environment for IGEP v2

The simplest way to create a new NFS-TFTP environment for IGEP v2 is to use an already working filesystem and pre-built kernel image. Pre-built images are also available.

poky-image-minimal-mtdutils - A small image, just enough to allow a device to boot

Download and install the root filesystem image (poky-image-minimal-mtdutils-igep0020.cpio) as root on the NFS server,

$ sudo mkdir -p /srv/nfs/poky/poky-image-minimal-mtdutils/igep0020
$ cd /srv/nfs/poky/poky-image-minimal-mtdutils/igep0020
$ sudo wget http://downloads.igep.es/poky/purple-3.2/v3.2.1-0/images/poky-image-minimal-mtdutils-igep0020.rootfs.cpio
$ sudo cpio -idm < poky-image-minimal-mtdutils-igep0020.rootfs.cpio

Download and copy a pre-built kernel image to poky-image-minimal project

$ sudo wget http://downloads.igep.es/poky/purple-3.2/v3.2.1-0/kernel/uImage-2.6.28-r4-igep0020-20100331100327.bin
$ sudo mkdir -p /srv/tftp/poky/poky-image-minimal-mtdutils/igep0020
$ sudo mv uImage-2.6.28-r4-igep0020-20100331100327.bin /srv/tftp/poky/poky-image-minimal-mtdutils/igep0020/
$ sudo ln -s uImage-2.6.28-r4-igep0020-20100331100327.bin /srv/tftp/poky/poky-image-minimal-mtdutils/igep0020/uImage

Export the directory tree with an entry in /etc/exports file editing with your preferred editor, like

/srv/nfs/poky/poky-image-minimal-mtdutils/igep0020   *(rw,no_root_squash,no_subtree_check,sync)

and restart the NFS server

$ sudo /etc/init.d/nfs-kernel-server restart

Now, you can power up your board, stop at u-boot, set the project variable point to poky-image-minimal-mtdutils and boot via NFS

# setenv machine igep0020
# setenv project poky-image-minimal-mtdutils
# run nfs-boot
poky-image-sato - X11 image with Sato theme and Pimlico applications.

Download and install the root filesystem image (poky-image-sato-igep0020.cpio) as root on the NFS server,

$ sudo mkdir -p /srv/nfs/poky/poky-image-sato/igep0020
$ cd /srv/nfs/poky/poky-image-sato/igep0020
$ sudo wget http://downloads.igep.es/poky/purple-3.2/v3.2.1-0/images/poky-image-sato-igep0020.rootfs.cpio
$ sudo cpio -idm < poky-image-sato-igep0020.rootfs.cpio

Download and copy a pre-built kernel image to poky-image-minimal project

$ sudo wget http://downloads.igep.es/poky/purple-3.2/v3.2.1-0/kernel/uImage-2.6.28-r4-igep0020-20100331100327.bin
$ sudo mkdir -p /srv/tftp/poky/poky-image-sato/igep0020
$ sudo mv uImage-2.6.28-r4-igep0020-20100331100327.bin /srv/tftp/poky/poky-image-sato/igep0020/
$ sudo ln -s uImage-2.6.28-r4-igep0020-20100331100327.bin /srv/tftp/poky/poky-image-sato/igep0020/uImage

Export the directory tree with an entry in /etc/exports file editing with your preferred editor, like

/srv/nfs/poky/poky-image-sato/igep0020   *(rw,no_root_squash,no_subtree_check,sync)

and restart the NFS server

$ sudo /etc/init.d/nfs-kernel-server restart

Now, you can power up your board, stop at u-boot, set the project variable point to poky-image-sato and boot via NFS


Virtual Machine Enhancements (version 20091222)

Software updates

Upgrade the Poky's SDK (from 20090721 version to 20100331 version)

Backup current SDK (If you don't know Poky SDK version, you could see 'Which Poky SDK toolchain do I have ?' )

$ mv /usr/local/poky/eabi-glibc /usr/local/poky/eabi-glibc.20090721

and replace with the new SDK

$ mkdir tmpdir
$ cd tmpdir
$ wget http://downloads.igep.es/poky/purple-3.2/v3.2.1-0/sdk/poky-eabi-glibc-i586-arm-toolchain-sdk-3.2.1.tar.bz2
$ tar jxf poky-eabi-glibc-i586-arm-toolchain-sdk-3.2.1.tar.bz2
$ mv usr/local/poky/eabi-glibc /usr/local/poky/

Note that with the change in the poky SDK all the lines

$ source /usr/local/poky/eabi-glibc/arm/environment-setup

should become

$ source /usr/local/poky/eabi-glibc/environment-setup-arm-none-linux-gnueabi