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