Showing posts with label arm. Show all posts
Showing posts with label arm. Show all posts

20110330

The USRP E100

I thought that I would take a moment to plug a product that I think has great potential for anyone working, experimenting, or interested in learning about digital wireless communication - the USRP E100. This device, jointly developed by Ettus Research and OpenSDR, was announced just a few months ago. It's a tightly-integrated embedded Linux solution for research into digital baseband signal processing for wireless systems.

I've worked with previous products from Ettus, like the USRP2, and have had 99% good experiences. The entire USRP product family is supported with GNURadio, which greatly facilitates signal visualization, processing, and software interfacing. The one down-side of using the USRP2 was that the only way to connect with it was by using a Gb ethernet cable (which is not a standard feature on laptop / desktop computers). The Gb ethernet port did not make the USRP2 'networkable' since it was only used for data transfer using raw ethernet packets.

The main differentiator of the E100 is that this device ships with a modular ARM board from GumStix. The stock GumStix board is powered by an OMAP3 (Cortex-A8) chip from Texas Instruments. The modular design makes repairs and upgrades easy (any COM can be used with conformant electrical and mechanical specifications). The OMAP3 has appeared in several mobile phones, but (more importantly) has also been the driving force behind a tidal wave of low-cost and powerful embedded Linux developer boards such as the BeagleBoard and BeagleBoard xM. Texas Instruments really has made a great contribution back to the developer community just by making these developer boards available. The OMAP3 processor is capable of running just about every operating system in existence, ranging from Windows Mobile to Ubuntu or Android (all flavours of Linux, and FreeBSD too). The E100 (probably) ships with Ångström by default. As for interfacing, the E100 even exposes HDMI, ethernet, and USB ports so this SDR box can literally be it's own work-station. I really wish this was available back when I was working on the USRP2!

So - that's great - an SDR device that eliminates the need for an external laptop or desktop computer so the entire system consumes much less power in total.

There's just one more thing...

The way that the OMAP3 interfaces with the radio hardware is super-efficient. The TX and RX buffers are mapped directly in to the OMAP3's MMU. To the layman, this means that the Linux kernel can easily expose the radio as a regular device to userspace using Phil Ballister's driver, which is on its way upstream. Furthermore, users of TI's Code Composer Studio (or developers who choose to use CGT directly) can write DSP firmware for OMAP3's integrated C64x+ DSP. Thus, keen developers can run code on the DSP to control the baseband radio and process baseband signals directly (the way nature intended). Naturally, only one processor on the chip can 'own' the radio buffers at one time (without proper synchronization).

To summarize: the USRP2 E100 is the ideal product for most engineers researching embedded RF systems and digital baseband processing.

PS: Nice work Phil! (he was my co-mentor for GSOC2010). I would love to use the E100 for some of my more recent work with ahumanright.org to engineer a low-cost / low-power satellite modem...

20110323

GSOC 2011: I Recommend Mono.SIMD

If anyone is looking for a good GSOC 2011 project, I would suggest Mono.SIMD. If you don't already know what SIMD is, then this project probably isn't for you, but you might find it interesting nonetheless. Although the Microsoft .NET version of C# does not explicitly support SIMD, once Mono has it for x86, ARM, and others, Microsoft likely will want it as well. The ARM port is just as important (if not more) important than the x86 port, so please don't ignore it. Buy a BeagleBoard or a PandaBoard to tackle NEON SIMD, (or even buy a Plug Computer or Verdex Pro for iwMMXt) . Although some people may think that iwMMXt is old news, it still lives on with Marvell's Sheeva and ARMADA product lines. You can still do blazingly fast multimedia with iwMMXt (h264, for example) but its limited to integer operations rather than floating-point (which is more efficient for multimedia in any case). 

Chances are you already have a PC with several flavours of SSE, so you should be all set to do add x86 SIMD and at least one flavour of ARM SIMD to the Mono JIT. Read this article to see why it makes sense.

PS: Good luck to all volunteering organizations and students this year!

20110216

Nvidia ARMs Themselves for a Shot at the Desktop Market

X86 chip manufacturers should probably be a little bit worried at this point, considering that Microsoft has also decided to do a full windows port to ARM. Of course, Linux has been running beautifully on ARM for almost two decades already.

Don't be fooled, Nvidia's ARM team is not only aiming at the netbook / laptop market - they're setting their crosshairs on the desktop market as well, as indicated by their roadmap.



PS: If you are reading this, and you were present at a certain meeting with me not too long ago where we were talking about buying an ARM architecture license, then I hope you are hearing this message loud and clear. My honest opinion is that you need to act now or suffer tremendously in sales.

20110119

U-Boot on the TS7260

Click here for the original image


20101106

MultiCore Threading

This post is partially in response to a question somebody asked me recently about threading on ARM Cortex-A9 systems. I was asked whether or not that just by creating a several new "threads", whether the threads will "automatically" run at the same time on separate cores without any operating system or system library interaction. The short answer is no.

