Wednesday, August 31, 2005


burgerspace BurgerTime is the first game I play on PC at 1985. Is originally written on a coin machine then ported to PC.

BurgerSpace is clone of BurgerTime, and is open source, many classic game have clones.

BurgerSpace is base on

1. SDL (SDL, image, mixer), game library
2. flatzebra, double frame buffer library
3. OpenGL, a standard 2D 3D graphic library

I don't think I can get it compile on Solaris system because the missing OpenGL library. Since I have a working version of critical mass on OS X, may be I can get BurgerSpace work on OS X too, even though is not stated at the website.

Since today is a holiday, may be I can get it a try, while watching the DVD movie-- Jackal.

I make use of fink to download the 3 SDL libraries (SDL, image, mixer), getting it compile is so easy, but seems like quite slow on my ibook, should get a faster machine (eg. 1.2GHz) to get the compilation work done.

SDL is a great game library, portable to multiple platform eg. windows, Linux, Solaris, OS X. I am not familiar with it, will take if I have more free time, anyway I don't write games.

The fink install the libraries in /sw directory. I can't get flatzebra package from fink, so I compile from the source code, manually. I have some problem while compiling flatzebra, the compilation script is able to detect the SDL libraries, but didn't add the SDL_image, SDL_mixer libraries in the Makefile, I didn't change the compilation script but add in the missing libraries in the Makefile manually.

-lSDL_image -lSDL_mixer

I install my flatzebra in /usr directory.

There is only one problem with compiling SpaceBurger, can't find the OpenGL library. MacOS X should came with OpenGL library, after I search through the website, finally I found, still the compilation script.

I change
-framework Cocoa OpenGL
-framework Cocoa -framework OpenGL

That's easy.

BurgerSpace is a good clone instead, is almost like the old game, except for the contact distance of cooker (player) and sausage (and others) should be adjusted.

I get it working on my OS X after I have finish the movie. Wow! It take me four and half hour to finish the 2 hours DVD, because some times I pause and continue while doing the compilation. Spend all day (afternoon) compiling open source program, don't make it any different on other days.

PS. unable to upload pictures today.

Critical Mass Game

critterIs boring day and feel lazy, I found this game in apple site.

Critical Mass a.k.a. Critter


Surprisingly license under GPL, written on SDL and openGL library. I try to get it compile on Solaris 2.6, but missing openGL, which is 90M size, so I give up.

Friday, August 19, 2005

Embedded in you ARM: code density problem

ARM cpu is a very popular low power consumption cpu used by many embedded design. ARM use RISC design, and that's how the ARM name came from--Advance Risc Machine.There are some advantages of RISC design over CISC (eg. Intel cpu), but the code density (code size) on RISC cpu is much higher than a CISC cpu. This is not good for embedded system, because in embedded system, every byte is counted.

Why RISC cpu's code density is just higher? The simple answer is RISC cpu instruction set is fix size and some times it needs more instruction set to accomplish an action, compare with CISC cpu.

To solve the code density problem, ARM design the Thumb instruction sets. ARM was first design as 32 bit cpu (mean all instruction sets are 32 bits), Thumb instruction code are subset of the most commonly use ARM code and compress into 16 bit instruction code.

The 16 bit Thumb code will be decompress as original 32 bit instruction set before execution in cpu, since the decompress is done by hardware, there is almost no overhead for decompression.

Overall there is an improvement about 30% in code density on using Thumb code. Even though thumb code execute slower than normal ARM code, but sometimes in certain condition, Thumb may perform better than ARM, when you have slow memory access, because access of the shorter Thumb code is fater than the ARM code.

The other advantages of using thumb code is, you can have your embedded device design with a 16 bit bus, which will lower down the cost of the hardware.

All ARM9 and XScale included with Thumb technology, according to some website.


Below is some simple and easy undertand of the CISC and RISC design. For detail explaination of it, please refer to the web.

What is the different between CISC and RISC design?
RISC stand for Reduce Instruction Set Computing, it has less instruction set compare to CISC (Complex ...). RISC is less complicated in chip design, less transistor, smaller in size, cheaper, consume less power... RISC will have fix size instruction set which help the pipeline design possible and easier.

