Assembly of CLDC HotSpot Implementation for ARM

this article discusses the Java virtual machine CLDC HI open source Sun embedded and mobile platforms, as well as its construction for computers with ARM architecture.

CLDC HI

the Connected Limited Device Configuration HotSpot Implementation Virtual Machine (CLDC HI VM) high — performance Java virtual machine for devices with limited resources, developed by Oracle (formerly Sun). This is one of the virtual machines for small devices that run J2ME applications on devices with limited memory and processing power, e.g. mobile phones, PDAs, payment terminals, etc.

CLDC HI JVM is optimized by the virtual machine, which provides faster execution of the byte code and more efficient use of resources compared to other available virtual machines such as Squawk, KVM, Maxine, CVM, etc. it is Worth noting that the Java machine is focused mainly on ARM processors.

As a standalone product it is not supplied, but is included in several solutions for manufacturers of appropriate equipment. One of the versions of this virtual machine developed by Sun under GPLv2, i.e. open source (the project also bears the name PhoneME Feature). However, the documentation and start the virtual machine in the public domain there is little, and its development and support was practically stopped Oracle'om after absorbing the Sun.

Therefore, this article provides a brief description of CLDC HI and its Assembly + detailed Assembly instructions from the link below.

About profiles and configurations

Devices that can run J2ME application, define the configuration and the profile of the platform. The configuration only describes the low-level part of the platform capabilities of the Java language, its virtual machine and core classes.

Currently, there are two configurations for the Java ME platform:
    the
  1. CDC — Connected Device Configuration — used with a virtual machine on devices with 32-bit architecture, and requires more than 2 MB of memory. It provides more possibilities for applications than it is to CLDC, but more stringent hardware requirements.
  2. the
  3. CLDC — Connected Limited Device Configuration — used for 16 - bit and 32-bit devices with limited memory.
    J2ME application created in accordance with configuration CLDC is targeted at devices with the following characteristics:
      the
    • Minimum ROM capacity: 128 KB for CLDC 1.0, 160 KB for CLDC 1.1
    • the
    • Minimum RAM: 32 kilobytes
    • the
    • CPU: 16 - bit or 32-bit
    • the
    • Low power consumption
    • the
    • a network Connection, including wireless, unstable connection and limited data transfer rate, etc.

Higher-level part of the platform is a profile. It is expected that the profile will be set for each major class of devices (mobile phones, game machines, household appliances). Ie profile specifies the type of devices supported by the application. A profile complements a configuration of the specific classes that define the scope of the device.

J2ME is defined in two profiles based on CLDC: KJava and Mobile Information Device Profile (MIDP). Template for CDC available profile, on which you can build your own Foundation Profile.

The platform consisting of MIDP and CLDC, is quite common in the mobile phone market. It should be noted that CLDC HI also based on configuration CLDC 1.1(JSR 118) and the profile MIDP 2.1 (JSR 139).

Build CLDC HI

This virtual machine is very useful when you need to migrate a mobile application on a device that does not support the Java platform. Therefore, this article describes build Java machine CLDC HI, which includes:
    the
  • setup environment cross-compilation on the basis of gcc and binutils;
  • the
  • to understand and fix bugs in the source code related to incomplete backwards compatibility of the build tools;
  • the
  • Keys compile to run on the platform with the ARM architecture.


Actually go project repository PhoneME , whose structure is shown below, and take the necessary basic components: cldc, midp, pscl, tools. If you want to extend the functionality of the Java run-time of the machine, taken from the appropriate repository JSR packages. They will come together with midp.


The main stages of building CLDC HI:
    the
  • configure the environment cross-compile (tools, environment variables);
  • the
  • Build PCSL libraries;
  • the
  • Build the CLDC configuration;
  • the
  • Build the profile MIDP (if necessary, the Assembly of JSR packages).

For more detailed Assembly instructions on Linux for ARM can be found here: build CLDC HI

After a successful build, have output that contains assembled components, which then move to the target device.

Run on Paspberry Pi

As a target device to verify that you used a single Board computer Raspberry Pi ARM processor.


The input of JVM is supplied. jar file which in turn processes the installer Midlet's and produces a unique number for each application (see build CLDC HI). Then run a CLDC HI JVM with the application number and the frameBuffer is created, which displays an image of the device screen.
To further demonstrate the operation of the java game snake with CLDC HI on the Raspberry Pi.



PS: the article is written as a result of the course work in the mathematics and mechanics faculty St. Petersburg state University.
He has performed Sarmanovo S. G.
Scientific supervisor V. S. Polozov
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Integration of PostgreSQL with MS SQL Server for those who want faster and deeper

Custom database queries in MODx Revolution

Parse URL in Zend Framework 2