The long answer begins with a 1-minute history of computer architecture. A processor generally has something called an instruction pipeline. For scalar architectures, this meant that only one instruction (read: hardware function) could ever be executed at any given time. Some clever hardware engineers determined that this was not utilizing the hardware as effectively as possible, and so they came up with the idea of a pipeline, or the superscalar architecture, which allows more than one hardware function to be executed at a time. Generally speaking, this meant that if the 'add' function was being used at one point in time, the 'memory fetch' function could also be used at the same point of time. This introduced something they industry termed a 'data hazard'. For example, if a certain add operation depended on the result of a memory fetch operation, then the add function would produce unanticipated results if the memory fetch operation had not completed in time. The first solution to this problem was to introduce stalls in the pipeline, which were (and still are) very bad. The second solution (really an improvement on the first solution) was to add another hardware unit in to the chip that would re-order the instructions before sending them down the pipeline in order to minimize pipeline stalls due to data hazards. That hardware unit was called an out-of-order execution unit. Instruction scheduling can actually be done in software as well, by the compiler and linker, but since this only allows off-line instruction scheduling, it cannot account for asynchronous events that are only stochastically predictable.  This is where the branch prediction unit comes into play, but I'll omit that for brevity. So far, only instruction-level parallelism has been covered.

The Cortex-A9 Pipeline
The Cortex-A9 MPCore
Now, most manufacturers realized that it would be best to let uniprocessor code execute on multicore systems so that programmers and compiler designers wouldn't have nervous breakdowns trying to optimize their code for the googles of system permutations that would be in existence (all of them would be vector processors). Thanks to all manufacturers for that one. ARM is no different, for the Cortex-A9 family of processors still belongs to the ARMv7a instruction set architecture. However, the general decision to run uniprocessor code on multicore systems necessitated the use of software entities to actually manage and, really schedule, when and where that code would be executed.

Getting back to the original question, it's important to consider what a 'thread' actually is. A thread is a pure software abstraction for a logical sequence of events. Threads are often associated with a priority, a state (e.g. ready, waiting, zombie), and an instruction pointer. As for the threading abstraction (e.g. POSIX threads), they must a) introduce data protection primitives, as well as mechanisms to b) wait until data is not in use and c) signal when data is no longer in use. Usually, the operating system deals with scheduling which threads are running at any given time, although it isn't that hard to do this without an operating system. The fundamental method of synchronizing threads is via shared sections of memory and atomic processor instructions. The thread scheduler uses timer-generated hardware interrupts to periodically evaluate the state of all threads, and then schedule code (i.e. determine the next branch target) for 1 to N cores. In the case of a uniprocessor system, this means that the scheduler itself is being swapped in and out after a certain number of time slices, where each time slice is occupied with a thread based on priority, state, etc. The number of cores available at any given time is also controllable with software, since cores can be dynamically powered off to save energy. This is something that the thread scheduler must take into account.

As for initialization of each core, typically a single core would be activated at power on, then as the operating system (or main binary) launches, a threading manager would also be launched. The threading manager would initialize and create descriptive data structures for the remaining cores on the system, and so on. As each core runs, it literally operates in a loop; 'jump' to an instruction and start executing, or go to sleep if not needed; then do the same thing again. The details on power up, particularly in the case of the ARM architecture, are very manufacturer dependent, since e.g. an OMAP MPCore implementation can have several physical differences and register locations than, e.g. an MSM MPCore implementation.

In summary, sure, it's easy to have several cores running at the same time, but getting them to coordinate shared data properly (i.e. run threads with shared data sections) requires that the concept of parallel execution be built into an application or library (which is not always easy). For a simple example, assume a library allocates 512 MB (i.e. 2**19 bytes) of memory, sets it all to zero, and then deallocates the memory. Would it run any faster on a multi-core system than it would on a single-core system? Absolutely not, because the processor cores do not follow the programming methodology of DWIMNWIS (unless it has a pretty advanced hardware rescheduler).

If I modify the library to first query a threading library to find the number of logical cores, partition my buffer into N sections, and then create several threads that are aware of their own partition boundaries, then I can expect my library to perform faster by a factor according to Amdahl's law: S=1/(F+(1-F)/N). In this case, since the amount of the problem that is not parallelizable is 0%, F=0, and the speedup is S=N. However, even in the case where a thread scheduler is present, there is still variability about where the code will actually run - for example, all threads could even be run on a single core, rather than distributed among them all.