What is a pipeline?
Normally machine use a cpu cycle to complete execution of an instruction. Pipeline design split each instruction into (normally) 5 stages. The cpu with pipeline design doesn't need to wait until an execution of instruction to be completed before it fetch in another instruction, once a stage of instruction is completed, the cpu will fetch in the next instruction.
Effectively with pipeline design, cpu can execute 5 instruction together (insteed of 1 after another), if these instruction does not depend on each other.
Super pipeline refer to cpu which have more than 5 stage.

What is superscalar?
Superscalar cpu have more than 1 pipeline. Normally 1 for instruction and another for data.

Embedded is another battlefield

IT (Information Technology) world are very competitive, different product, including hardware and software competing each other from time to time. The most popular could be the long rival between AMD vs Intel in CPU war. In software area, Netscape/Mozilla vs Internet Explorer, Linux vs Microsoft Windows operating system, many more examples happen everyday.

In embedded world, there is still competition and war going around, but the company and products that taking part are different from the normal player that we are familiar. CPU in embedded system does not target for speed performance, but more on power consumption, majority of the embedded system (eg. mobile phone) is using a ARM cpu and not an intel cpu.

In software operating system, Windows is the most popular operating system on desktop environment, but on smart phone, Symbian OS is the big player, and Palm OS was major OS supplier on PDA. Window CE from Microsfosft is growing strong in these area, surpass Palm OS in PDA operating system, but embedded system create another battlefield for new players, just like Netscape vs Internet Explorer in network (Internet) area. Even though Netscape has lost the battle to Internet Explorer, but is work from Netscape is always remarkable.

There is a few area that I explain here, why embedded world is so different from the normal IT world in terms of concept design, implementation on hardware and software.

ARM is a very popular CPU in embedded system, for it low power consumption chip. The cpu can be as low as 1 watt power consumption, but still running at 200 Mhz frequency (I know is nothing compare to Pentium these days). ARM license its core design to other other vendor like Texas Instrument, Samsung etc, many people does not know about it, but ARM (or ARM designed) chip is install in most mobile phones. The StrongARM chips used by earlier iPAQ PDA, some of its technology came from ARM.

(StrongARM is a join effort of DEC and ARM to create a faster CPU in 1995. As a settlement of lawsuit between DEC and Intel in 1997, DEC sold off the Hudson semiconductor manufacturing plant and agree to cross-license for 10 years on their cpu design with Intel. The reason that DEC want to sold off it manufacturing plant because the plant was not fully utilise with manufacturing on DEC Alpha CPU, which Intel might be able to solve the problem with its popular cpu)

Display chipset
The current display chips install in desktop now days is not suitable to use in embedded system. The chips consume too much power, and hi-resolution (1024x768 or higher) is just a waste for embedded system. Normally the display resolution for PDA or smart phones is just 240x320 pixel or even lower.

