Categories
embedded systems English articles OpenWrt qi-hardware Tech

OpenWrt on the Ben NanoNote!

The Ben NanoNote I got a few weeks ago by qi-hardware is now running OpenWrt!

The patch, published by the manufacturer ingenic itself, which provides linux support for their SoC’s (System-on-a-Chip’s), is roughly cleaned up, unneeded stuff is cleared out and it’s levelled up to 2.6.25.20 (originally the patch refers to 2.6.24.3) and – running!

That’s the good news…

…now the bad ones:

  • The mentioned patch by ingenic contains not only linux kernel source but also binary data – ELF-formatted binary code for the mips instruction set! For more details you may want to look at my post on the developer-mailinglist (http://lists.qi-hardware.com/pipermail/developer/2009-August/000162.html). They patch in a proprietary mtdblock-replacement which seems to differ to the original in nand-flash error correction and handling of bad blocks. That’s a no-go – not just because of the reaosons of open hardware/software but also as not being able to forward the patchset to a newer kernel version.
  • Strange problems appear with the MMC / SD-card hardware. Randomly the hardware does not recognize the card correctly (more precisely, the card is recognized but not the partition table why the kernel panics because of not finding it’s given root device). Spent days not on this issue, but weren’t able to figure out yet what’s causing this kind of behaviour 🙁

What’s next?

  • get this bloody MMC/SD-card issue fixed
  • get the NAND flash supported – either we get the sourcecode of the modified mtdblock driver or get it supported elsewise
  • further cleanups of the existing patchset
  • level up the patchset to a recent kernel version (2.6.31 would be best – much stuff went upstream / is now handled nativly, e.g. nand-chips > 4 GB don’t need the ingenic hacks anymore, also there’s a new interface for gpio-based keyboards which should make it pretty easy to write a keyboard-driver and allows us to get rid of the existing stuff).
  • (re)writing some (of the) drivers (e.g. MMC/SD-card support and support for SDIO, keyboard-driver as mentioned above)

I was in Hamburg this weekend meeting Lars for a hack-session on the Ben NanoNote. He’s also part of the OpenWrt-team and now another proud owner of such a device 🙂

Besides his ongoing contributions to the Openmoko-project, hopefully he will also help us* spending some of his time on the NanoNote – thank’s a lot at this point for your great work and efforts!

*i’m happy to announce that last week I “became an official developer of the [qi-]core team” with “focus
on the OpenWrt integration” – let’s see what will happen 🙂

Categories
embedded systems English articles OpenWrt Tech

Linksys WRT160NL

I got a Linksys WRT160NL and because I didn’t find any pictures of the board nor any data about the serial – here’s what I got:

Linksys WRT160NL
Linksys WRT160NL (click to enlarge)
Categories
embedded systems English articles Openmoko OpenWrt qi-hardware Tech

qi-hardware

qi-hardware is a startup (announced 20th of July on linux.com) which set itself the target of manufacturing and deploying  hardware under the idea of “Open Source Hardware” (for details you might want to read the mentioned article on linux.com or on qi-hardware.com itself).

This idea might call some analogies to Openmoko and – indeed – not just the ideas, also the people are almost the same 🙂

Same idea? Same targets? Same people? Let’s face it: same mistakes? At least qi is saying: “no!” as described in their post “Lessons learned

Based on the saying “back to the roots” aka “the more basics the fewer problems” they announced their first device:

the “Ben NanoNote”, which (at least for now) comes with no RF-hardware at all.

Nevertheless the project looks very interesting and promising – even more when I was told that OpenWrt is going to be used as default operating system.

Shortly after I was asked whether I’m interested in helping getting OpenWrt running on it – I agreed, got one and am now hacking on it 🙂

Let’s see how things will do…

Categories
embedded systems English articles Openmoko OpenWrt Tech

…and because everybody likes screenshots :)

Categories
embedded systems English articles Openmoko OpenWrt Tech

OpenWrt on the Openmoko Freerunner – some updates…

Long time no news regarding OpenWrt <-> the Openmoko Neo devices; but it
happened much!

It now reached a state where I think it’s justified to announce a ready-to-work(/debug?) OpenWrt-Image for the Openmoko Freerunner.

This should be a short overview of what happened

– kernel 2.6.30.1 is running
all neo-specific patches were extracted from the OM-kernel-tree and
created an atomic and maintainable patchset for the Neo (thanks to Lars !!)

– clean, stable and accelerated graphics system
thanks to the gorgeous work of the xf86-video-glamo developers (especially Lars (again)), finally
there’s no need for <Xglamo> anymore – acceleration is done from within
an usual <Xorg> with the glamo-driver used. The infamous WSOD (white screen of death) should be
ultimately purged out.

– GPS works
the amazing application <tangoGPS> is also available as an
OpenWrt-package now

– performance tuned
due to it’s architecture itself, fixed bugs and found ways for
optimizations through all layers, OpenWrt now boots in less than 1
minute into illume (very first boot excluded)