Amdahl's Law: S = 1 / ( F + (1-F)/N )
Oddly enough, even though I have been writing threaded code for about a decade, I still have a pretty antiquated workstation on my desk (by today's standards). Indeed, my workstation is a single-core pentium-m laptop. It is a surprising hunk of garbage that never decides to finally die, although its been close on several occasions. In any case, I hope to have that upgraded soon to a quad-core Intel i7 machine, so that I can have 8 logical threads to speed up my ultimate goal of world domination.


Also, I'm looking forward to receiving a PandaBoard shortly, with an OMAP4440 dual-core Cortex-A9 chip. This will give me incentive to do some SMP performance tweaks on some of the NEON-enabled software I've written lately (e.g. FFTW).

20101001

Will NVidia Follow Suit of AMD's Doc Disclosure?

Recently, AMD committed to releasing technical documents for their GPUs in order to assist open-source software developers to write better 2D and 3D graphics drivers. AMD actually followed through with that committment as well, and you can find the technical documentation here, if you're interested. Thanks AMD!

Although AMD will continue to release binary-x86* Linux drivers, the release of their chipset documentation (actually for R300 R500 and R600 series), is intended to improve the 'out-of-the-box' experience for PC users.

AMDs chips are entirely x86, from what I can tell, although I think i remember a rumor that they licensed some of their graphics technology to Apple for the chips that went into the iPhone, iPad, and iPod Touch. Aside from that AMD has no (publicly visible) vested interest in having graphics drivers that are architecture independent.

On the other hand, NVidia actually purchased an ARM License and produces their own Cortex-A8 and Cortex-A9 silicon with integrated NVidia graphics (Tegra, Tegra2), so they have both an x86 and an ARM presence now. Not only that, but NVidia continues to be the sole surviving GPU company, since AMD bought out ATI.

However, NVidia seems to be encountering production delays trying to get (Linux-based?) Tegra2 products to market. I can only assume that they aren't having silicon issues[1], so it really must be an issue getting the hardware to work well. They have opened up their Tegra2 site to Linux developers, offering a development board, source code, and binaries. However, I'm really left wondering if they could also benefit from disclosing some documentation of their graphics cores and perhaps the Tegra2 TRM, so that the next generation of NVidia-powered mobile devices would also provide an excellent 'out-of-the-box' 2D and 3D user experience.

Will NVidia follow suit with NDA-free documentation disclosure? Lets hope so... it would definitely be enough convincing to get me to buy a Tegra2-based device.

[1] as in: whoops! this graphics subsystem only processes data at 1/2 the necessary rate! .... ahem... maybe you know who I'm talking about

20100514

GSOC 2010 Redirection

Hi Folks,

I just thought that I would put something up here to redirect queries about my GSOC 2010 project entitled "Neon Support for FFTW". Since my primary blog (the perpetual notion) has several completely unrelated categories, I've set up a dedicated blog for this GSOC project to avoid any potential confusion.

So please visit gsoc2010-fftw-neon.blogspot.com for any GSOC-specific information.

20091108

Simple Fortran Cross-Compiler for ARM


Run Fortran code on my handheld ? Are you insane?

That's probably the first thing that comes to your mind after seeing the title of my latest post - but with the power of ARM processors of today, why wouldn't we run Fortran programs on them?

Fortran was (back in the 70's ... and arguably still is) the scientific computing language of choice for many academics and engineers. It became the basis for many of the most advanced matrix-algebra math libraries available to date, including BLAS, LINPACK, and LAPACK, which are used by the most powerful number-crunching machines in the world, not to mention all of the banks and stock-exchanges! What I find more interesting is that the popular math engine known as MATLAB makes heavy use of BLAS and LAPACK, as does a free MATLAB-like environment called Octave.

I should take a step back and say, that the simple cross-compiler I have devised is not in-itself a cross compiler, but a two-step solution using F2C and your friendly-neighborhood cross-GCC ;-) That is, the Fortran code is first translated to C code, and then cross-compiled into machine code. Although many people swear that a well written Fortran code pushed through a good Fortran compiler will always blow away C code (and they probably are right), it's always true that something is better than nothing. The advantage of using F2C is that you don't need to link your programs to libgfortran, and having fewer dependencies is always good in embedded systems.

In any event, F2C (and the resultant libf2c) were authored by several friendly and very smart people who were kind enough to make their software available to the general public on NetLib.Org.

Using a popular perl script called Fort77, and my tiny patch, you should be able to cross-compile Fortran code to object code (.f -> .o) just like you would with C (.c -> .o). You'll need a libf2c.so compiled for ARM as well as f2c.h installed and in your cross-compiler's default search paths. I built the cross-compiled libf2c using an armv5tel-softfloat toolchain using Gentoo's crossdev, and created a small overlay for the package, available here.

I have something special on my evil agenda for this... and will hopefully be announcing something about that within the not-to-distant future!

Lastly ... for all of the gadget-geeks that are reading this... what sort of devices are you hoping to find in your stockings this holiday season? I'm fairly infatuated with the Qualcomm Snapdragon / MSM devices, but the Nokia n900 (with an OMAP chip also looks very tempting).

20090915

Gentoo BootSplash for ARM FrameBuffers

With Gentoo now running on several mobile devices, including the OpenMoko devices, HTC Wizard, and one that I'm still unable to mention due to NDA, I thought that it would be advantageous to be able to package splashutils for ARM devices in order to make the Gentoo boot process as visually appealing as others (notably Angstrom).

One major blocker in that process was being able to (cross-)compile klibc for ARM devices. Although that has been working well for a couple of years already, klibc was unavailable for Gentoo / ARM without an arm keyword. So I had to edit the klibc ebuild considerably and make it cross-compile friendly. In the process I added a couple of useful features and bug-fixes that were already in OpenEmbedded, like wc, losetup, etc. You can see the efforts of my klibc ebuild at Gentoo's Bugzilla under bug #284957. It's currently working without any issues. Incidentally, the ebuild configures for the ARM EABI if it's applicable.

Once that was ready to go, I contacted Spock and he assured me that his splashutils would work for generic framebuffers, and not just vesa or vga style devices. Then, it was just a matter of emerge-ing splashutils, and creating a theme.

I chose to modify the natural_gentoo theme because it was relatively clean-looking and recent. There are definitely hundreds of themes to choose from though. Here are the modified version for resolutions 240x320 (silent), 240x320 (verbose), 320x240 (silent), and 320x240 (verbose). My 240x320.cfg file is available here and a feature request has been added at Gentoo's Bugzilla under bug #285088.


 














Note: Ned Ludd and Angelo from #gentoo-embedded had apparently done this a year ago, but I guess they hadn't submitted it to the main portage tree. I was unaware of their efforts unfortunately, and maybe could have spared myself some time if I would have known about it beforehand.

20090711

HTC Hero vs Samsung Galaxy


I've been wowing over these two devices approximately for the last couple of months, and decided that it's finally time to make a decision.

Both the Samsung Galaxy and the HTC Hero use the same SoC (who isn't?) - the Qualcomm MSM7200A, a 528 MHz ARM1136EJ-S core, using the ARMv6 ISA. The MSM7200 includes a 3D acceleration unit and a Qualcomm DSP, making it very suitable for any multimedia application. I do believe that the 3D acceleration unit still lacks full support under Linux/Android (much like the OMAP3530/PowerVR). Both handsets have a 5MP camera, although no secondary camera for video calling. They both have 802.11b/g, bluetooth, etc. The display on both devices is 320x480 pixels. Major differences are that the Galaxy has several more buttons (e.g. volume control), much more internal storage space, and a very power efficient AMOLED display, while the Hero sports the new Sense(R) UI, integrated Adobe Flash, more RAM, and multi-touch support.

I thought I would summarize. For those who would like to see a detailed comparison of the two devices, check out this link from pdadb.net .

HTC HeroSamsung Galaxy
RAM (MB)288128
Flash (MB)5127630
Connectorext-USB
(mini-USB compatible)
micro-USB
Battery (mAh)13501500
Display Depth16-bit
(65-thousand colours)
24-bit
(16-million colours)
Display TypeTransflective TFT
(standard)
AMOLED
(very low power)
Multi-Touch?YES!NO!
Price (€)485,97 (Amazon.de)476,98 (Amazon.de)

So far, I have not had a chance to examine either of these devices in any detail, but from what I have read, the Hero does support multi-touch. Until now, most sources have stated that the Galaxy does not support multi-touch. However, that might only be due to the fact that Android did not support multi-touch in software until the Hero came out. Perhaps the Galaxy has hardware support for multi-touch. Who knows with any certainty? I've read that the Galaxy actually has a capacitive touchscreen, so multi-touch does not seem that far off. The Galaxy also lacks Google-branding, which (aside from lacking some cover-art) means that software updates are not transferred over the air. Rather, updates must be performed manually with a USB cable, which some users might actually prefer.

Let's start with the Hero. I like that it has a large amount of RAM a great UI that supports multi-touch. The RAM will come in handy for streaming media (i.e. video) and fast context switching (Android's OOM process killer will not be called as frequently). As for multi-touch, I think you would probably agree, that there really is no alternative for pinch-zooming in the browser, or easy photo rotations. Now, the Galaxy - the fact that it's missing some RAM has been somewhat accounted for with the built-in 8GB of storage. As far as the screen goes, AMOLED spells very low-power (I love it) and still supports a true-colour (16million level) display. That will make it excellent for viewing any type of video or looking at photos. However, if the Samsung hardware truly does not support multi-touch, then I would be quite disappointed.

I have to admit, that I'm still sitting on the fence about this until I know with any certainty that the Samsung does not support multi-touch. Originally, I was thinking that the Samsung would be the best choice, without a doubt, but now I'm really considering how the extra RAM in the Hero might be beneficial. In terms of permanent storage, the Hero has more than enough, and is expandable with a micro-SD card anyway. On the other hand, the Galaxy could easily host a few operating systems on-board, or perhaps my entire collection of (decent) mp3s. This decision would definitely be easier if I knew for a fact that the Galaxy hardware did or did not support multi-touch.

20090708

Suggestions for Future OpenMoko Device

I love my FreeRunner as much as the next guy. The truth is, though, that there are some serious improvements that could be made to the OpenMoko hardware - some purely for usability, and some to fix a couple of plaguing, nasty bugs. The suggestions below would really turn something like the FreeRunner into a truly portable computing device - not just another iPhone clone.

I've collected a few of my own suggestions below
  • use capacitive instead of resistive touch-screen (for multi-touch gestures)
  • switch to a newer generation SoC, such as the Qualcomm MSM7200A
    • newer ARM ISA (e.g. enhanced, jazelle, dsp, etc)
    • integrated video codec (ditch the Glamo)
    • integrated 3D graphics (again, ditch the Glamo)
    • integrated GPS receiver - just needs internal antenna
  • get rid of external GPS antenna connector (use internal instead)
  • add dedicated power connector (e.g. Nokia 6620)
    • built-in circuitry for 'software-free' battery charging (see discharged battery bug)
    • support charging from 1st USB if dedicated power supply is absent (1st port should be USB OTG)
  • add 2nd USB for use as dedicated host port
  • add a mini-dvi video output
  • add an ambient light sensor (auto backlight control in software)
  • a 5MP photo / video camera and 1.3MP camera for video chat.
A couple of incidentals 1) switch to using 100% recycled materials for the casing, if it already isn't, 2) use AMOLED display technology to prolong battery life.

