Thursday, June 18, 2009

A report for 2009 Java Certification Day

The event mainly introduce the updates of the Java technology. There are some interesting stuffs I would like to share with you ^_^

JavaFX:
The JavaFX technologies is great & it is a real cross platform environment. Developers can focus on the applications and no need to concern on the porting issues. JavaFX applications developed on PC could be moved to Mobile phone, MID or even TV very easily. More information could be found in http://www.javafx.com/

http://kenai.com/
It is a service where you can host your open source projects and code, as well as find and collaborate with developers of like mind. The presenter just demostrat a few steps to clone & creatre a facebook application & it is real interesting. As you don't need to understand PHP or some other coding language — such as Ruby on Rails, JavaScript, or Python — especially one that has a client library for our API.

http://www.java.com/en/store/index.jsp
In future, Java developers can sell the applications just similar to the iPhone developer. ^_^ It is another platform to support freelance developer.

http://zembly.com/
It is a super great service. It inspire the developer to collaborate with other developers of like mind. It is an excellent collaboration of the software development flow. NetBean 6.7 IDE will support this service. ^_^

LeJOS:
LeJOS (Lego Java OS) is an open source project. It allow you to program LEGO MINDSTORMS NXT in Java. For information could be found in http://lejos.sourceforge.net/index.php

What next?
SUN & Oracle is going to be merge & some new big things are coming. Let see what happen ^_^

Tuesday, June 2, 2009

First trial to compile Android (Part 2)

1) To install the cross compiler for your target device.
e.g. arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

It can be downloaded from codesourcery.com

2) Download the Linux kernel linux-2.6.25-android-1.0_r1.tar
$ tar -xf linux-2.6.25-android-1.0_r1.tar

3) Downlaod the Linux version Android SDK android-sdk-linux_x86-1.5_r2

4) To assemble the root file system.
i) To download the busybox under linux environment. http://benno.id.au/blog/2007/11/14/android-busybox
ii) To run the emulator from the SDK & acquire the root file system.
$./tools/emulator &
iii) The Android should be launched & user should go to the Settings & enable the folloing options.
Wait for debugger.
Show running processes.
Show screen updates
iv) Under the console, user should install the busybox as following.
$./adb push ./busybox /data
$./adb shell
$/data/busybox tar -czf system.tar.gz /system
$/data/busybox tar -czf data.tar.gz /data
$/data/busybox tar -czf etc.tar.gz /etc
$/data/busybox tar -czf sbin.tar.gz /sbin
$exit
$./adb pull /system.tar.gz ./
$./adb pull /data.tar.gz ./
$./adb pull /etc.tar.gz ./
$./adb pull /sbin.tar.gz ./
$./adb pull /init ./

5) To create the rootdisk
$ mkdir ram_disk
$ cd ram_disk
$ mkdir cache dev proc root sys tmp var
$tar -xf ./system.tar.gz
$tar -xf ./data.tar.gz
$tar -xf ./etc.tar.gz
$tar -xf ./sbin.tar.gz
$cp ./init ./

The root disk is ready now ^_^

7) The android kenel may not support the target board, user has to change the build configuration & add the platform depend codes accordingly.
e.g. /arch/arm/mach-s3c6410

8) Debug & cross compile the kernel & the rootdisk accordingly.

9) Good luck & have fun ^_^

Sunday, May 31, 2009

First trial to compile Android (Part 1)

1) To install the ubuntu-9.04-desktop-i386 system.

2) To install some building packages & utilities.

$ sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
$ sudo apt-get install valgrind
$ sudo apt-get install sun-java6-jdk

4) To add some system variables.

export LANG=c
export PATH=~/bin:$PATH:.
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.07
export ANDROID_JAVA_HOME=$JAVA_HOME


3) It must install the Git & Repo, please read the link in detail. http://source.android.com/download/using-repo

$ sudo apt-get install git-core gnupg
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir myAndroid
$ cd myAndroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git

4) User can download the Android codes now.
$ repo sync



5) To compile the Android.

$make

6) Checking the result in myAndroid/out.

Have fun ^_^

Friday, July 18, 2008

Ubuntu 8.04 Kernel Compilation

1) To prepare the necessary tooling, kernel-package libncurese-dev
>sudo apt-get install kernel-package libncurses5-dev

2) To download kernel source from kernel.org.
>cd /usr/src
>sudo wget http://ww.kernel.org/pub/linux/lernel/v2.6/linux-2.6.24.7.tar.bz2

3) To de-compress the kernel sources.
>sudo tar jxvf linux-2.6.24.7.tar.bz2

4) To create a soft link to the kernel source.
>sudo ln -s linux-2.6.24.7 linux

5) To copy the kernel configuration.
> cd linux
>sudo cp /boot/config-'uname -r' .config

6) To config the kernel.
>sudo make menuconfig

7) To clean up the old stuffs first.
> sudo make distclean

8) Exciting now, start to build the kernel source.
> sudo make-kpkg --initrd kernel_image kernel_headers

9) To install the kernel.
>sudo dpkg -i linux-image-2.6.24.7_2.6.24.7-10.00.Custom_i386.deb linux-headers-2.6.24.7_2.6.24.7-10.00.Custom_i386.deb

10) Aftter installation, user can check /boot/grub/menu.lst to ensure the kernel was added to the menu.

