Blog / 2005-10-27 aQute - Software Consultancy
Search
*

OSGi on the Slug

The OSGi is getting a tremendous pull from its success in the open source market. Obviously it is fantastic to see applications based on OSGi that we never envisioned in the first place. Both Oscar (now Felix at Apache), Knopflerfish, and Eclipsehave opened venues we never dreamt off. Also IBM with their Lotus Workplace and other products show that OSGi can be successful for Enterprise applications.

However, this massive success also overshadows the goals we initially set out to solve. Looking at Release 4, we really have focused our efforts on larger computers and ease of development. In one way this is good, we are gaining traction in the Enterprise world. The OSGi is a very small and elegant environment to deploy and manage massive applications. However, my heart still sometimes goes out to the embedded market with its diversity and need for efficiency and resulting elegance.

A couple of weeks ago I therefore announced to my Evange-list that I wanted to create a demonstration platform for OSGi services, with a clear focus on embedded. So I started browsing the web looking for an interesting platform. I actually was impressed with the myriad of devices offering Java in the embedded world. However, I was also disappointed that few offered OSGi. The advantages of OSGi on a small embedded platform are too big to ignore, so the only solution I can draw is that many people just do not know yet what it offers.

After a while I ran into the slug site. The Slug is a modified NSLU2 from Linksys/Cisco. The original function is a network storage unit. The specifications are quite impressive: IXP420 (ARM) processor 266 Mhz, 2x USB, Ethernet, 8Mb Flash, and 32Mb RAM. Or in normal terms, what a PC was a couple of years ago. A serial port is available for those that can solder. This all for $80 end user street price.

Linksys has implemented the software for this device with Linux and GNU. Obviously, this falls under the GNU Public License (GPL) which means that they must publish their changes. Therefore, Linksyshas a special GPL site that contains downloads for all their GPLed code. The original code is not open to external applications. The guys at www.nslu2-linux.org opened it up and created a large database of applications running on the slug. I mailed this to the list to get others enthusiastic. I was intrigued and decided to spent the weekend playing with it.

First, I like the device and what they have done with it. Kudos! However, I must admit that I missed the smell of embedded. It was quite a shock to see how much Flash was wasted (As an old geezer, I once thought 12K RAM on a 12 Mhz processor was fantastic). Actually, in most configurations the Flash is only used to initialize a hard or flash disk with a minimal image. Obviously, anything runs when you have a Gigabyte storage! Fortunately, there was a project ucslugc that was focused on running in flash. After compiling, downloading, and booting it still had more than 4 Mb left. Not sufficient yet, but in the right direction.

So there is still room left to improve here. First, the Linux image is compressed and is expanded in memory. I think it should be possible to run the image from flash (albeit slower). Second, the Redboot loader has reserved a megabyte for the image, which is imho too big for a simple OS. There are also unused applications on the slug like ipkg, busybox, etc.

Next part was to get a Java VM to run. Marcel Offermans had read my mail on the Evange-list and had gotten a jamvmto run with classpath. However, classpath is trying to mimic J2EE, not J2ME. So I had to recompile classpath and remove unnecessary classes. Not too easy, but I got it down to 1 Mb, and jamvm is only 100Kb.

The weekend was over and I was stalled to next week. My goal is to have a slug running OSGi (and nothing more) in a couple of weeks. If you are interested, let me know.

   Peter Kriens

posted by Peter @ Thursday, October 27, 2005

Copyright 2006 aQute SARL, All Rights Reserved