Skip to main content

ROMizing

3 replies [Last post]
Anonymous

Does anyone know anything about ROMizing? I think it would benefit me
greatly on a project I am working on but have no idea where to start
with it. I am working in Linux, so if anyone knows the commands in
Linux to create a ROMized file (?? I guess it creates a file) and run
that corresponding file on the KVM, that would be great. Thank you so
much.

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04
Points: 0

Alex,

The way I understand your situation is that you want to create a standalone system that boots Linux, starts the Java VM execution, and automatically runs a preconfigured Java application. I didn't follow the bouny castle thread but essentially what you need is:

- The Java VM stack with all necessary system classes preverified in the bootclasspath, possibly ROMized. This configuration is automatically built with the normal phoneME build process so you don't need to do anything else here

- The application, packaged in a jar file including all libraries you need (such as bouncy castle) and preverified

- Tell the phoneME stack to execute your application on start-up and point it to the main class as well as the jar file

All of the above is easy to do and doesn't require any "tricks".

You ask about the ROMizer. You can find a description here:

http://java.sun.com/javame/reference/docs/cldc-hi-2.0-web/doc/architectu...

The ROMizer is a tool that takes a list of class files, loads the classes and resolves them, and then takes a snapshot of the layout of all resulting data structures in memory and builds a set of C files that represent that state. This is now linked into the Java VM. The result is that all ROMized classes are immediately available for execution when the VM starts up thus reducing start-up time considerably.

It is an alternate means loading and resolving classes if these classes are known at the time the Java VM stack is built. But it is only an optimization and therefore I don't think is required for your situation.

Let me know if this makes sense.

-- Terrence

Joe Bowbeer

On 7/25/07, Padilla, Alex D wrote:
>
> Does anyone know anything about ROMizing? I think it would benefit me
> greatly on a project I am working on but have no idea where to start with
> it. I am working in Linux, so if anyone knows the commands in Linux to
> create a ROMized file (?? I guess it creates a file) and run that
> corresponding file on the KVM, that would be great. Thank you so much.
>

Alex,

The problem you are trying to solve (adding classes from a 3rd party
library to your MIDlet) is commonly solved by combining all the
classes together and then using an obfuscator/compactor such as
proguard to remove unused classes. The pieces of Ant script I sent
previously show the basic steps. Linux is not an obstacle here and
NetBeans is not a requirement.

Others have suggested using Antenna to create the package. Antenna is
Java-based (like Ant and proguard). Antenna may be simpler for
beginners because it will do everything you need in one step:

http://antenna.sourceforge.net/wtkpackage.php

You'll want to add bouncycastle to the libclasspath.

--
Joe Bowbeer

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Padilla, Alex D

Joe,

Thank you very much for your reply and all of your replies at that.
However, I am not developing a MIDlet, at least in the traditional
sense. I do not need to conform to the MIDP standard and am not
developing an application to run on a cell phone. I believe this is
where the majority of people are misunderstanding me as it seems most
people are doing such things in this forum. I have been trying to stay
away from using ProGuard and Antenna because these are entirely new
tools for me. I have looked into the link you provided me and am
completely confused about Antenna. Maybe I need to look at it longer,
but I am not sure if this will solve my problem. Everything I have read
about Antenna states that it needs to be run on the Palm OS. Is this
true? This simply is not an option in my project. I need to keep
everything as simple as possible. If I need to use Antenna, I will do
it if possible, however. I just wanted to ensure that I am making
myself clear as to my requirements for the project. What I need to do
is described below:

1. I need to develop a Java program that will use the Bouncy Castle
crypto package.
2. The program can be developed on any OS, in any environment. However,
the program must then be copied into Linux without any environment
installed.
3. I will make a Linux image which will be copied over to a custom-made
board with nothing but simple Java on it. This means that the board has
only the ability to run a Java Class file (and only a Java class file
from my understanding) and cannot do much else.
4. Therefore, I need to preverify the class file and possibly preload
any classes and libraries it calls upon into the KVM before I run it in
the KVM on the board.

Any help from anyone would be greatly appreciated.

-----Original Message-----
From: A mailing list for KVM discussion
[mailto:KVM-INTEREST@JAVA.SUN.COM] On Behalf Of Joe Bowbeer
Sent: Thursday, July 26, 2007 1:33 PM
To: KVM-INTEREST@JAVA.SUN.COM
Subject: Re: ROMizing

On 7/25/07, Padilla, Alex D wrote:
>
> Does anyone know anything about ROMizing? I think it would benefit me

> greatly on a project I am working on but have no idea where to start
> with it. I am working in Linux, so if anyone knows the commands in
> Linux to create a ROMized file (?? I guess it creates a file) and run
> that corresponding file on the KVM, that would be great. Thank you so
much.
>

Alex,

The problem you are trying to solve (adding classes from a 3rd party
library to your MIDlet) is commonly solved by combining all the classes
together and then using an obfuscator/compactor such as proguard to
remove unused classes. The pieces of Ant script I sent previously show
the basic steps. Linux is not an obstacle here and NetBeans is not a
requirement.

Others have suggested using Antenna to create the package. Antenna is
Java-based (like Ant and proguard). Antenna may be simpler for
beginners because it will do everything you need in one step:

http://antenna.sourceforge.net/wtkpackage.php

You'll want to add bouncycastle to the libclasspath.

--
Joe Bowbeer

========================================================================
===
To unsubscribe, send email to listserv@java.sun.com and include in the
body of the message "signoff KVM-INTEREST". For general help, send
email to listserv@java.sun.com and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".