Squawk : The Road to High Level Programming on MicroControllers

What is Squawk project?

Squawk is a small Java(TM) VM written in Java that runs without an OS on small devices which are resource constraint devices where resources can be memory, CPU or battery power. Most JVMs are written using low level programming languages like C/C++ and assembly, while Squawk's core is mostly written in Java. Some complex processes can be better and easily expressed in Java, which offers features like garbage collection, exception handling and type safety. So, Squawk takes advantage from these features to perform some of its complex processes. Also implementing most of the VM in Java improves portability, maintainability and easiness of debugging. The Squawk JVM runs directly on the CPU which gives the advantage of not having an OS consuming resources on resource limited devices, and this means too that some of the OS functionalities should be placed in the JVM, and this results in a compact VM/OS that supports handling interrupts and writing device drivers in Java, also some other functionalities like resource management and networking stack should be provided by the VM. Having the Squawk JVM running directly on the CPU gives it full control on how much power is being used, which makes the programmers focus on building their Java applications without worrying about how long will the batteries last.




Sun SPOT(Small Programmable Object Technology):

It is a wireless sensor network developed by Sun Microsystems, it has a general purpose sensor/actuator application board (with a 3D accelerometer, a temperature sensor, a light sensor, two LEDs and two switches). Squawk's tiny size --80 KB RAM and 270 KB flash, including CLDC and hardware libraries-- makes it ideal for deployment on the Sun SPOT device, thus it brings Java to the world of sensor/actuators allowing the developers to use standard development tools directly on the device instead of low-level languages with little debugging support while running on the device.

Similar work:

JX is a Java operating system for cellphone and desktop PC, it runs on the bare metal on x86 and PPC. the same for JNode which runs only on desktop PC, for x86 architecture only .

YouTube videos:


Sources:
http://www.answers.com/main/ntquery?s=sun+spot&gwp=13
http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-1598&yr=2006&track=coolstuff
http://www.answers.com/topic/squawk-virtual-machine
http://research.sun.com/projects/squawk/squawk-rjvm.html
http://research.sun.com/projects/squawk/docs/oopsla05-squawk.pdf
http://en.wikipedia.org/wiki/JNode
http://www4.informatik.uni-erlangen.de/Projects/JX/

5 comments:

Amr Magdy said...

thanks for nice info

but which devices does this JVM work on ?

Is that valid to write something like JVM which is considered a CPU specific in Java ? I mean it is understandable that they need to introduce compact VM/OS, but this should be device specific and cannot be general

am I wrong ?

Nice post ... keep it up

mahmoud said...

actually not all of the JVM is written in java. Considering the standard JVM, most of it is written in C/C++ which costs a great effort to write it for a specific CPU. In Squawk there is a certain layer written in C/C++ which contains the I/O library, and as this JVM targetting small embedded devices, it won't cost a lot of effort to rewrite this small portion of the JVM to a specific CPU.

HeRo said...

nice topic mahmoud ..

Allowing High level programming languages on the platform of microcontrollers is a very important step. low level languages are suitable for nowadays micro's but apparently aren't for future one's..

but i think that such idea will make the controller itself more complex as it will embed new modules to run the actual code which may violate the very simple rule of controllers : being Cheap!!

but i think for the revolutionary progress in HW production it won't be a problem any more ...

very interesting..

Unknown said...

congratulation on new blog

Take a look at Microsoft's research project for other OS written in C# and small assembly language with little code written in c for debugging only.
http://research.microsoft.com/os/singularity/

Bina Simon said...

You actually make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and extremely broad for me. I’m looking forward to your next post, I will try to get the hang of it!
skip bin hire brisbane
skip bin hire darra