Comments?

20090626

Mac OS X on a Dual-Core ARM-Powered Netbook?

With all of the hype over ARM-powered netbooks recently, they seem to be here to stay. Basically all of the major companies are jumping on this opportunity; we have the ARM licensees such as TI, Marvell, Qualcomm, and FreeScale, as well as major operating system providers such as Google (i.e. Android), and Microsoft. Even third-party software vendors like Adobe (i.e. Flash) are jumping aboard.

 The ideal silicon solution is a system-on-a-chip (SoC) maybe accompanied by an external graphics  co-processor (if it's not already integrated). For ARM architectures, that basically means 1 or 2 chips to power the entire computer versus Intel's 3, 4, 5, etc. Peripheral devices aside, ARM architectures use an order of magnitude less power than equivalent Intel architectures. What that means, is that the computers we use for our daily tasks, including document / internet activities, multimedia, programming, numerical analysis, etc, will have no fan, no heat-sink, and enough battery power for 10 times the active computing or standby time as Intel-based devices.

Now, I came across an article that I think actually has some merit. Apple could potentially become the next big-time ARM licensee and chip fabricator! Considering their recent acquisition of P.A. Semi and their huge successes with the iPod and iPhone (both ARM devices), they would technically stand to save millions by designing and fabricating their ARM chips in-house rather than purchasing them from outside vendors. Now in terms of porting the OS X to an ARM device - piece of cake. The core of the Apple operating system was designed from the start with portability and inheritance in mind. Their software is already pre-built and packaged in a universal binary format. With all likelihood, all they would need to do is highlight a check-box in XCode to build OS X for the ARM.

Honestly, I've never owned any apple products other than a second-hand 4th generation iPod that I lost on my last flight, mainly due to the prices, but if Apple decides to make a competitive move in the netbook market, then such a device might be the first Apple computer that I would buy, if the price is right. 

To elaborate - I'm a really big fan of the TouchBook from Always Innovating, Inc, especially with the detachable keyboard, and touchscreen / tablet form factor. If Apple could do the same, with a unibody aluminum case, have nice illuminated keys, and throw in that always-on 3G HSDPA modem that Qualcomm has in their Snapdragon, then I would be 100% in. In that case, I would very likely be willing to cough up another hundred for what I see as the ideal netbook. Of course, this could draw the power ratio to something like 1/7 instead of 1/10 when compared to an Intel netbook, but that still makes a very, very big difference.

On a final note, in 2010 consumers will see the dawn of when ARM chips actually incorporate two applications processors (aside from radio, DSP, Graphics, etc), much like the 'Core Duo' from Intel. Apple could incorporate two ARM cores, in order to retain that same UI responsiveness that Apple has been so well known for in the past.

Below is a block diagram [via Engadget] of the new ARM Cortex A9 chips that will begin to appear in 2010. The Cortex line of ARM processors was a step in a slightly different direction, being the first ARM devices to support out-of-order execution (OoOE), and although ARM chips have supported single-instruction-multiple-data (SIMD) since the v6 instruction set was introduced, OoOE will boost ARM performance to a level closer to Intel processors, which have traditionally used both OoOE and SIMD (as MMX). OoOE represents instruction-level parallelism while SIMD represents data-level parellelism. It should be noted that both of the aforementioned optimizations are independent of each other as well as independent of instruction pipelining. However, having pipelining, OoOE, and SIMD on the same chip leads to a exponentially increased complexity, resulting in a very large and necessary amount of silicon to reduce data collisions. This is the primary reason that Intel chips have been had such a long history of being power-hungry. Hopefully, this won't have too large of an effect on the power efficiency of future ARM chips.

20090619

NVidia Prefers WinCE to Android

There have been hordes of ARM-powered netbooks that have been popping out of the woodworks of Computex this year. One of which was touting the new NVidia ARM Tegra chip.

Here's a link to an article on Slashdot which reports that NVidia is not ready to back Android as a capable platform for Netbooks.

I unfortunately say that I must agree - although its not completely Google, or the Open Handset Alliance, or Linux that is truly at fault - or NVidia for that matter.

The problem is that NVidia would need to expose yet another kernel and user-space ABI (for their latest, integrated Tegra GPU no-less), and they are not prepared to do so. Aside from that, Android performs much of the hardware acceleration (a.k.a. DSP algorithms) for graphic and audio in a completely re-done set of non-portable libraries (the last time I saw the code), rather than using a single, portable abstraction layer such as OpenGL.

My recommendation? End-users should stick with WinCE (as well as the NVidia-modified UI) that will ship with the NVidia-based netbooks - IF THEY CHOOSE TO BUY A NETBOOK THAT USES AN NVIDIA TEGRA CHIP. Certainly, there are many other, more mature ARM chip vendors that will be offering netbook platforms (e.g. Qualcomm, TI, etc).

However, for almost all other ARM cores with unencumbered ABI's and API's for hardware acceleration - by all means use Android! The Android community, which is composed of literally thousands of developers, will have an exponentially greater ramp-up on new technology and software integration speed than NVidia & MS will, as single entities. Plus, as we have seen in the past, the release cycle for Android will likely be more frequent and since it's Open Source. Furthermore, there is less likelihood that Android will fall behind and become unmaintained (which was the whole purpose of the OHA in the first place), while the NVidia & WinCE combination will likely become unsupported and outdated at some point.

20090608

More From Computex. The Green Revolution of Computing Begins

One word: Wow!

For basically as long as I can remember, I've been interested in low-power computing. The combination of environmental awareness, plus the ability to understand how things work (i.e. engineering), essentially equates to my urge to want to make the universe more energy efficient. This is the reason why I've been such a big fan of ARM cores for so many years, and also why I've been following the progress of ARM and Linux together. Linux is basically the only publicly-available, fully-featured OS for alternative architectures such as ARM(ok, BSD too), which is why I consider Linux as pivotal for the recent achievements of ARM and their licensees. Having seen the Qualcomm-powered Netbook only a few days ago, I am no longer hesitant to say, that

Linux has enabled ARM to potentially overcome Intel in the PC market

Slashdot posted this yesterday, and I see no shame in admitting I read it there first. Computex has yet again unveiled what I consider to be the future of mobile computing and traditional workstations. Take a few minutes and please watch these videos. What you'll see is that several well-known semiconductor companies (Freescale, Nvidia, Qualcomm, ... Samsung?) plus many new and established manufacturers, have decided that it is time to bring ARM devices to the desktop.

As many engineers are already aware, ARM chips generally use < 1W of power, and entire systems often consume < 5W. These ARM chips run in the GHz range and offer more than enough computational power for day-to-day tasks, multimedia applications, and now even 3D gaming. When we compare the power consumption of about 5 W for a power-hungry ARM system, with the power consumption of a 300W office computer, the greener choice is clear.

A typical Intel-powered laptop or workstation (see x86 architecture) can often consume power in the range of 250-400W, when hard disks, optical drives, and expansion cards are taken into consideration. The most power-efficient x86-systems can run at about 30W. Therefore, the power savings using an ARM-based system can be between 100 times (in the most optimistic case) and 10 times (in the most conservative case) - but always in the favour of ARM systems.

Although the economy is on everyone's minds these days, energy is probably going to be one of the hottest markets in the next decade (and arguably now). I predict that we are likely to see the Green Revolution of Computing within the next few years. Power-efficient chips, such as those based on ARM, MIPS, and PowerPC architectures, will likely start replacing Intel chips on a massive scale. It's likely that this will first happen in the home, and then it will make its way into businesses. Businesses typically rely on 'legacy' applications and the cost is just to high to redesign most programs right away, so we will likely see the business adoption of Green Computing later on, hopefully driven by some kind of government incentive program.

ARM chips are typically designed for a single-user-load, and aren't necessarily the best thing for professional video editing, high-demand servers, extreme gaming, or scientific computing - at least not yet anyway. Of course, adding optical or magnetic-disk drives to any ARM system would increase the average power consumption of the device, but not as much as it would in the case of a PC, as most of required components for ARM are integrated onto a single chip, and not contained in a different chipset altogether. But isn't physical media becoming almost irrelevant these days, with the increased tendency toward cloud computing?

20090602

Qualcomm SnapDragon Powered EEE PC Surfaces at Computex

Computex 2009 was host today to the newest member of the EEE PC family, powered by the Qualcomm SnapDragon system-on-a-chip and Google's Android OS for mobile devices. The Qualcomm Snapdragon SoC incoroporates an ARM11 core operating ag 1 GHz (future models will be running at 1.3 GHz), an integrated 600 MHz DSP (a coprocessor for math, audio, and 3D acceleration), as well as embedded hardware video codecs, enabling this processor to support HD video of 720p (later models with 1080p). This netbook also offers always-up connectivity with an integrated internationally-compatible 3G modem, as well as the standard 802.11g wireless connectivity. The full spec list is available here. However, the kicker in favour of ARM-based netbooks is their power efficiency. The Qualcomm-powered EEE PC is expected to boast a battery life of 8 to 10 hours on a single charge!

ARM based processors are what power 99% of today's cellular phones and mobile electronics, such as the iPhone. As one might expect, there is no room for a heat sink or fan in a mobile phone. Therefore, ARM engineers and their licensees have taken power efficiency to a whole new level with this technology. Aside from the impressive multimedia and gaming capabilities, and like most ARM-based SoCs, all of the transistor logic for the CPU, co-processor, and peripheral devices is integrated onto a single wafer of silicon, hence the term 'system-on-a-chip'. Its as if the video, sound, network, PCIe controller, memory controllers, etc, etc, etc, were crammed onto a single package. For comparison, a similar netbook platform, based on the Intel architecture, would occupy at least three, but more commonly four or more chips, resulting in a drastically larger amount of power dissipated as heat.

The 1GHz barrier for ARM chips was first traversed commercially by Marvell, with their Shiva-Plug. Texas Instruments had reached milestones even earlier with their OMAP line of chips which power devices such as the BeagleBoard development board and the OpenPandora mobile gaming platform. The Qualcomm-powered EEE PC is not the first ARM-powered netbook though; some people may still have their eyes on the Always Innovating TouchBook, which is also powered by the familiar OMAP processor. However, if ASUS blesses this marriage of ARM and Android in their cathedrals of manufacturing, then the new Qualcomm-powered ASUS EEE PC might be the first ARM-powered netbook that hits the mass market.

20090410

Two Bits

Well, I've finally done it. I've been working for a few months now on porting Linux to a new device. Do you know what it came down to in the end?

Two bits in a 32-bit number.

That's it. There were times when I became quite a hermit working on this device. People would look at me like I was crazy sometimes. I had to open it the case and solder a few connections on. At the very beginning I was probing pcb pads to find the right traces. I hooked it up to a scope, put together a few voltage-level shifter circuits. I designed and fabricated a breakout board for easier access to some really small traces.

Just when I thought that I was destined to lose my grip on reality, I was greeted by what seemed to be some ascii characters on the oscilloscope. Then, with a bit more tinkering, at a point in time that seemed to be more precious than diamonds, as my eyes started to well up a little bit, I saw the following message on my console:
Linux version 2.6.29 (cfriedt@localhost) (gcc version 4.1.2 (Gentoo 4.1.2 p1.1)) #5 Fri Apr 10 18:16:27 CEST 2009
CPU: XScale-PXA270 [69054117] revision 7 (ARMv5TE), cr=0000397f
...

The device itself will remain unnamed .... for now ...

20090325

CeGCC / MingW32CE Ebuild for Gentoo Linux

It's probably safe to say that there are not many Gentoo Linux users out there who are actively developing WinCE applications. However, today I compiled my first "Hello, WinCE World!" app, messagebox and all, using the compiler from the CeGCC project. CeGCC-0.51.0 is based on fairly recent tools (e.g. gcc-4.1.0), which is a big bonus.

Although seeing a "Hello, World!" dialog in Windows CE surely made my day, the CeGCC compiler is really only a means to get Linux running on  a certain unnameable portable computing device for work. I'm using the HaRET bootloader which has shown promise for many others who have ported Linux to mobile or embedded devices that run WinCE. 

Just in case there are any Gentoo users out there who would also like to install the compiler using Portage, I have included Ebuilds for CeGCC and MingW32CE that install the i686/Linux toolchain components. Just to clarify, for those who are compiling applications for Win32, or people who want to hack HaRET, use the MingW32CE toolchain. For those who are interested in porting GNU software to ARM/Win32, use CeGCC.

You can download the overlay in tarball format here, but I would suggest using layman, just like for my other overlays.

The ultimate goal of my current project is to have an industrial handheld compuer / scanner that runs Android, and so far its been coming along very well.

20081028

Android Porting Progress

Hi everyone,

Sorry I haven't posted anything recently, but my days were busy with work, and then my nights were busy porting Android to the FreeRunner. In short, it's coming along, slowly but surely.

I've basically had to teach myself ARM assembly language in the last couple of days (fun, fun, fun!) and thought that I would quickly share all of useful resources that I've come across. So here they are:

The ARM Architecture Reference Manual

This is the definitive reference for pretty much everything. After reading this, I don't think I'll need any other reference material. In fact, I might even print myself a hard copy!

UNSW lab material on microprocessors and embedded systems

This is a surprisingly detailed tutorial for programming ARM in assembly language and C, which sort of bridges the gap between the two languages. It explains precisely the syntax of .S files and complies to the AAPCS (ARM Procedure Call Standard) and Thumb Procedure Call Standard (TPCS). I've archived the material for future reference in case this course website ever goes missing (which tends to happen often with universities).

Finally, the diff that I'm working from

Yes, I realize that it's pretty lame to cling to a single version of Android and not be constantly synchronizing with git and submitting code for review with gerrit, but I have no intentions of targetting anything aside from the FreeRunner / Neo1973 with my port, so I don't really want to deal with the build infrastructure right now. Ignore anything that starts with the less-compatible regular expression '^\- .*smull' (search by hitting '/') - I seem to have hastily deleted those routines in order to get my code to trivially compile before. Please, I don't recommend even trying to apply the diff as a patch - it will do nothing and may even inflict pain on some remote small kitten... and you wouldn't want that, would you? ... But seriously, the diff just highlights what code needs to be worked on. It actually has a lot of 'cruft', i.e. garbage, too, so just look for any lines matching '^\- ' that also contain one of the opcodes listed on the wiki.

Now from what I've been looking at in the code, there are 3 different options for optimizing the .S files for ARMv4T

1) using preprocessor macros for simple opcode translation
2) using globally visible AAPCS-compatible functions for emulating the v5TE instructions (this is where the UNSW tutorial has really come in handy). This is necessary for opcodes that are slightly more complicated, or ones with tricky addressing modes. The GNU preprocessor doesn't really have the capabilities to become a fully fledged scripting language unfortunately.
3) individual, call-by-call changes ... this is the ugly one that I don't really want to touch... but I'm guessing I will have to at some point.

