ThinLinx Hot-e and CNS21XX

I am still fixing the Cavium Econa CNS11XX network driver with the guide from Pyun YongHyeon. He is guiding to make the network driver more robust. Unfortunately, we still don’t know why the driver is slower than the Linux version. The port is currently accessible through FreeBSD CVS at:

I asked in the freebsd-arm mailing list if anyone would like to donate me a CNS21XX device, and Stefan Bethke immediately offered me to buy one for me. I bought the device from dealextreme with the money donated to me. It took 9 days until it arrived.

Meanwhile John Nicolls from ThinkLinx sent me a Hot-e, a device based on AT91SAM9G20. I told him that I have received mr Stefan offer, but he said I can work on it anytime I want it. Since the Hot-e arrived earlier, I have managed to get it to boot. At first i was going to use the work from Sylvestre Gallon on at91sam9621(mailing list archive), but it turns out that it is not usable yet.

I have fixed the clock computation in at91_pmc.c, and currently writing a new timer driver (at91_pit.c), because the system timer device (at91_st.c) no longer exists in AT91SAM9G20. Currently the timer device is still not working properly, but I think I will be able to get it work this week.

When the CNS211XX LAN device finally arrived, I stopped the work for Hot-e for a while to test the new device. I bought a CA-42 cable to connect to it, but I can’t send anything to the device. I thought that the device was faulty, but turns out that the cable is faulty. I was disappointed because usually I used that type of cable (it is cheap only 132 baht or 4 usd). Fortunately I still have one MAX3232, and I can make my own cable.

I think porting CNS21XX will not be so difficult. I made some small adjustment for the serial port driver to make it show something. Memory mapping is different compared to CNS11XX, but that can easily be adjusted. The Interrupt controller is different, so I need to rewrite some parts. After it works, EHCI/OHCI was working fine. The network driver will need major adjustment (may be I will just write a new driver for this one), and the device doesn’t use CFI for Flash, it uses SPI, so I will need to write a driver for SPI bus.

For CNS11XX and CNS21XX You can see my progress in this wiki page:

STR9104/CNS1104 FreeBSD Port Progress

Returning from Indonesia, I continued my Freebsd porting attempt to the Emprex NSD-100. So far it’s going quite well. I took the FA526 CPU support from NetBSD, I use the 8250 driver for the UART, and default EHCI driver. I got stuck for a while on the EHCI part until Hans Petter Selasky pointed me that there might a problem in the busdma/cache handling. With the EHCI part fixed, I can get to the userland, booting from USB stick.

The remaining drivers that needs to be written are the OHCI and network. The OHCI shouldn’t take too much time, but I think the network will take quite a long time.

I was planning to clean up, and release the code today, but I was busy with something else, so may be I will release the code in the next few days. For those of you who are curious about the boot log, here it is:
Continue reading “STR9104/CNS1104 FreeBSD Port Progress”

Optimizing Asus EEE 900A

I just got back from my vacation around Thailand, so I will start to update things (Wii homebrew, Symbian apps, blogs, etc) again. Well, may be starting next week, I have a dental surgery this weekend and may need to rest. Anyway, this time I want to post about optimizing EEE 900A.

My wife was happy with her Asus EEE 701, but she would like something better with the same size. We sold the old Asus 701 to my brother, and she bought Asus EEE 900A. Compared to EE PC 701, the EEE PC 900A has a faster processor (Intel Atom 1.6 ghz vs the 900 Mhz EEE), more memory (1 gb vs 512 mb), bigger disk space (16 gb vs 4 gb), higher resolution (1024 x 600 vs 840×400), and better graphic processors (Intel GMA 950 vs Intel GMA 900). The only problem is the 16 GB SSD is much slower than the EEE 701 4 GB SSD. You can really feel it when running almost any applications, especially the firefox browser.

My wife uses Windows XP on the new Asus. After reading several blog posts and many forums, the conclusion is: to make everything faster, try to reduce the number of disk access. Here is how to reduce the disk access in Windows XP:

Continue reading “Optimizing Asus EEE 900A”

WiiApple: Apple IIe Emulator for Wii

I just learned about developing applications on Wii 3 days ago. I was wondering what application should I make, and I noticed that there was no Apple II emulator for Wii yet. Apple IIe was my first computer, so I thought it will be fun to be able to emulate it on my Wii. AppleWin is a good Apple emulator, but it is very windows specific, fortunately someone already ported it to Linux using SDL, and the name is LinApple.

Someone already made an early SDL port to Wii, but it is missing threading support (which is needed by the emulator). After reading things at and, I decided to complete the threading part. The next problem is the input. I want to be able to write BASIC applications, so I decided that the SDL port must support keyboard input, someone already made LibWiikeyboard, so I can just plug it in SDL (actually this is a hack, to correctly handle SDL requirements, there are some things that needs to be changed, in LibWiikeyboard and in the SDL gamecube implementation).

Next part is the porting process itself. The difficult part is making sure all the endiannes conversion of 6502 (Apple II CPU) to Wii’s PowerPC is done correctly, because I don’t have a USB gecko to debug it. Currently the port works, but don’t expect too much from this first release. I can already play some games, but I haven’t tested many other things. Sound is not yet now supported.

Here are some screenshots (made using tvtime, captured through my USB TV Box)

This is the application that you can extract to your SD Card

Note: Latest version is available at:

The plan is: Everytime I update the application, I will still use the same file name, you can look at to look for older releases.
You will need to install Homebrew Channel to use it.

And the source codes are available at:

Note: Latest source code is available at:


version 0.0.2:

– Fixed text overlay
– Disable saving options (dangerous for now, because you might overwrite your files)

version 0.0.3:

– Sound support
– Fix joypad problem
– Invalid disk image will not freeze the emulator (in case of invalid disk, Master.dsk will be reloaded)

January 6, 2009 (0.0.4)
– new keyboard driver, now work with most USB keyboards
Note: I am still working on the keyboard issue (some USB keyboard still  doesn’t work). I think this is because the limitation of Libwiikeyboard that can only do control transfer instead of interrupt transfer. Now I have rewritten the SDL keyboard part with my own code (part was based on the code from Guitar Fun).

January 6, 2009 (0.0.5)
– Support Gamecube controller (Wiimote support is planned for next version)
– updated some bug in keyboard handling

January 7, 2009 (0.0.6)
– Increased gamecube joystick sensitivity
– Fixed (most) crashing issue

January 8, 2009 (0.0.7)
– Support Wiimote as Joystick (Press A button in Gamecube controller to switch to gamecube joypad)

note: Mac USB keyboard works.

Tips For Debian on Agestar

Chris (Whites11) and several others have pointed that the source code for a device similar to Agestar have been released by a German company ( I have not looked carefully at the source code of this one, but none of the people on the mailing list have got it working with networking enabled.

Kari Ahtiala who owned several NAS devices (SLUG, NCB3AST, NCH3AHT), said that you can just move your disk from NSLU (SLUG) to Agestar just fine:

Continue reading “Tips For Debian on Agestar”

Installing Debian on Agestar without serial port

I have prepared a firmware and tutorial to Install Debian here, this time without the need for serial port. I have tested this, and it seems that everything works. But of course I will not be responsible if anything happens. If you think there are some missing, unclear or inaccurate steps, or if you doubt about something, then don’t install it. If you have anything to ask just email to yohanes [at], or just post your questions as comments.

NOTE: the web update method only works on agestar ncb3ast, other models can work by using serial port and latest patch for kernel source (2.6.29 or later).

Reverse Engineering Linux Kernel Image and Modules

I have switched my mind from doing the kernel porting to some other activities, which is reverse engineering ARM binaries for Symbian platform. When just starting, I thought to my self: why don’t I try to reverse engineer the original Agestar firmware, and may be I can complete some drivers for STAR STR9100. So I did, and I can get the watchdog function to work (at least I think it works).

zImage and bootpImage are compressed kernel image, this is compressed by using GZip method 8. The easiest way to decompress it is to give it to gunzip. I just searched the kernel image for the sequence 1f 8b 08, and cut it using khexedit. You don’t have to find where the compressed data ends, gunzip will ignore trailing garbage.

Continue reading “Reverse Engineering Linux Kernel Image and Modules”

How many of you are using STAR 9100 based NAS?

As listed on one of my previous posting, STAR 9100 (to be precise STAR 9104) is being used in these devices:

Coolmax CN-570
Emprex NSD-100
Agestar NCB3AHT
revoltec rs049

We can see from the boot log that says the machine is STAR_STR9100. Lately I have worked less and less on this device, because it has been running smoothly enough for me (I have run it continuously for a week). The last few parts is not so important for me. These four parts are RTC (turns out to be a very limited RTC), LED (only one LED inside the box, which is not very useful), and button (I have never used the button anyway), and Watch dog (this one might be useful, but I don’t have any documentation about this).

I am planning to stop further development. I was planning to build a custom firmware, but I think a full Debian distro is much better for me. But, if there are quite many people that uses this devices and are expecting something like NSLU2 (easy installer, etc), then I might continue the development. So, If you are using Agestar or agestar like devices, please leave a comment, and let me know what you expect.

If I am going to continue the development, I will need to buy another box, because I am currently using this one extensively for my daily activities. Irina (that is the name I gave to my NAS box) is now serving MP3, serving web page, and act as a download station.

RTC on STR9100

I have spent many hours to work on the RTC part, and I decided to give up for now. I have been able to activate the clock, set the clock, and make it run. But the RTC is not useful. First, it is not battery backed, so when you turn off your device, it will not keep the time. Second, it can store only the seconds, minutes, hours, and day of month. The problem of not having a documentation is sometimes you get stuck, and don’t know what to try next.

There is one feature that is supposed to be useful if I can make it work: the alarm capability. With alarm some cron-like applications can set to be notified when a particular time comes (it will ease the CPU burden). As far as I know the cron daemon doesn’t use this feature, so it is not a great loss.

There is one thing that still puzzles me. The original firmware uses X1205 through I2C bus. From my understanding the X1205 have different abilities compared to the STR9100 RTC. So I don’t know whether there is actually another RTC on the board.

Since the RTC is not very useful. I will let go hacking this part, until I find other clues.

Here is the output of the original firmware.

X1205: I2C based RTC driver.
i2c-core.o: driver X1205 registered.
X1205: found X1205 on STR9100 I2C Adapter
ccr_write_enable: verify SR failed
i2c-core.o: client [X1205] registered to adapter [STR9100 I2C Adapter](pos. 0).
X1205: i2c_add_driver RTC driver.
X1205: misc_register RTC driver.

LED driver

I was very tired lately because I have to do many other things beside hacking the agestar kernel. So when I have time this morning, I decided to work on the easiest part on my list: LED driver. Agestar NCB3AST only have one controllable led, inside the casing, so I don’t know how useful this is (I think you can peek a little bit when the casing is closed). The LED and LCD display front is actually controlled by different unit, not controllable by CPU. Because this part is not important, I decided to upload the patch later.

Right now I am starting to look at the RTC driver. Hopefully this one will be more useful.