Thursday, December 30, 2010

Linux RAID framework

Software RAID implementations
  1. Multiple Device (MD) subsystem
  2. Device Mapper (DM)
  3. Btrfs filesystem
The main jobs for RAID

(1) RAID management tasks

(2) The exclusive-or (XOR) computations

The XOR computation can be performed on CPU
The XOR computation can be performed on disk drives

For example: Write operation to a RAID 5 disk array

1. Read "old" data from the data drive.
2. Read "old" parity data from the parity drive.
3. XOR the old data from the data drive with the old parity data from the parity drive.
4. Write the new data to the data drive.
5. XOR the new data with the parity data and write the result to the parity drive.

Hardware Solution: XOR hardware engines for parity calculations
The hardware engines typically consist of a high-speed memory buffer and a XOR calculator/sequencer.

RAID Level Comparison

GPU system on Linux

Linux Framebuffer


Monday, October 25, 2010

Useful Commands

Diff 2 directories and ignoring svn directories.

diff -Naur --exclude=".svn" /home/u-boot.orig /home/u-boot-new

Replace string
find ./ -type f -exec sed -i 's/ori_string/new_string/' {} \;

RPM commands
Downgrade package, for example, make
yum --nogpgcheck --releasever=13 downgrade make

Vim commands
How to edit a column (Insert a specific word to the column, for example, // in C file)
1. [Ctrl] + [v] to go into column mode
2. Select the columns and rows where you want to enter your text
3. [Shift] + [i] to go into insert mode in column mode
4. Type in the text you want to enter.
5. Esc to apply your change (or alternately [Ctrl]+[c])
Or press [Esc] twice

How to edit a column (Replace a specific word to the column, for example, // in C file)
1. [Ctrl] + [v] to go into column mode
2. Select the columns and rows where you want to enter your text
3. [c] to go replace mode in column mode
4. Type in the text you want to enter.
5. Esc to apply your change (or alternately [Ctrl]+[c])
Or press [Esc] [Esc]

How to mount FreeBSD partition on Linux
[ ]# mount -r -t ufs -o ufstype=ufs2 /dev/sda2 /mnt

Sunday, October 17, 2010

Boot code for OneNAND flash

1st bootloader (IPL (Initial Program Loader), 1KB)
2nd bootloader (U-Boot, 128KB)

Source code: u-boot

Monday, October 4, 2010

TCP/IP Offload

TCP Offload Engine (TOE)
http://lwn.net/Articles/148697
http://en.wikipedia.org/wiki/TCP_Offload_Engine

Large Segment Offload (LSO), Large Send Offload (LSO)
TCP Segmentation offload (TSO)
LSO is a technique for increasing outbound throughput of high-bandwidth network connections by reducing CPU overhead.

A host with TSO-enabled hardware sends TCP data to the NIC without segmenting the data in software. The NIC will perform TCP segmentation.

This technology shift the data segmentation effort from CPU to network controller, so the checksum will also generated by the network controller (Hardware Checksum).

In Linux, we can disable this function by issue the following command:
[ ]# ethtool -K eth0 tso off

show all the offload information for a specified interface
[ ]# ethtool -k eth0

http://en.wikipedia.org/wiki/TCP_segmentation_offloading
http://www.linuxfoundation.org/collaborate/workgroups/networking/tso 

Generic Segmentation Offload (GSO)
GSO is a performance optimization which is a generalization of the concept of TSO.

Patch
http://www.linuxfoundation.org/collaborate/workgroups/networking/gso

Large Receive Offload (LRO)
LRO is a technique for increasing inbound throughput of high-bandwidth network connections by reducing CPU overhead.

NICs supporting LRO receive packets and reassemble them before passing the data on to the local software.


[NET]: Generic Large Receive Offload for TCP traffic
The Linux kernel mailing list
http://lwn.net/Articles/243949
http://lwn.net/Articles/243950

Generic Receive Offload (GRO)
http://lwn.net/Articles/311357

UDP Fragmentation Offload (UFO)

Sunday, October 3, 2010

Cache Coherence

How to verify the "cache coherence" problem on ARM SMP system?
In Linux:
test-cacheco

Saturday, October 2, 2010

Gateworks: Laguna Family

Gateworks
Laguna Family (CNS34xx Processors) (OpenWRT)

Gateworks is proud to announce the next generation Laguna family routerboards. The Laguna family is based upon the new Cavium ECONA CNS3xx ARM11 SoC and features Gbit Ethernet, single and dual core processors with speeds up to 600MHz, high speed DDRII memory along with a rich feature set of peripherals such as RTC with battery backup, programmable watchdog timer, general purpose I/O, voltage and temperature monitor, programmable user pushbutton and advanced power management with programmable board shut-down and wake-up. The first model scheduled for release in the second quarter of 2010 is the GW2388-4 which has the same mechanical footprint as the GW2348-4 and GW2358-4 boards. The GW2388-4 features 4 high-power Mini-PCI sockets, a dual core 600MHz processor, 128Mbytes of DDRII DRAM, 16Mbytes of Flash and industrial temperature operation.

Price: $284.00

Wednesday, September 29, 2010

The Barebox Bootloader

To be or not to be? Barebox

Thursday, September 23, 2010

nVidia: Tegra 250 Benchmark

ARM Cortex A9 Series: Benchmark

nVidia: Tegra 250 Source Code

1. nVidia
   http://nv-tegra.nvidia.com/gitweb
   git://nv-tegra.nvidia.com/linux-2.6.git

HOWTO Build from Scratch
[ ]# bash linux_for_tegra_os_pack_rel_10.8.2_RC0.run
[ ]# cd linux4tegra/
[ ]# export L4TROOT=${PWD}
[ ]# ./unpack_targetfs.sh
[ ]# ./apply_l4t.sh

[ ]# git clone git://nv-tegra.nvidia.com/linux-2.6.git
[ ]# cd linux-2.6
[ ]# git checkout -b tegra-linux tegra-10.8.3

2. Google
   http://android.git.kernel.org
   git://android.git.kernel.org/kernel/tegra.git

HOWTO Build the Linux Kernel
[ ]# git clone git://android.git.kernel.org/kernel/tegra.git android-tegra-2.6.35
[ ]# cd android-tegra-2.6.35
[ ]# git branch -a
* master
origin/HEAD
origin/android-tegra-2.6.33
origin/android-tegra-2.6.33-rc8
origin/android-tegra-2.6.34-rc2
origin/android-tegra-2.6.34-rc4
origin/android-tegra-2.6.34-rc5
origin/android-tegra-2.6.34-rc6
origin/android-tegra-2.6.34-rc7
origin/android-tegra-2.6.35
origin/for-linus
origin/for-next
origin/for-review
origin/linus/for-linux
origin/linux-tegra-2.6.34-rc1
origin/linux-tegra-2.6.34-rc2
origin/linux-tegra-2.6.35
origin/linux-tegra-2.6.35-rc2
origin/master
[ ]# git checkout -b tegra250-android origin/android-tegra-2.6.35
[ ]# git branch
master
* tegra250-android

Ref:
1. http://tegradeveloper.nvidia.com/tegra/
2.
3.
n. http://dev.gentoo.org/~armin76/arm/tegra2/install.xml

Tuesday, September 14, 2010

ARM: Versatile Express

Hardware

Software
u-boot

Linux kernel

Root File System


Performance

Wednesday, September 1, 2010

Vector Floating-Point (VFP)

Float Point Test Program (Download)

Monday, August 30, 2010

ARM Cross Compiler

Glibc Version
gmp-4.2.4
mpfr-2.3.2
binutils-2.19.1
gcc-4.3
glibc-2.8
linux-header-2.6.31.1
ncurses-5.7
gdb-6.8

Dynamically Linked Toolchain
build_toolchain.sh

Statically Linked Toolchain
build_static_toolchain.sh

ARM Native Toolchain
build_native_toolchain.sh

uClibc Version

Wednesday, August 18, 2010

Wednesday, August 11, 2010

OpenHCI


Linux Device Driver


U-boot Driver

# usb start
(Re)start USB...
USB: scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found

# usb tree
Device Tree:
1 Hub (12MBit/s, 0mA)
| OHCI Root Hub
|
+-2 Mass Storage (12MBit/s, 100mA)
JetFlash Mass Storage Device

# usb storage
Device 0: Vendor: JetFlash Rev: 8.07 Prod: TS8GJFV60
Type: Removable Hard Disk
Capacity: 7660.0 MB = 7.4 GB (15687680 x 512)

# usb info

# fatload usb 0 0x2000000 bootpImage

# go 0x2000000

Tuesday, August 10, 2010

ARM: Dual Core ARM Cortex A9 Processor

TI OMAP™ 4 Platform - OMAP4430/OMAP4440
i.MX Community

nVidia Tegra 250
Developer Zone

ST Ericsson U9500
IGLOO (Snowball)

Monday, August 9, 2010

ECO Flow

Ref: http://asicdigitaldesign.wordpress.com/2007/12/05/eco-flow/

nVidia: Tegra 250

My application for the Tegra 250 developer has been approved.



Other Device Modules:
1. PCIe mini card supports 1 x Giga LAN
2. PCIe mini card supports 2 x SATAII (RAID 0, RAID 1)

Fedora: Update/Rebuild Linux Kernel

FC14
[ ]# yum install kernel-devel-2.6.35.6-45.fc14.i686

FC12
[ ]# yum install yum-utils
[ ]# yumdownloader --source kernel
[ ]# yum install kernel-headers
[ ]# rpm -ivh kernel-2.6.32.16-150.fc12.src.rpm
[ ]# yum install asciidoc
[ ]# cd /root/rpmbuild/SPECS
[ ]# rpmbuild -bp --target=$(uname -m) kernel.spec
[ ]# cd /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.i686
[ ]# cp configs/kernel-2.6.32.16-i686.config .config

[ ]# make
[ ]# make modules_install
[ ]# make install

FC9
[ ]# yum install yum-utils
[ ]# yumdownloader --source kernel
[ ]# yum install kernel-headers
[ ]# rpm -ivh kernel-2.6.25.3-18.fc9.src.rpm
[ ]# cd /usr/src/redhat/SPECS
[ ]# rpmbuild -bp --target=i686 kernel.spec
[ ]# cd ../BUILD/kernel-2.6.25/linux-2.6.25.i686/
[ ]# cp configs/kernel-2.6.25.3-i686.config .config

[ ]# make
[ ]# make modules_install
[ ]# make install

Monday, May 3, 2010

I2C Bus

I2C

I2C Linux Device Driver

The major driver is composed of the following:
  • Adapter specific code: /drivers/i2c/busses/i2c-xxxx.c
  • Algorithm: /drivers/i2c/algos/i2c-algo-xxxx.c
  • I2C-core: /drivers/i2c/i2c-core.c
  • I2C-dev: /drivers/i2c/i2c-dev.c
  • The I2C-dev block allows the userland program to access the I2C device (ex, EEPROM, RTC) through the /dev interface.

I2C Test Tools on Linux
i2c-tools
eeprog

Reference:

Thursday, April 15, 2010

HOWTO Build ARM Cross-Compiler (crosstool-NG)

[ ]# mkdir /home/crosstool-ng
[ ]# cd /home/crosstool-ng
[ ]# wget http://ymorin.is-a-geek.org/download/crosstool-ng/crosstool-ng-1.6.1.tar.bz2
[ ]# tar jxvf crosstool-ng-1.6.1.tar.bz2
[ ]# cd crosstool-ng-1.6.1
[ ]# ./configure --prefix=/opt/crosstool-ng
[ ]# make
[ ]# make install

[ ]# mkdir -p /home/crosstool-ng/crosstool-ng-build
[ ]# cd /home/crosstool-ng/crosstool-ng-build
[ }# cp /opt/crosstool-ng/lib/ct-ng-1.6.1/samples/armeb-unknown-linux-uclibcgnueabi/* .
[ ]# mv crosstool.config .config

[ ]# export PATH=/opt/crosstool-ng/bin:$PATH

[ ]# ct-ng menuconfig
[ ]# ct-ng build.4

[INFO ] Performing some trivial sanity checks
[INFO ] Build started 20100415.195352
[INFO ] Building environment variables
[WARN ] Directory '/root/src' does not exist.
[WARN ] Will not save downloaded tarballs to local storage.
[EXTRA] Preparing working directories
[WARN ] You did not specify the build system. That's OK, I can guess...
[EXTRA] Installing user-supplied crosstool-NG configuration
[EXTRA] =================================================================
[EXTRA] Dumping internal crosstool-NG configuration
[EXTRA] Building a toolchain for:
[EXTRA] build = i386-redhat-linux
[EXTRA] host = i386-redhat-linux
[EXTRA] target = armeb-unknown-linux-uclibcgnueabi
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.06s (at 00:01)
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[EXTRA] Retrieving 'linux-2.6.31.12'
[EXTRA] Retrieving 'gmp-4.3.1'
[EXTRA] Retrieving 'mpfr-2.4.2'
[EXTRA] Retrieving 'ppl-0.10.2'
[EXTRA] Retrieving 'cloog-ppl-0.15.7'
[EXTRA] Retrieving 'mpc-0.8.1'
[EXTRA] Retrieving 'binutils-2.20'
[EXTRA] Retrieving 'gcc-4.4.2'
[EXTRA] Retrieving 'uClibc-0.9.30.2'
[EXTRA] Retrieving 'libelf-0.8.12'
[EXTRA] Retrieving 'sstrip'
[EXTRA] Retrieving 'dmalloc-5.5.2'
[EXTRA] Retrieving 'duma_2_5_15'
[EXTRA] Retrieving 'gdb-6.8'
[EXTRA] Retrieving 'ncurses-5.7'
[EXTRA] Retrieving 'ltrace_0.5.3.orig'
[EXTRA] Retrieving 'strace-4.5.19'
[INFO ] Retrieving needed toolchain components' tarballs: done in 4518.57s (at 75:20)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[EXTRA] Extracting 'linux-2.6.31.12'
[EXTRA] Patching 'linux-2.6.31.12'
[EXTRA] Extracting 'gmp-4.3.1'
[EXTRA] Patching 'gmp-4.3.1'
[EXTRA] Extracting 'mpfr-2.4.2'
[EXTRA] Patching 'mpfr-2.4.2'
[EXTRA] Extracting 'ppl-0.10.2'
[EXTRA] Patching 'ppl-0.10.2'
[EXTRA] Extracting 'cloog-ppl-0.15.7'
[EXTRA] Patching 'cloog-ppl-0.15.7'
[EXTRA] Extracting 'mpc-0.8.1'
[EXTRA] Patching 'mpc-0.8.1'
[EXTRA] Extracting 'binutils-2.20'
[EXTRA] Patching 'binutils-2.20'
[EXTRA] Extracting 'gcc-4.4.2'
[EXTRA] Patching 'gcc-4.4.2'
[EXTRA] Extracting 'uClibc-0.9.30.2'
[EXTRA] Patching 'uClibc-0.9.30.2'
[EXTRA] Extracting 'libelf-0.8.12'
[EXTRA] Patching 'libelf-0.8.12'
[EXTRA] Extracting 'dmalloc-5.5.2'
[EXTRA] Patching 'dmalloc-5.5.2'
[EXTRA] Extracting 'duma_2_5_15'
[EXTRA] Patching 'duma-2_5_15'
[EXTRA] Extracting 'gdb-6.8'
[EXTRA] Patching 'gdb-6.8'
[EXTRA] Extracting 'ncurses-5.7'
[EXTRA] Patching 'ncurses-5.7'
[EXTRA] Extracting 'ltrace-0.5.3'
[EXTRA] Patching 'ltrace-0.5.3'
[EXTRA] Extracting 'strace-4.5.19'
[EXTRA] Patching 'strace-4.5.19'
[INFO ] Extracting and patching toolchain components: done in 300.63s (at 80:20)
[INFO ] =================================================================
[INFO ] Checking C library configuration
[EXTRA] Munging uClibc configuration
[INFO ] Checking C library configuration: done in 0.13s (at 80:21)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[EXTRA] Installing kernel headers
[EXTRA] Checking installed headers
[INFO ] Installing kernel headers: done in 9.72s (at 80:30)
[INFO ] =================================================================
[INFO ] Installing GMP
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP: done in 71.62s (at 81:42)
[INFO ] =================================================================
[INFO ] Installing MPFR
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR: done in 19.64s (at 82:02)
[INFO ] =================================================================
[INFO ] Installing PPL
[EXTRA] Configuring PPL
[EXTRA] Building PPL
[EXTRA] Installing PPL
[INFO ] Installing PPL: done in 392.81s (at 88:34)
[INFO ] Installing MPC
[EXTRA] Configuring MPC
[EXTRA] Building MPC
[EXTRA] Installing MPC
[INFO ] Installing MPC: done in 7.93s (at 88:49)
[INFO ] =================================================================
[INFO ] Installing binutils
[EXTRA] Configuring binutils
[EXTRA] Building binutils
[EXTRA] Installing binutils
[INFO ] Installing binutils: done in 48.30s (at 89:37)
[INFO ] =================================================================
[INFO ] Installing C library headers
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building headers
[EXTRA] Installing headers
[INFO ] Installing C library headers: done in 14.52s (at 89:52)
[INFO ] =================================================================
[INFO ] Installing static core C compiler
[EXTRA] Configuring static core C compiler
[EXTRA] Building static core C compiler
[EXTRA] Installing static core C compiler
[INFO ] Installing static core C compiler: done in 157.37s (at 92:29)
[INFO ] =================================================================
[INFO ] Installing C library
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building C library
[EXTRA] Installing C library
[EXTRA] Building C library cross-ldd
[EXTRA] Installing C library cross-ldd
[INFO ] Installing C library: done in 56.79s (at 93:26)
[INFO ] =================================================================
[INFO ] Installing final compiler
[EXTRA] Configuring final compiler
[EXTRA] Building final compiler
[ERROR] checking the name lister (/home/crosstool-ng/crosstool-ng-1.6.1-build/targets/armeb-unknown-linux-uclibcgnueabi/build/build-cc/./gcc/nm) interface... libtool.m4: error: problem compiling FC test program
[EXTRA] Installing final compiler
[INFO ] Installing final compiler: done in 214.53s (at 97:00)
[INFO ] =================================================================
[INFO ] Installing GMP for the target
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP for the target: done in 59.09s (at 97:59)
[INFO ] Installing MPFR for the target
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR for the target: done in 21.58s (at 98:21)
[INFO ] =================================================================
[INFO ] Installing binutils for target
[EXTRA] Configuring binutils for target
[EXTRA] Building binutils' libraries (libiberty bfd) for target
[EXTRA] Installing binutils' libraries (libiberty bfd) for target
[INFO ] Installing binutils for target: done in 77.79s (at 99:39)
[INFO ] =================================================================
[INFO ] Installing libelf
[EXTRA] Configuring libelf
[EXTRA] Building libelf
[EXTRA] Installing libelf
[INFO ] Installing libelf: done in 11.39s (at 99:50)
[INFO ] =================================================================
[INFO ] Installing sstrip
[EXTRA] Building sstrip
[EXTRA] Installing sstrip
[INFO ] Installing sstrip: done in 0.17s (at 99:50)
[INFO ] =================================================================
[INFO ] Installing dmalloc
[EXTRA] Configuring dmalloc
[EXTRA] Building dmalloc
[EXTRA] Installing dmalloc
[INFO ] Installing dmalloc: done in 8.56s (at 99:59)
[INFO ] =================================================================
[INFO ] Installing D.U.M.A.
[EXTRA] Copying sources
[EXTRA] Building libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing shared library link
[EXTRA] Installing wrapper script
[INFO ] Installing D.U.M.A.: done in 1.93s (at 100:01)
[INFO ] =================================================================
[INFO ] Installing cross-gdb
[EXTRA] Configuring cross-gdb
[EXTRA] Building cross-gdb
[EXTRA] Installing cross-gdb
[INFO ] Installing cross-gdb: done in 117.00s (at 101:58)
[INFO ] =================================================================
[INFO ] Installing native gdb
[INFO ] =================================================================
[INFO ] Installing ncurses library
[INFO ] =================================================================
[INFO ] Installing native ncurses tic
[EXTRA] Configuring ncurses tic
[EXTRA] Building ncurses tic
[EXTRA] Installing ncurses tic
[INFO ] Installing native ncurses tic: done in 27.87s (at 102:26)
[EXTRA] Configuring ncurses
[EXTRA] Building ncurses
[EXTRA] Installing ncurses
[INFO ] Installing ncurses library: done in 98.99s (at 103:37)
[EXTRA] Configuring native gdb
[EXTRA] Building native gdb
[EXTRA] Installing native gdb
[EXTRA] Cleaning up ncurses
[INFO ] Installing native gdb: done in 196.27s (at 105:14)
[INFO ] =================================================================
[INFO ] Installing gdbserver
[EXTRA] Configuring gdbserver
[EXTRA] Building gdbserver
[EXTRA] Installing gdbserver
[INFO ] Installing gdbserver: done in 7.07s (at 105:21)
[INFO ] =================================================================
[INFO ] Installing ltrace
[EXTRA] Copying sources to build dir
[EXTRA] Configuring ltrace
[EXTRA] Building ltrace
[EXTRA] Installing ltrace
[INFO ] Installing ltrace: done in 5.01s (at 105:26)
[INFO ] =================================================================
[INFO ] Installing strace
[EXTRA] Configuring strace
[EXTRA] Building strace
[EXTRA] Installing strace
[INFO ] Installing strace: done in 17.78s (at 105:44)
[INFO ] =================================================================
[INFO ] Cleaning-up the toolchain's directory
[EXTRA] Installing the populate helper
[EXTRA] Creating toolchain aliases
[EXTRA] Installing toolchain wrappers
[EXTRA] Removing access to the build system tools
[EXTRA] Removing installed documentation
[INFO ] Cleaning-up the toolchain's directory: done in 0.50s (at 105:45)
[INFO ] Build completed at 20100415.213937
[INFO ] (elapsed: 105:44.38)
[INFO ] Finishing installation (may take a few seconds)...
[105:45] /

The toolchain is in directory "/root/x-tools/" by default.

PS. buildroot version (Little-Endian) (Big-Endian)

Tuesday, April 13, 2010

Microsoft Security Essentials

Microsoft Security Essentials (MSE)

MS 推出免費的防範病毒、間諜軟體及其他惡意軟體。

Wednesday, March 24, 2010

RAID on Linux

Wiki
Standard RAID levels
Linux Raid
LHN

Mailing list
Linux RAID Storage

Book
Managing RAID on Linux, 2002 O'Reilly (PDF)

Tuesday, March 23, 2010

How to build eCos 2.x applications for ARM platform

In Fedora Core 8, Fedora Core 9

Install toolchain for eCos
[ ]# /opt/gnutools/

Build eCos complete process

  1. select template
  2. adding package
  3. editing configuration
  4. build tree
  5. build library
  6. build application 

Compile ecosconfig
[ ]# cd /home/eCos/ecos-starsemi    ; ECOS_ROOT_DIR = /home/eCos/ecos-starsemi
[ ]# mkdir -p ecos-host
[ ]# cd ecos-host

[ ]# CC=gcc CXX=g++ ../ecos-2.0/configure --with-tcl=/usr/bin/tclsh --prefix=/usr/lib --host=i686-linux-gnu --with-tcl-version=8.5
[ ]# make CFLAGS="-march=i686" CXXFLAGS="-march=i686"


Compile eCos
[ ]# source ecosenv.sh    ; set some environment variables for eCos
[ ]# ecosconfig list    ; support list

[ ]# cd $ECOS_ROOT_DIR
[ ]# mkdir ecos-build
[ ]# cd ecos-build

[ ]# ecosconfig new str81xx
[ ]# ecosconfig resolve
[ ]# ecosconfig check
[ ]# ecosconfig tree
[ ]# make

Compile eCos Application - Hello World
[ ]# cd $ECOS_ROOT_DIR    ; ECOS_ROOT_DIR = /home/eCos/ecos-starsemi
[ ]# mkdir hello_kernel
[ ]# cd hello_kernel

[ ]# ecosconfig new str81xx
[ ]# ecosconfig tree    ;ecos.ecc
[ ]# make    ; install/lib/target.ld

[ ]# cd $ECOS_ROOT_DIR    ; ECOS_ROOT_DIR = /home/eCos/ecos-starsemi
[ ]# mkdir hello_application
[ ]# cd hello_application
[ ]# cp /home/eCos/ecos-starsemi/ecos-2.0/examples/hello.c .
[ ]# cp /home/eCos/ecos-starsemi/ecos-2.0/examples/build_Makefile .
[ ]# cp /home/eCos/ecos-starsemi/ecos-2.0/examples/build_Make.params .
[ ]# chmod +x build_Makefile build_Make.params
[ ]# SRCS=hello.c DST=hello ./build_Makefile ../hello_kernel
[ ]# make
[ ]# arm-elf-objcopy -O srec hello hello.srec
[ ]# arm-elf-objcopy -O binary hello hello.bin


Compile eCos Application - HTTP Server
[ ]# cd $ECOS_ROOT_DIR    ; ECOS_ROOT_DIR = /home/eCos/ecos-starsemi
[ ]# mkdir httpd_kernel
[ ]# cd httpd_kernel

[ ]# ecosconfig new str81xx net
[ ]# ecosconfig add CYGPKG_HTTPD    ; add HTTP server
[ ]# ecosconfig tree    ; ecos.ecc
[ ]# make    ; install/lib/target.ld

[ ]# cd $ECOS_ROOT_DIR    ; ECOS_ROOT_DIR = /home/eCos/ecos-starsemi
[ ]# mkdir httpd_application
[ ]# cd httpd_application
[ ]# cp /home/eCos/ecos-starsemi/ecos-2.0/packages/net/httpd/current/tests/httpd1.c httpd_apps.c
[ ]# cp /home/eCos/ecos-starsemi/ecos-2.0/examples/build_Makefile .
[ ]# cp /home/eCos/ecos-starsemi/ecos-2.0/examples/build_Make.params .
[ ]# chmod +x build_Makefile build_Make.params
[ ]# SRCS=httpd_apps.c DST=httpd_apps ./build_Makefile ../httpd_kernel
[ ]# make
[ ]# arm-elf-objcopy -O srec httpd_apps httpd_apps.srec
[ ]# arm-elf-objcopy -O binary httpd_apps httpd_apps.bin

-----------------------------------------------------------
-rwxr-xr-x 1 root root 2085682 2008-06-17 httpd_apps
-rwxr-xr-x 1 root root  742694 2008-06-17 httpd_apps.srec
-rwxr-xr-x 1 root root  258304 2008-06-17 httpd_apps.bin
-----------------------------------------------------------
The size of the image is pretty small.

Compile eCos Application - OpenSSL Server
[ ]# ecosconfig add CYGPKG_OPENSSL    ; add openssl support

Compile eCos Application - BitTorrent Server
To be continue...

Compile eCos Application - Samba Server
To be continue...

Current Status:

  • Hello World ! [Console]
  • HTTP Server [Ethernet, TCP/IP]
  • OpenSSL Server [Ethernet, TCP/IP]
  • BitTorrent Client [ToDo] 
  • Sambe Server [ToDo]

Tuesday, March 2, 2010

AMP System

AMP System Architecture for ARM11 MPCore

Separate CPUs with separate OS. For example, Linux runs on CPU0 and uCode runs on CPU1.


 


 

Saturday, February 27, 2010

Cloud Computing Reading List

1. Cloud Computing - A Practical Approach (PDF)
2. Cloud Computing - Implementation, Management and Security (PDF)
3. Cloud Security and Privacy (PDF)
4. Cloud Application Architectures (PDF)
5. Cloud Computing - Web-Based Applications (PDF)
6. ...

Friday, February 5, 2010

The Go Programming Language

The Go Programming Language
http://golang.org/

Sunday, January 10, 2010

HOWTO build NetBSD for ARM platform

HOWTO build NetBSD on Fedora Core 9

1. Downloading sources for a NetBSD stable branch

[ ]# mkdir -p /home/NetBSD/src
[ ]# cd /home/NetBSD/src
[ ]# ftp -i ftp.NetBSD.org

ftp> cd /pub/NetBSD/NetBSD-release-4-0/tar_files/src/
ftp> mget *.tar.gz
ftp> quit

2. Decompress all tarballs
Run the following bash script:
---------------------------------------------------------------
#!/bin/sh

mkdir -p /home/NetBSD/build

for file in *.tar.gz; do
echo "untar $file"
tar -xzf $file -C /home/NetBSD/build
done
---------------------------------------------------------------

3. Compile toolchain for ARM platform

[ ]# cd /home/NetBSD/build/src
[ ]# ./build.sh -m evbarm tools

patch for compile error
(1) vi /home/NetBSD/build/src/tools/compat/../../lib/libc/gen/glob.c
---------------------------------------------------------------
#ifndef ARG_MAX
#define ARG_MAX (sysconf(_SC_ARG_MAX))
#endif
---------------------------------------------------------------

4. apply patch file for XXXXXX platform

[ ]# cd /home/NetBSD/build/src
[ ]# patch -p0 < /home/NetBSD/xxxxxx.patch
[ ]# ./build.sh -m evbarm kernel=XXXXXX
[ ]# ls -al /home/NetBSD/build/src/sys/arch/evbarm/compile/obj/XXXXXX/netbsd

5. Build File System
[ ]# cd /home/NetBSD/build/src/

6. Build NetBSD (Binary)
[ ]# nbmakefs -s 10M ramdisk.img rootfs
[ ]# arm--netbsdelf-mdsetimage -sv netbsd ramdisk.img
[ ]# arm--netbsdelf-objcopy -S -O binary netbsd netbsd.bin


Resource:
[ ]# wget ftp://ftp.tw.netbsd.org/pub/NetBSD/iso/4.0/sourcecd-4.0.iso
[ ]# wget hftp://iso.tw.netbsd.org/pub/NetBSD/iso/4.0/evbarmcd-4.0.iso

Reference:
1. Porting NetBSD to a new ARM SoC
2. http://wiki.netbsd.se/How_to_create_bootable_NetBSD_image