Welcome to Tinyhack.com

For demo, see my NCB3AST serving information about itself .

Install Debian

See this page for installing Debian Etch on your Agestar NCB3AST using serial port.

See this page for installing Debian Etch on your Agestar NCB3AST without serial port.

From http://www.lliures.org/2008/05/02/ft3563-bt-hacking/ this following devices have the same hardware:

  1. Coolmax CN-570
  2. NS-348S
  3. Emprex NSD-100
  4. Agestar NCB3AHT
  5. NAS2
  6. revoltec rs049

The instructions for installing Debian MIGHT work for those devices, but it is not guaranteed.

Porting Story

Chiang Mai, Thailand, Friday 20 June 2008

When I bought Agestar NCB3AST I didn't know that this device uses Linux. When I found out at home, I was happy and hoping that I can install full Linux like the guys from NSLU2-Linux. Unfortunately, they don't provide the source code for Linux on this platform. Their firmware is using old Linux kernel (version 2.4.27), with very limited features.

At first I was quite happy to access the shell, and I tried to flash my device using my own firmware (I thought I knew the format), but I bricked it. Fortunately I can revive it back by connecting a serial port to it. It is very easy to connect a serial port to this device, no soldering required, only a TTL level converter is needed. For the TTL voltage converter, I bought a data cable for a cell phone, cut the cables, and connect it to the serial port pins.

Having a serial port, I can access the boot loader (Armboot), and this gives me the idea to port Linux kernel 2.6 to run on this device. With a hard work, and a lot of good luck, I was able to port latest Linux kernel (2.6.25) to run on this device.

First, you should know that this device is manufactured in Taiwan. It uses SoC (System On a Chip) STR9104 from star semi and there is no documentation available for this SoC. The processor used in the SoC is Faraday FA526, an ARM v4 compatible processor (and there is also no documentation for this processor).

Even though Agestar doesn't provide the source code, fortunately there are two devices from LinkSys that uses almost the same hardware (STR9109). The source code of LinkSys WAP200 and WRVS400N can be compiled to run on this device. Unfortunately, not every part of the devices works with these source codes (for example the MTD part to access the Flash Memory doesn't work).

I noticed that Raidsonic Icy Box uses Storlink SoC. This SoC uses the same processor as STR9104 (Faraday FA526). RaidSonic provides the source code for Kernel 2.6, so I can use the CPU specific code for this processor. This means that to port Linux kernel 2.6 to run in this device, I can use the CPU specific code from Icy Box, and I only need to implement some parts by myself.

I started to study the Input/Output (I/O) mappings for this device, and creates the basic architectural stuff. I blindly port the timer and interrupt part, since I can not see output yet, but amazingly it works on the first try.

After booting, the execution will transfer to kernel, and I need to write a console driver to see the kernel output. I learned that the Serial Port is 16C550 compliant (not 100% compliant, it needs some register mapping). Having the serial port console working, I can see the kernel output, and I can continue my work easily. Next thing to port is the Network Driver. STR9104 have several MAC hardware that can connect to several external PHY hardware (but Agestar only have one PHY hardware, IP101A). The old driver can be compiled quite easily after doing some changes.

Next part is the USB. STR9104 have two host controller interfaces: EHCI (Enhanced Host Controller Interface, for high speed USB 2.0) and OHCI (Open Host Controller Interface, for low and full speed USB 1.1). In the original driver, the programmer patched the source of the core EHCI and OHCI driver in several places. They also tries to use PCI interface to access it, but actually the OHCI and EHCI driver is not on the PCI bus. To write the new driver, I only need to do some trial and errors to find the correct address and initialization parameters for both of the host controller interface.

The MTD (Memory Technology Device) is EN29LV640H, this chip is compatible with CFI (common flash memory interface) so I only need to provicde the partition mapping (which can be seen from the original firmware). I was a bit worried that I might destroy the boot loader if I made a mistake in the driver, but fortunately, everything was working fine.

I am still hoping I can port these parts to make it perfect:

  1. RTC (real time clock) driver. Right now, I just use NTP (Network Time Protocol) to adjust the clock
  2. Button driver. This device only have 2 buttons as inputs. If the button driver works, I can assign this buttons to shutdown Linux, or do something.
  3. LED driver to indicate some stuff
  4. Watchdog driver. I wan't to be able to access this device anytime, having a watchdog will ensure that

End Of Porting Story

irina:~# uname -a
Linux irina #33 PREEMPT Thu Jun 19 22:08:48 ICT 2008 armv4l GNU/Linux

irina:~# cat /proc/cpuinfo 
Processor       : FA526id(wb) rev 1 (v4l)
BogoMIPS        : 153.19
Features        : swp half 
CPU implementer : 0x66
CPU architecture: 4
CPU variant     : 0x0
CPU part        : 0x526
CPU revision    : 1
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format B
Cache format    : Harvard
I size          : 16384
I assoc         : 2
I line length   : 16
I sets          : 512
D size          : 16384
D assoc         : 2
D line length   : 16
D sets          : 512

Hardware        : STAR_STR9100
Revision        : 0000
Serial          : 0000000000000000

irina:~# cat /proc/meminfo 
MemTotal:        28884 kB
MemFree:          7452 kB
Buffers:           728 kB
Cached:          14208 kB
SwapCached:        928 kB
Active:          14476 kB
Inactive:         3124 kB
SwapTotal:     1004020 kB
SwapFree:       997588 kB
Dirty:               4 kB
Writeback:           0 kB
AnonPages:        2092 kB
Mapped:           3500 kB
Slab:             2084 kB
SReclaimable:      536 kB
SUnreclaim:       1548 kB
PageTables:        412 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   1018460 kB
Committed_AS:    24076 kB
VmallocTotal:   221184 kB
VmallocUsed:      8692 kB
VmallocChunk:   204796 kB

Copyright © 2008 Yohanes Nugroho