2010-02-24
uC/OS, The Real-Time Kernel
http://download.csdn.net/down/501748/qiulin6822
A free Borland C++ 3.1
http://www.pudn.com/downloads54/sourcecode/compiler/detail187860.html
Sample code
http://www.cevx.com/bbs/viewthread.php?tid=10412&page=1
2010-02-17
Build Qt as Static Library
A static built Qt application is faster. According to the artical "Qt Performance Tuning":
"A lot of CPU and memory is used by the ELF (Executable and Linking Format) linking process. Significant savings can be achieved by using a static build of the application suite; rather than having a collection of executables which link dynamically to Qt's libraries, all the applications is built into into a single executable which is statically linked to Qt's libraries."
First of all, you need to build Qt as a static library. See the thread http://lists.trolltech.com/qt-interest/2003-05/thread00396-0.html
./configure -thread -static (makes libqt-mt.a)Then, add the necessary plugins. See the artical http://doc.trolltech.com/4.6/plugins-howto.html#static-plugins.
./configure -static (makes libqt.a)
./configure (makes libqt.so)
./configure -thread (makes lib-mt.so)
Finally, deploy your application. See the artical http://doc.trolltech.com/4.6/deployment.html.
References:
2010-02-16
Useful Tar Commands
>
tar -tvf file.tar
List the contents of a tar.gz file>tar -ztvf file.tar.gz
tar all .cc and .h files into a tar file named foo.tgz use
>tar cvzf foo.tgz *.cc *.h
extract only one (or several) files
>tar xvzf foo.tgz
extract only one (or several) files
>tar xvzf foo.tgz anagram.cc
extract bz2 tar ball
>tar -jxvf filename.tar.bz2
extract bz2
>bunzip filename.bz2
Virtualization vs. Emulation
"Emulation involves emulating the virtual machines hardware and architecture. Microsoft's VirtualPC is an example of an emulation based virtual machine. It emulates the x86 architecture, and adds a layer of indirection and translation at the guest level, which means VirtualPC can run on different chipsets, like the PowerPC, in addition to the x86 architecture. However, that layer of indirection slows down the virtual machine significantly."
"Virtualization, on the other hand, involves simply isolating the virtual machine within memory. The host instance simply passes the execution of the guest virtual machine directly to the native hardware. Without the translation layer, the performance of a virtualization virtual machine is much faster and approaches native speeds. However, since the native hardware is used, the chipset of the virtual machine must match. Usually, this means the Intel x86 architecture. VMWare is an example of this type of application for Windows."
Reference:2010-02-15
Setup sb2 enviroment for mini2440
2) Extract the tar ball and arm-2009q3 is generated
>tar -jxvf arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
3) Extract the root_qtopia root
>mkdir root_qtopia
>cd root_qtopia
>tar xvfz ../root_qtopia.tar.gz
4) Copy following directory to root_qtopia
>cp -a $HOME/arm-2008q3/arm-none-linux-gnueabi/libc/{lib,etc,usr} ${root_qtopia}5) Generate sb2 target
>cd ${root_qtopia}
>sb2-init mini2440_qtopia /disk1/packages/arm-2009q3/bin/arm-none-linux-gnueabi-gcc
>sb2-config -d mini2440_qtopia
6) Compile an example code test.c
#include <stdio.h>
int factorial(int n)
{
if (n == 0) return 1;
return n * factorial (n - 1);
}
int main () {
int i;
int n;
for (i = 0; i < 10; ++i) {
n = factorial (i);
printf ("factorial(%d) = %d\n", i, n);
}
return 0;
}
>sb2
>gcc test.c -o test
7) To execute it, you need install qemu-arm
>git clone git://git.savannah.nongnu.org/qemu.git
>cd qemu
>./configure --target-list=arm-linux-user
>make
>make install
>make && make install
Then /usr/local/bin/qemu-arm is installed.
8) Try to execute
>sb2 test
/bin/bash: ./factorial: No such file or directory
9) run sb2-show to find out a library is missing in path
>sb2-show
sb2-show: error while loading shared libraries: libsb2.so.1: cannot open shared object file: No such file or directory,
due to the bug of sb2 package in debain
Solution: download the newest version and reinstall sb2
... to be continued
Filesystem Hierarchy Standard (FHS)
A FHS standard compatible root has the following structure:
===========================================
| bin | Essential command binaries |
| boot | Static files of the boot loader |
| dev | Device files |
| etc | Host-specific system configuration |
| lib | Essential shared libraries and kernel modules |
| media | Mount point for removeable media |
| mnt | Mount point for mounting a filesystem temporarily |
| opt | Add-on application software packages |
| sbin | Essential system binaries |
| srv | Data for services provided by this system |
| tmp | Temporary files |
| usr | Secondary hierarchy |
| var | Variable data |
/usr hierarchy
===============================
| bin | Most user commands |
| include | Header files included by C programs |
| lib | Libraries |
| local | Local hierarchy (empty after main installation) |
| sbin | Non-vital system binaries |
| share | Architecture-independent data |
Reference:
http://proton.pathname.com/fhs/pub/fhs-2.3.html
Buildroot vs OpenEmbedded
"Writing of BitBake recipes is more easy and more intuitive than writing Makefiles while providing higher flexibility. This allows you to tweak specific recipes for your very special needs and to add new recipes very fast. You can build toolchains, Software Distribution Kits (SDKs), complete Distributions or just single packages. The flexibility of OpenEmbedded allows you to reuse the once written recipes for many different purposes. OpenEmbedded provides everything buildroot will be able to provide. But in contrast to buildroot OpenEmbedded will allow you to achieve what you really want to achieve. You can add new package formats, new filesystems, new output formats easily. OpenEmbedded will suit your need."