– software added/upgraded
besides lot’s of just OpenWrt-related improvements, also typical
OM-community-used packages were added and upgraded to recent versions
(e.g. tangogps, enlightenment/the whole efl-suite, paroli, fso, connman,
etc.)

– a beautiful bootsplash
real beauty can’t be described by words 😛

– phone calls are still possible
thanks to paroli, the basic phone stuff is (still) working (phone calls,
messages, contacts, etc.)

== Images / environment

Images can be found here: http://nanl.de/files/openwrt/openmoko/
Mind – that, as usual for OpenWrt – the default IP of your device will
be “192.168.1.1” and the only running service will be <telnet> on port
23.
After logging in and setting a password, <telnetd> is getting replaced
through <sshd> (port 22).
The mentioned files/images have the prefix “20090706_r16709_1”, based on
svn-revision 16709.

Suggestions / critism is welcome… 🙂

The original announcement on the mailinglists can be found here (http://kerneltrap.org/mailarchive/openmoko-devel/2009/7/6/6147903)

Categories
embedded systems English articles OpenWrt Tech

asserts in python may not work as expected

While getting the phone suite “paroli” (http://paroli-project.org) working on OpenWrt, I got some thrown exceptions in the OpenWrt-environment which I didn’t get in the official OM-builds.
I tried to figure out what exactly is causing the exception on the OpenWrt-target and created a minimal program which raises it:

You don’t have to know what’s <tichy> and its <Item> class, nor what <issubclass> is doing exactly – just mind the return values.

root@OpenWrt:/# DISPLAY=:0 python
Python 2.6.1 (r261:67515, Jun  8 2009, 09:18:20)
[GCC 4.1.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from tichy.item import Item
>>> issubclass(bool, Item)
False
>>> assert issubclass(bool, Item)
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
AssertionError

Ah, ok. On the OpenWrt-target the assert throws an exception, because <issubclass> returns <False>

So, logically, within the Openmoko-environment, the <issubclass>-statement must return <True> to not get assert raising an exception – but that’s not the case:

root@om-gta02:~# DISPLAY=:0 python
Python 2.6.2 (r262:71600, May 31 2009, 00:18:54)
[GCC 4.1.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from tichy.item import Item
>>> issubclass(bool, Item)
False
>>> assert issubclass(bool, Item)
>>>

Huh – ok, let’s take a closer look here:

<issubclass (bool, Item)> is returning False, but <assert issubclass(bool, Item)> is not throwing an exception – that’s weird and caused me to do test the assert-statement in a very simple way:

root@om-gta02:~# DISPLAY=:0 python
Python 2.6.2 (r262:71600, May 31 2009, 00:18:54)
[GCC 4.1.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> assert False
>>>

That’s definitely not the expected result of assert.

So, why is that happening? Why python’s assert is just doing nothing?

Some research about that got me into this statement:

“[..]The current code generator emits no code for an assert statement when optimization is requested at compile time. Note that it is unnecessary to include the source code for the expression that failed in the error message; it will be displayed as part of the stack trace.[..]” – http://docs.python.org/reference/simple_stmts.html#grammar-token-assert_stmt

Let’s check that with a regular python-installation:

$ python
Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47)
[GCC 4.3.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> assert False
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
AssertionError
>>>
$ python -O # enable optimizations
Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47)
[GCC 4.3.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> assert False
>>>

Conclusion:
– some distributions are shipping their python-package configured for executing python-scripts with optimizations enabled
– asserts may not act as expected, means, they may don’t do anything when above is true
– i’m not using asserts anymore when my app is relying on asserts and I don’t know for sure which target/distribution my scripts are running on

Categories
embedded systems English articles fun OpenWrt Tech

some updates of what’s going on :)

Besides the ongoing work related to the Openmoko Freerunner <-> OpenWrt integration, I decided to focus on multimedia application ports for OpenWrt.

The Xbox Multimedia Center (xbmc -> http://www.xbmc.org), which I’m using (and lovin’) for several years on my Xbox now, was starting getting ported to Linux quite some time ago.
The port looks really promising, so I decided to start get it working within OpenWrt.

I already started porting some basic needed dependencies, including <(lib)boost> (http://www.boost.org), a apparently widely used c++ library set.
Because this project – ehrm – really resists all normal tries getting cross-compiled and staged (it does use an alternative to make called <bjam> which is better because of… – I really have no clue), I took a look how the OpenEmbedded-project got it done – and it helped! – technically as well as morally.

Besides giving me some hints how to workaround some of their (really weird) stuff, I “discovered” a comment in the middle of the file (http://cgit.openembedded.net/cgit.cgi?url=openembedded/tree/recipes/boost/boost.inc) which I like to quote:

[..]
80 # Oh yippee, a new build system, it’s sooo cooool I could eat my own
81 # foot. inlining=on lets the compiler choose, I think. At least this
82 # stuff is documented…
83 # NOTE: if you leave on then in a debug build the build sys
84 # objcopy will be invoked, and that won’t work. Building debug apparently
85 # requires hacking gcc-tools.jam
86 #
87 # Sometimes I wake up screaming. Famous figures are gathered in the nightmare,
88 # Steve Bourne, Larry Wall, the whole of the ANSI C committee. They’re just
89 # standing there, waiting, but the truely terrifying thing is what they carry
90 # in their hands. At first sight each seems to bear the same thing, but it is
91 # not so for the forms in their grasp are ever so slightly different one from
92 # the other. Each is twisted in some grotesque way from the other to make each
93 # an unspeakable perversion impossible to perceive without the onset of madness.
94 # True insanity awaits anyone who perceives all of these horrors together.
95 #
96 # Quotation marks, there might be an easier way to do this, but I can’t find
97 # it. The problem is that the user.hpp configuration file must receive a
98 # pre-processor macro defined as the appropriate string – complete with “‘s
99 # around it. (<> is a possibility here but the danger to that is that the
100 # failure case interprets the < and > as shell redirections, creating
101 # random files in the source tree.)
[..]

Reading this really made my day 🙂

Anyway – boost is ported and working on OpenWrt now, but that’s only the head of the list of dependencies for getting xbmc compiled and running –
any help here – packaging requirements for xbmc for OpenWrt – is highly appreciated!

Categories
embedded systems English articles Openmoko OpenWrt Tech

OpenWrt is supporting the Openmoko GTA02 “Freerunner”!

It’s done – the Openmoko GTA02 “Freerunner” is running OpenWrt!

There’s lot’s of stuff to do but let’s see what I spent most of my time the last few months for:

– kernel (2.6.28) is building and booting (merging the Openmoko and OpenWrt patchsets, whereof one (and that’s not ours ;)) consists of either over 620 little non-atomic patches or one 10MB patchblob [kudos to git!], is no picnic (thanks to the work of Michael “mb” Buesch at this point!)
– D-Bus and the freesmartphone.org reference implementation (they import the libc.so.6 via ctypes – I was really puzzled when python told me it can’t find my libc, because I was using the uclibc)
– Xglamo with acceleration (in the beginning Xglamo just crashed, even JTAG wasn’t available anymore; it took us weeks to figure out that a compiler bug was the cause (thanks to Felix Fietkau, Holger Freyther and Lars Clausen) – Lars btw. is currently making good progress to get glamo acceleration working within Xorg)
– the EFL (enlightenment foundation libraries) and enlightenment including illume (needs some more love to make it really fit into the OpenWrt-environment – currently <edje_cc> and <eet> are required as pre-installed host tools)
– paroli phone application suite (in case it’s working ;))

A few days ago we established the first OpenWrt<->OpenWrt phone call which worked out of the box after flashing our devices!

Hurray! 🙂

Categories
embedded systems German articles OpenWrt Tech

Es ist getan – loopAES läuft auf OpenWrt!

Hi!

Es ist vollbracht! LoopAES ist auf den KAMIKAZE-branch von OpenWrt portiert – und es läuft.

Zwar nicht außerordnetlich gut, aber immerhin besser als unter WHITE RUSSIAN (kernel 2.4).

Hier einige erste Benchmarks:

Es wurde ein 100 MB-Image via NFS einmal auf eine verschlüsselte und einmal auf eine unverschlüsselte Partition eines am WGT634U angeschlossenen USB-Sticks kopiert:

Cipher: None (unencrypted)
# time cp image /wgt/notenc/
real 2m55.925s
user 0m0.005s
sys 0m0.532s

Cipher: AES256

# time cp image /wgt/enc/
real 5m32.948s
user 0m0.010s
sys 0m0.517s
Es wird noch optimiert werden. Wer die Sourcen haben will soll ‘n Comment schreiben.

Ich glaube die nacht wird noch lang 🙂

Categories
embedded systems German articles OpenWrt Tech

dm-crypt laeuft – aber scheiße

Hi!

Endlich habe ich es geschafft dm-crypt für OpenWRT zum laufen zu bekommen – wirklich nach etlichen Stunden Arbeit.

Dementsprechend groß war auch die Enttäuschung, als ich ein paar Benchmarks erstellt habe.

Ein 10 MB großes File auf eine verschlüsselte Partition (dm-crypt) auf den WGT634U mit USB 2.0 und 200 MHz-CPU zu schreiben dauert genauso lange, wie das Schreiben des selben Files auf eine verschlüsselte Partition (loopAES) auf den WL500G mit 125 MHz-CPU und USB 1.1.

Der Geschwindigkeitsvorteil, den ich mir durch den WGT634U in Sachen schreiben/lesen auf verschlüsselte Partitionen erhofft habe ist somit nichtig.

dm-crypt scheint so oberflächlich betrachtet auf langsamer und unkonventioneller Hardware definitiv loopAES unterlegen zu sein.

Das Problem an der Sache ist, dass ich loopAES nicht für den KAMIKAZE-branch von OpenWRT (kernel 2.6) portiert bekomme.

Der jetzige stabile Zweig “White Russian” mit dem 2.4er Kernel läuft ja nicht auf dem WGT634U, weswegen ich mich jetzt an die Portierung von loopAES für KAMIKAZE mache 😉

Wer dennoch Interesse an den dm-crypt Paketen hat, soll nen Comment schreiben.

So long…