How to install Lepton/Tauon on Debian based environment
-------------------------------------------------------
Requirements :
   -. X environment (on Debian basic packages + desktop environment)
   -. USER FOR INSTALL IS kvm (replace kvm by your current username)
   -. 32 bits host architecture (for 64 bits use debootstrap)
   -. Ubuntu 11.10 needs gcc-4.4
   -. user commands are prefixed by $
   -. root commands are prefixed by #

eCos setup
^^^^^^^^^^
Required packages
build-essential libpng-dev libjpeg-dev libtiff-dev tcl8.4-dev tk8.4-dev

Create install and build directories.
$ mkdir -p ~/dev/ecos-v3.0
$ cd ~/dev/ecos-v3.0
$ mkdir archives ecos-tools ecos-build

Get eCos archive from http://hg-pub.ecoscentric.com/. 
Tested with the following version from the eCos upstream: 
$ wget http://hg-pub.ecoscentric.com/ecos/archive/e1cec8d66444.tar.bz2 -P ./archives
Store it in archives and unpack it.
$ tar jxf archives/e1cec8d66444.tar.bz2
$ ln -s /home/kvm/dev/ecos-v3.0/ecos-e1cec8d66444 /home/kvm/dev/ecos-v3.0/ecos

Compile ecosconfig.
$ cd ecos-build
$ ../ecos/host/configure --prefix=/home/kvm/dev/ecos-v3.0/ecos-tools \
--with-tcl=/usr --with-tcl-version=8.4
make; make install

Check ecosconfig installation
$ cd ../ecos-tools/bin
$ ls

Change the right of ecosadmin.tcl
$ cd ~/dev/ecos-v3.0
$ chmod +x ecos/packages/ecosadmin.tcl

Get configtool.
$ cd ~/dev/ecos-v3.0/archives
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/ecos/\
anoncvs/ecos-tools-bin-110209.i386linux.tar.bz2
$ cd ..
$ tar jxf archives/ecos-tools-bin-110209.i386linux.tar.bz2
$ mv configtool ecos-tools/bin/
$ rm -rf ecosconfig ser_filter platforms.tar

Test configtool.
$ cd ecos-tools/bin
$ ./configtool &

Put the eCos repository path in dialog box
/home/kvm/dev/ecos-v3.0/ecos/packages

You can complete your PATH environment variable and add ECOS_REPOSITORY
environment variable in your .bashrc file
export PATH="$PATH:/home/kvm/dev/ecos-v3.0/ecos-tools/bin"
export ECOS_REPOSITORY="/home/kvm/dev/ecos-v3.0/ecos/packages"

Get pre-compiled toolchains for arm (arm-eabi) and i386 (i386-elf)
$ mkdir -p ~/dev/toolchains
$ cd ~/dev/toolchains
$ wget --passive-ftp ftp://ecos.sourceware.org/pub/ecos/ecos-install.tcl
$ tclsh ecos-install.tcl -t

You can complete your PATH environment variable in your .bashrc file
export PATH="$PATH:/home/kvm/dev/toolchains/gnutools/arm-eabi/bin"
export PATH="$PATH:/home/kvm/dev/toolchains/gnutools/i386-elf/bin"

eCos part is ready to use!

Lepton/Tauon setup
^^^^^^^^^^^^^^^^^^
Required packages
(subversion or mercurial) scons libexpat-dev libgtkgl2.0-dev minicom gdb

Get Lepton/Tauon sources from repository
$ mkdir -p ~/dev/tauon
$ cd ~/dev/tauon
$ hg clone https://code.google.com/p/lepton/
$ cd lepton
$ sh tauon_ln.sh (create a symlink in ~)
$ cd ~/tauon

Compile tauon_sample application for target and simulation
$ cd ~/tauon/tools/config
$ scons BUILD_MKLEPTON=True BUILD_VIRTUALCPU=True BUILD_SAMPLEAPP=True
Wait ...

Debug for simulation
^^^^^^^^^^^^^^^^^^^^
Install simulation environment
$ sh ~/tauon/tools/host/debian/scripts/build_fifo.sh

Copy minicom configuration file for simulation
# cp /home/kvm/tauon/sys/root/prj/config/minicom/minirc.tauonpt \
/etc/minicom/

Launch a debug session
$ cd ~/tauon/sys/user/tauon_sampleapp/bin/
$ gdb -x ../etc/scripts/gdb_script_synth.gdb tauon_synthetic.elf

At gdb prompt enter run (or r)

Open an other terminal
$ minicom -o tauonpt

At Lepton/Tauon prompt enjoy!!
ps
ls /usr/bin
uname -a

If you want networking, you need to adapt the script
~/tauon/tools/host/debian/scripts/start_br.sh and launch gdb and
minicom with root privilege (or sudo). We use a tun/tap and a bridge
to provide a dummy ethernet card for simulation so special privileges
are required.

Debug for target (AT91SAM9261-EK)
^^^^^^^^^^^^^^^^
You need a JTAG probe (Zy1000, J-Link, Amontec JTAG Tiny, ..) supported 
by openocd (http://openocd.sourceforge.net/).

Launch openocd with jlink_at91sam9261.cfg if openocd runs on your host
machine.

$ cd ~/tauon/sys/user/tauon_sampleapp/etc/scripts/
$ openocd -f jlink_at91sam9261.cfg

Open a new terminal and launch a debug session
$ gdb -x ../etc/scripts/gdb_script_at91sam9261_sdram_jlink.gdb \
tauon_at91sam9261.elf

Branch a serial cable on Serial Debug Port (J15)
Open a new terminal
Configure minicom with 9600 8N1 (8 bits, no parity, 1 stop bit)

Back to gdb terminal and enter continue (or c)
Back to minicom terminal and enjoy!!!