Good luck with your porting efforts!

Chris


Enjoy!

PS: I find black sabbath very useful for putting myself into the 'zone' for programming in ARM assembly.

20081021

Hello, Open-Source World!

It's official... Google's brainchild, Android, has finally said
Hello, Open-Source World!

I wonder how many hours it will take for the first Neo 1973 or Neo FreeRunner port to surface. The biggest challenge, it will seem, will be to provide a bridge between the (minimal) ARMv5TE instruction set that Android was designed for, and the OpenMoko handsets' ARMv4T instruction set (as present in the Samsung 2442 SoC).

Perhaps the next handset that OpenMoko releases will feature native ARMv5TE compatibility.

Update: I've been building android for the last few hours, having made a few build-oriented changes that I think will help bridge the ARMv5TE - ARMv4T gap. I'm going to list a few of the errors I've been running into below. Please note - although I only list each undefined instruction once, the errors occur in multiplicity and in different subdirectories. I will post ARMv4T compliant work-arounds soon. Please be patient.

  • bionic/libc/arch-arm/bionic/memcmp.S:44: Error: selected processor does not support `pld [r0,#0]
  • system/core/libpixelflinger/t32cb16blend.S:121: Error: selected processor does not support `smulbb lr,r7,lr'
  • system/core/libpixelflinger/t32cb16blend.S ... Error: selected processor does not support `smulbt ...'
  • external/jpeg/jidctfst.S:148: Error: selected processor does not support `smlabb r0,r2,r3,r5'
  • dalvik/vm/arch/arm/CallEABI.S:239: Error: selected processor does not support `blx ip'
  • dalvik/vm/mterp/out/InterpAsm-armv5.S:2653: Error: selected processor does not support `ldrd r2,[r0,#offStaticField_value]'
  • dalvik/vm/mterp/out/InterpAsm-armv5.S ... Error: selected processor does not support `strd ...'
  • external/sonivox/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s:77: Error: selected processor does not support `smulwb r4,r4,nGain'
  • external/sonivox/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s:114: Error: selected processor does not support `smlawb tmp1,gainLeft,tmp0,tmp1'
  • external/opencore//codecs_v2/audio/aac/dec/src/calc_auto_corr.cpp
    /tmp/ccBi9nUH.s: Assembler messages:
    /tmp/ccBi9nUH.s:652: Error: selected processor does not support `clz r0,ip'
  • smultt, smlatt, smlawt, smulwt, qadd, qsub, qdadd, qdsub, smlabt
  • etc, etc, etc ...
Build problems that were not architecturally related:
  • out/target/product/generic/obj/SHARED_LIBRARIES/libdvm_intermediates/Misc.o: In function `dvmAllocBit': dalvik/vm/Misc.c:247: undefined reference to `ffs'
Theoretically, there are three possibilities to in order to have Android on the FreeRunner.
  • The first is to ] replace [ the red-highlighted mnemonics using an equivalent ARMv4 or ARMv4T instruction sequence. In some cases, this is impossible without a lot of context information.
  • The second is to completely re-implement each section from scratch, wherever one of the ARMv5TE instructions are issued, but using an algorithm optimized for the ARMv4 or ARMv4T architecture
  • The third option is to just remove it, e.g. for the pld instruction which only optimizes memory fetches by hinting (or not?)