11) Reboot. ^_^

Thursday, July 17, 2008

Setup a VMImage based on Ubuntu 8.04 for ARM Linux development.

Below is my blog to setup a VMImage based on Ubuntu 8.04 for accio development.

1) Install the VMWare workstation version 6.x or above. Please use the Bridge for network setting.

2) Since I am using static IP instead of the DHCP, please change the network setting of /etc/network/interfaces accordingly.

auto lo
iface lo inet loopback

#The primary network interface
auto eth0
#iface eth0 inet dhcp

iface eth0 inet static
address "your IP"
netmask 255.255.255.0
network ""
broadcast ""
gateway ""


3) To install the ftp server.

sudo apt-get install proftpd

(PS: Please select to run proftp server from standalone.)


(reference link: http://www.ubuntugeek.com/settingup-an-ftp-server-on-ubuntu-with-proftpd.html)

4) To install the samba server.

sudo apt-get install samba (reference link: http://ubuntuforums.org/showthread.php?t=202605)

5) To install gcc.

sudo apt-get install build-essential (reference link: http://www.linuxforums.org/forum/ubuntu-help/104156-gcc-installation-ubuntu.html)

if internet can't connect, please try.

sudo apt-cdrom add
sudo apt-get update
sudo apt-get install build-essential

6) To install ncurses. (It is for kernel menuconfig.)

sudo apt-get install build-essentials
sudo apt-get install libncurses5-dev

(reference link: http://ubuntuforums.org/showthread.php?t=296224)

7) To install gcc compiler version 3.4.6 for ARM9 Linux Platform
i) Download the arm-linux-gcc-3.4.6-ssl-0.1.2.tar.bz2 to /tmp directory
ii) Unzip the arm-linux-gcc-3.4.6-ssl-0.1.2.tar.bz2
- cd /tmp
- tar jvxf /tmp/ arm-linux-gcc-3.4.6-ssl-0.1.2.tar.bz2 –C /
iii) Set the environment variable of the user.
- Edit ~/.bashrc
- Add the line
ARM_GCC_TOOLS=/usr/local/arm/3.4.6/bin
PATH=$ARM_GCC_TOOLS:$PATH

8) TO install CVS client.

sudo apt-get install cvs

(reference link: http://sanatio.blogspot.com/2005/12/cvs-server-on-ubuntu.html)

(PS: User manual for ubuntu could be found here http://ubuntuguide.org/wiki/Ubuntu:Hardy)

Monday, June 2, 2008

WinCE 5 vs WinCE 6 ^_^

This is reference to http://www.e-consystems.com/WindowsCE5vs6.asp

The major changes in 6.0 are
  • Process address space is increased from 32MB to 1 GB.
  • Number of processes has been increased to 32K from 32.
  • User mode and kernel mode device drivers are possible.
  • Device.exe, filesys.exe, GWES.exe has been moved to Kernel mode.
  • SetKMode and set process permissions not possible.
  • System call performance will improve.
And here is the details:

- It supports safe SEH for security compliance (/GS)
- Secure C Run-Time Libraries
- PREfast support for ARM, MIPS, and SH
- Increase from 32 to 32,000 processes on the device
- Instead of a single 2GB VM for all processes now 2GB per process
- Separation of user and kernel mode space
- File system can support data encryption
- Added 802.11i support for WPA2 compliance
- Windows Media DRM 10 PD and ND
- Graphic windowing and events subsystem (GWES)
- Networking (TCP/IP, IPv6)
- Expanded file system
- More device drivers
- Critical OS components moved into kernel space (critical drivers, file system, and graphical window manager into the kernel)
- New shared heap (R/W for kernel R/O for user land)
- 1GB per process space
- New operating system layout
- In-depth security review of: System calls, Handles, Exception Handling, Memory Allocation, Loader,
- Improved parameter validation for system calls
- Per-Process page and handle tables - greatly improves process isolation, Improves code robustness
- System calls run on special kernel side stacks
- Safeguards system calls from stack tampering
- Heap control structures separated from heap data
- Safe Remote Heaps for OS components
- OS servers can open heaps in user process
- R/W for servers, R/only for user
- Performance optimization and safety from tampering
- Support for secure boot loaders
- Public / private key based
- Based around file signing
- Features supported in hardware (partial list)
- On-chip, tamper-resistant boot ROM
- On-chip RAM (secure key storage)
- Cryptographic support
- JTAG can be disabled
- Fusible or one-time programmable elements
- They acknowledge if JTAG is enabled, it all "falls apart"
- There are more complex attack scenarios that require secure PCB design to mitigate
- Embedded (nested) pointers and how they can be used for attack, such as:
- Pass an embedded pointer to some kernel address space and ask the driver to read/write to the addressed buffer, thereby potentially modifying the kernel
- There is a lot of emphasis around validation to mitigate this
- The kernel will perform parameter pointer validation
- It’s down to the API to perform embedded pointer validation
- The thread permissions model has changed in drivers
- There is strong emphasis on copying the "callers buffer" and then using that copy, as opposed to using the callers buffer itself

Tuesday, May 27, 2008

開場白

For a opening speech, I think about it for quite a while. However, I still can't figure out what to say.

Anyway, I wanna to share my programming experience here with anyone whose do have interest in embedded system programming.

Good Luck.