ATI came out with Imageon product line (used by Dell's Axim PDA), which is a low power consumtion display chipset but still give 3D capablities to embedded device(eg. mobile phone) to have 3D games running smoothly on it, without sacrificed the battery life.

Portable game console
Nintendo has been in game console for many years, but now losing the market to X-Box and Sony's Play station. Nintendo's gameboy series is still going strong in portable game console (like in old time 'Game & Watch').

Sony's has new PSP (PS portable), and new comer Nokia's NGate (base on Java games, not that popular as the other 2 products) are the major and potential players on the portable game console market.

kvm, j2me java virtual machine
Java was first design target for small device, but growing into a bigger platform (above 20Mb) on today's desktop operating system. In 1999, Sun's java2, split the java platform into Enterprise (J2EE), Desktop (J2SE), Embedded (J2EE) edition.

The KVM is a J2ME virtual machine which has a small foot print (about 200K insteed of 20Mb), which fit into many embedded platform. The J2ME which still base on the java programming language, but change its design architecture to fit in small device, eg. j2me class need to be pre-verified, before it was deploy, this will simplified the java run time implementation.

Other company like IBM and HP work on j2me vitual machine eg. HP's chai, IBM's J9. I think HP has stop their development on the chai virtual machine.

Palm is not the first PDA available on the market, Apple's Newton Message Pad is selling much earlier. Palm is the first successfully product after Newton Message Pad and Pocket PC, one of the successful reason of Palm is they get the design right.

Normally PDA doesn't came with a keyboard, the using of PDA will be heavily depends on hand writting recognization software. There is some PDA now attached with a keyboard device, which I think it is a bad idea, but good for those people who does not familiar with hand writing.

Apple's Newton Message Pad is not successful for its poor hand writing software, same problem happen in Pocket PC too. Palm co-founder Jeff Howkins have something different in mind, since software is hard to recognize human hand writing, why not let user learn some special writing which can be easily undertand by the software?

That's how he design Graffiti, the way you write on Palm device. The result is impresive, you spend very little time on learning how to write in Graffiti (major key stroke is simular with normal alphabet, only minor changes in some of the alphabet), but can be recognize effectively by the device.

mpg123 vs mpg321
Many people know mpg321 is a free clone of mpg123 (take note of 123 and 321), long before mpg123 licence under GPL (an open source license). Another advantages that using mpg321 over mpg123 on embedded device is, the code implementatation of mpg321 does not use floating point calculation. Some embedded cpu like earlier version of StrongARM (SA-110) doesn't came with co-processor (floating point unit), even though you can have software simulation (eg. Linux kernel) as co-porcessor, but running mpg321 which does not use floating point unit, will consume less cpu power.

Internet browser
An internet browser like Mozilla and Internet explorer, easily occupied 20Mb of storage. A standard PDA could have design with storage much lesser than that. Netfront browser from Access software, is much smaller in size which fit into embedded device.

There is a minimo (Mini Mozilla) browser from open source world, it is still under development. The name remind me of Mini-me in the movie--Austin Powers.

QT Embedded and GPE
Qt and Gtk are 2 main stream graphic toolkit (for X windows system) on unix/Linux platform. As they improve the toolkit library from one version to the other, the library size is getting bigger and bigger, the other problem is the UI widget is not suitable for embedded environment.

Qt (Trolltech) split out an embedded version of the toolkit--Qt/E specially for embedded system. Gtk create the GPE, GPE Palmtop Environment, they re-design some widget that is suitable to be displayed in embedded environment, and re-write some application base on it eg. PIM(Personal Information Management), clock etc.

Matchbox window manager
The is no way to port Gnome and KDE into an embedded system, is just too huge, Even it is workable, that is not the right way to do it. Some people use ICE window manager or Fluxbox on embedded linux, because they are small in size. Is still not an ideal solution, those window manager are design for desktop and not embedded system like PDA environment. Many of the functionality is not necessary on embedded system, example resize of window, user could hardly display more than one window on the samll display screen.

Matthew Allum have a good understand of the problem, so he create the matchbox window manager. Nokia had eyed on the matchbox and working with Matthew closely to put matchbox in Nokia's up coming Internet Tablet product.

Matchbox is a well written piece of software, which started from scratch. It was host on and now move to openedhand.

Chinese system environment
In Dos and Windows days, ETen, NJStar, ChineseStar, TwinBridge are the most popular software which provide chinese support to Dos and Windows. Later on Palm OS, is the PalmDragon and CJKOS (from NJStar) software.

Chinese vector font
Vector font is a very common technology used in today's GUI display. The roman character true type font contain 26 alphabetic character is just a few hundred kilobyte in size, but a chinese true type font which contain more than 10 thousand of character, easily occupied 3 to 5 megabyte of storage.

Back in 1990s, there is a jetfont from New Fairland, fit in 3 chinese vector font in 1.2 megabyte storage. Since the vector font is not compatible with true type and require its own display driver, the product almost disappear from the market after windows 95, not it was used in kanjiweb software, you could hardly hear anyone refer to it. The small foot print of jetfont is just nice to fit into an embedded system.

Another font company, Arpic have a HiFont product (chinese link is here), which claim to be a small foot print (1Megabyte) font which is suitable for IA system.

There are many area in embedded which is unexplored, many of them are workable by just tweaking around the existing system and product. The above is just some examples taken from the real embedded world, hopefully it can help to think further on embedded system.

Wednesday, August 17, 2005

Nokia Internet Tablet 770

Read it the news today (again!), I have not seen it on the market yet, anyway I don't shop around. 200g is a bit heavy for a hand phone, 80g to 100g sounds more reasonable.


I am looking forward for the real product, because it should be running a Linux os (May be the later model). Many company try to make linux available on embedded device, but most of them is not really successful, I hope Nokia can change this.

There is a development platform available. Earlier I have blog on openedhand. The nokia official page is here.

Tuesday, August 16, 2005

using cloudscape

cloudscapeI just try the cloudscape 3.5 today, is easy to get it working. I downloaded it many years ago from

My cloudscape 3.5 came as a java class file, about 10MB file, the class file itself is an installer

$ java cloudscape351

The install in /usr/local/cloudscape. I install everything is about 23M.

$ export CLOUDSCAPE_INSTALL=/usr/local/cloudscape
$ export CLASSPATH=$CLOUDSCAPE_INSTALL/lib/cloudscape.jar;
$CLOUDSCAPE_INSTALL/lib/client.jar; $CLOUDSCAPE_INSTALL/lib/tools.jar;
To test the class path is install properly:

$ java
Cloudscape Information

If you don't see the above information, means the class path was not setup properly.

Using the cloudscape client, cloudview


$ java

You can use the client to create table, store data, query SQL statement etc. You can try it yourself.

Cloudscape inspiration

cloudscapeI dig out some the old program, and found out this old cloudscape program version 3.5.1. Is very old, few years back.

What is cloudscape? Cloudscape is an embedded database purely written in java. What! Purely written in java? Yes, and is open souce. I don't really believe in java application few years back, until I saw tomcat (jsp container), and then later this cloudscape.

Cloudscape originally started by Cloudscape Inc, founded in 1996 by Nat Wyatt and Howard Torf, they were 2 engineer with Sybase Inc. In 1999 Informix acquire cloudscape for about 86 million. In year 2001, big blue acquire informix with 1 billion CASH (see here)! Cloudscape has goes into IBM's product, since cloudscape is a low end database, IBM doesn't make much money out of it, it release it out to apache software foundation as Apache Derby now.

Cloudscape inspire me in many ways, I can't imagine and can not believe a database can be written in java. I am not sure is hypersonic database inspire by cloudscape too.

Cloudscape is a good tools for java base web development tools, because it is light-weight, easy to use, and work well with java, it came with jdbc connection.

Some time we need to think a bit different, out of the box, they we are more creative.

story on cloudscape startup.

Monday, August 15, 2005

remote esound

linuxEsound is the enlightened sound daemon, it has been using in Gnome window desktop, easy to use, I have tried install it on a Solaris machine and it works. Today I just try its remote audio function.

What I am going to do is to run the sound client on Solaris machine and output to window machine, and it works.

1. download the cygwin esound binary from or its mirror
- it need a few extra library to run, just download it from the website as well
- I have some problem with the cygwin1.dll working together with the esound binary. I try to download the cygwin1.dll file from different url, finally get 1 which is working.

2. start up the daemon on windows system
> esd -tcp -public -port 16001

3. use sound client at solaris
$ export ESPEAKER=<windows's ip>:16001
$ esdplay chimes.wav

Da! Da! It works!

4. since esdplay only output wav file, I try mpg123 and mpg321
$ mpg321 -o esd sample.mp3

but no luck, is not working.

5. I try on xmms, the remote esound is working!

The esd is just a few hundred k in size, so is good for remote thin client.

Sunday, August 14, 2005

pkg-get and gtk2 compiling experience on solaris

solarisI have spend some time on compiling gtk2 on solaris 2.6, to test my pkg-get system, make sure it will grep all the dependencies package which is missing from the system automatically. Gtk2 depend on many other package, glib2, atk, pango, xft2, xrender, render, fontconfig, libjpeg, libpng, libtiff... may be I still miss out some more. I spend quite some time on compiling it, until I almost lost all my energy. :) You must use xrender 0.8 and not 0.9 (from, other should work fine. After spending so much time, find it useless, because I don't have a complete set of solaris package, and my package method is a little bit different from sunfreeware or I like to package library into he runtime and development package. eg. png and png-dev, and I will put the 2 package into 1 file like png-1.2.5-sol26-sparc.pkg.bz2 There is still some bugs for my borne version of pkg-get, it can recursively get all the package and get it install, but it will depends on the way you do the solaris packaging as well. If you want the full working version of pkg-get, you should get it from

my trial on podcast

podcastFew days back (12 Aug), can't get into sleep, so I weak up early in the morning (5am) and try out the podcast. I try to make my own recording on my ibook, and found these 2 software: 1. soundflower this is an open source software, help you to direct you audio from 1 application to another. It will create another 2 channel in your system sound config, you need to reboot to get it work after installed. 2. audio recorder I can't record using the soundflower, so I get this software, it work fine, if you need to record into mp3, you need to install the LAME.framework. I didn't publish my podcast, but I register with the odeo, which have a lot of podcast available. PS. Miss Adventures in Taiwan If you go to the iTunes podcast, you will find this in International, Chinese. Quite interesting. Finally I found the blog. blogspot podcast

Wednesday, August 10, 2005

Solaris package dependency information

solarisThere is a file store the depency information of the a solaris package. I need the dependency information, so my pkg-get script will automatically resolve all dependency package, download and install them.

I google but don't find the method to extract out depend file in the solaris package, I can do like this:-

1. get header blocks
$ dd if=hello.pkg skip=1 | cpio -it
31 blocks

2. header blocks is 31 + 1
$ dd if=hello.pkg skip=32 | cpio -idv 'install/*'
$ cat install/depend

But, when there is more than 1 package in a pkg file
$ dd if=glib.pkg skip=1 | cpio -it
7 blocks

to get glib-dev depend file
$ dd if=glib.pkg skip=8 | cpio -it
1851 blocks <-- glib
(The above process will repeat, depend on which package you want to retrieve)
$ dd if=glib.pkg skip=1859 | cpio -it (1859=1851+8)
2158 blocks <-- glib-dev

This work most of the time, but might not be the correct way to do it, because it just don't work on some package.

I fix some bugs for my pkg-get, now it can download and install the dependency pacakge automatically.

PS. The haze is very bad since yesterday, real bad...

Friday, August 05, 2005

pkg-get version 0.0.1a

solarisI make some changes to the pkg-get yesterday. Now it is able to extract the dependency package from the install software and download the missing package automatically. I try to install mpg321 $ pkg-get install mpg321 The system will find out the 2 missing package (libmad and libid3tag), download and install automatically, without install manually 1 by 1. The next thing TODO is solve redundant depenency package, and recursive depenceny, but I doubt I have much time for it. I package all the 3 software (mpg321, libmad, libid3tag) on solaris. I should have show how it can be done, if I have the time to document it. I can play the 'Dae Jang Gum' korean TV series theme song on the sun ultrasparc machine(solaris 2.6). u na la u na a ju o na ka da la ka da la a ju ga na na na ni da lyeo do mok no na ni a ni li a ni li a ni no ne ... Feel so satisfied with it. Oh! Now I remember I miss out the libao dependency! Anyone want the binary of the software, just let me know, I will send you a copy, is all free and opensource.

meetup august 2005

I didn't attend the monthly meetup on August yesterday, so I ask Jason to organize the August meetup if possible. This morning I received an email from Jason to inform me that we (is redhat meetup? or myoss meetup?) have a new organiser--Aizat. I am a bit shock with surprise, because Jason didn't inform me earlier.
I know Aizat, he has been joining the meetup group for quite some time, he is friendly and with passion, we both like Mac OS X and using it as well, so we both share some interest other than open source.
I have been joining the meetup group since April 2004, on and off. May be this is a good time for me to move on, spending more time on software development, like working on my pkg-get.
I heard from Jason, the group have decided to move to Malaysia Kini building for the next meetup.

Linux library dependency problem

An article here-- Shared libraries in Linux: growing pains or fundamental problem?, explain what I want to say about dependency problem in open source software. The article date 16 May 1999 by Sergey Ayukov, is year 2005 the problem still exist in Linux world. Open source software have too many dependency on different (shared) libraries, these libraries were used by more than one application. The main problem is, not all these shared libraries are (backward or forward) compatible. Most of the time user are force to upgrade the hold system libraries for compatibility issue, or even force to upgrade (sounds familiar right!?) the distribution version. This major problem caused by many of the shared library or application link to some major libraries (eg. glibc) which is not fully compatible with new version of the software release. Many user try to install pre-compiled binaries to save their time, to re-compile some new software like Gnome is too time consuming and almost impossible for normal user. This lead to other problems, like user have to upgrade their OS version, and open source become a close source system. May be there are just too many release for Linux distribution. Just Red Hat ( and Fedora Core) have 2 release yearly, and other operating system like Windows, Solaris and Mac OS X is about 1 (major) release yearly.