Skip to main content

Building and running on Windows Mobile 5.0 (Pocket PC) iPAQ

17 replies [Last post]
hinkmond
Offline
Joined: 2003-12-01
Points: 0

Well, it's time to spin up the oldie but goodie topic of how to build and run phoneME Advanced software (Java ME CDC) on an iPAQ (Windows Mobile 5.0/Pocket PC ARM-based or XScale PDA).

Davy Preuveneers from K.U.Leuven has been helping out tremendously with working through the bit-rot that happened in the out-of-date Pocket PC port we have in the phoneME Advance source code. (The code is about 2 years out of date now and needs some updating).

Here is the off-line thread we've been having. It's time to get some help from other developers on this java.net phoneME Advanced project. Please let us know if you have some time to help out.

(See below)
Thanks,
Hinkmond

-----

On Wednesday 03 January 2007 22:49, Hinkmond Wong wrote:
> > Hi Davy,
> >
> > Happy new year! I'm glad you were able to make some good progress on
> > getting Foundation Profile to run the Hello World on a Pocket PC 2003
> > device.
> >
> > When we get closer to everything working, I can create a branch at the
> > Subversion repository for us to work on.

OK.

On a related note: I am not 100 % sure, but I think the helper methods I
implemented, are never used on the PocketPC 2003. They just had to be there
to satisfy the JNI bindings. That is, the WinNTFileSystem class is used
instead of the Win32FileSystem superclass (and therefore rename(), _access()
and _getdcwd() are never called). The java getDriveDirectory(char drive)
method, which relies on its native counterpart, is never called in the
resolve() method in java.io.Win32FileSystem as drive letters are never used
in pathnames on a PocketPC. Therefore, _getdcwd() and _wgetdcwd() are never
called, and neither the other methods _getdrive() and _chdrive() I
implemented.

> > (BTW, we should really take this thread over to the mail alias
> > [advanced@phoneme.dev.java.net] at some point soon since many other
> > people will be interested in it. Do you mind if we do that?]

Not at all. I just created an account to post at the forum.

> > For building either PBP or PP, I believe it will be easier to solve the
> > problem with PP.

Sure thing, I was trying to fix this for PBP, but I got a bit stuck on which
configuration files to actually modify.

> > For PP, looks like there are 19 classes that are out of date:
> >
> > PPCCheckboxPeer.java
> > PPCCanvasPeer.java
> > PPCPanelPeer.java
> > PPCWindowPeer.java
> > PPCFramePeer.java
> > PPCChoicePeer.java
> > PPCGraphics.java
> > PPCGraphicsConfiguration.java
> > PPCGraphicsDevice.java
> > PPCButtonPeer.java
> > PPCLabelPeer.java
> > PPCDialogPeer.java
> > PPCListPeer.java
> > PPCScrollbarPeer.java
> > PPCScrollPanePeer.java
> > PPCScrollPanePeer.java
> > PPCTextAreaPeer.java
> > PPCTextFieldPeer.java
> > PPCFileDialogPeer.java
> >
> > If you look at the above and compare each to the Qt equivalent per (Ex.
> > compare PPCCheckboxPeer.java to QtCheckboxPeer.java), you should see
> > that the Qt peer files are all now up-to-date with the latest spec.
> > changes, and it should give you a hint on what methods need to be
> > modified or added in the PPC peer class files.
> >
> > Do you have time to take a look and do that comparison? If not, we can
> > take this over to the advanced mail alias and get some help.

I already had a brief look at those java files, but certainly not in detail.
I might have some spare time left the following days to look into it, but I
cannot guarantee anything. I will keep you posted.

> > Thanks for all your good work on this,

You're welcome. I am currently cleaning up the patch, and rebuilding the
profiles. I will update the website tomorrow or so as it is 01h50 AM already
over here :-)

> >
> > Hinkmond

Davy

-- Davy Preuveneers K.U.Leuven - http://www.kuleuven.be Departement of Computer Science - http://www.cs.kuleuven.be DistriNet - http://www.cs.kuleuven.be/~distrinet Celestijnenlaan 200A, B-3001 Heverlee (Leuven), Belgium Room: 02.45 Phone: (+32) (0)16 327853 E-Mail: Davy.Preuveneers@cs.kuleuven.be Web: http://www.cs.kuleuven.be/~davy Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ken_gilmer
Offline
Joined: 2007-01-19
Points: 0

Hello Hinkmond,

I've created my own build dir per instructions from the cdc_build_system.pdf. It's based on build/linux-arm. My target is the Freescale MX31 and I'm using LTIB (http://savannah.nongnu.org/projects/ltib/) as the cross compiler/toolchain to generate my linux kernel (2.6.16) and rootfs. I'm in the process of adding a package to the LTIB system. I'm just running "make". My host environment is FC5. The one line that differs in my local GNUMakefile is:

CVM_TARGET_TOOLS_PREFIX=/opt/freescale/usr/local/gcc-4.1.1-glibc-2.4-nptl-2/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-

Hope this helps!

thanks
ken

hinkmond
Offline
Joined: 2003-12-01
Points: 0

Hi Ken,

I just saw that Chris posted before your most recent reply that the problem you are seeing will be fixed soon. You should see a commit to the repository that fixes this problem soon.

I was a bit confused at first since your original posting was in this thread which is titled "Building and running on Windows Mobile 5.0 (Pocket PC) iPAQ", however you are creating a new Linux/ARM build of phoneME Advanced instead.

So, technically we should move over this thread to a new one (non-Windows Mobile 5.0, maybe "Linux/ARM Porting"), but hopefully the bug will be fix with the upcoming commit and you won't need much more help to get running.

Thanks,
Hinkmond

cjplummer
Offline
Joined: 2006-10-16
Points: 0

The fix was just committed a few minutes ago.

ken_gilmer
Offline
Joined: 2007-01-19
Points: 0

I downloaded svn snapshot 1427 and compiled successfully. Thanks.

Ken

davyp
Offline
Joined: 2007-01-03
Points: 0

The fix also worked for compiling svn revision 1401 for the Pocket PC.

Davy

xyzzy
Offline
Joined: 2006-08-30
Points: 0

Davy, I saw your Jpeg.diff workaround for the "boolean" namespace conflict. Please look at:

https://phoneme.dev.java.net/svn/phoneme/components/cdc/trunk/src/win32/...

for another way to hide the Windows definition. Notice
the #pragma magic in defs_md.h:

/* is troublesome, so undo some of what it does */
#pragma include_alias(, )
/* work around type conflicts */
#pragma include_alias(, )

It's nice if we can hide the platform-specific workarounds in a platform-specific directory such as src/win32,
rather than having #ifdef WINCE in src/share.

But it appears that the jpeg code never includes defs_md.h, so you would have to do something like
add -I$(CVM_TARGETROOT)/javavm/include/win32 to CVM_INCLUDES, or perhaps cause all files to include a
custom header using the /FI option.

Dean

davyp
Offline
Joined: 2007-01-03
Points: 0

Thanks for the suggestion Dean. Cleaning up that jpeg patch was on my todo list, as the old workaround was
rather ugly.

However, I think adding a "-DHAVE_BOOLEAN" to CVM_DEFINES in defs_personal_pocketpc.mk will be enough
to avoid the redefinition of "boolean" in the jpeg header. It certainly is less invasive than the #pragma magic.
If this works I will upload new patches to the website.

Davy

davyp
Offline
Joined: 2007-01-03
Points: 0

Just to reply to myself: the above -DHAVE_BOOLEAN fix does not work due to another "boolean" hack in jpegdecoder.c.

Forcing the inclusion of the defs_md.h header file CCFLAGS also seems to cause compilation errors. I will look into it.

Davy

xyzzy
Offline
Joined: 2006-08-30
Points: 0

> Just to reply to myself: the above -DHAVE_BOOLEAN fix
> does not work due to another "boolean" hack in
> jpegdecoder.c.
>
> Forcing the inclusion of the defs_md.h header file
> CCFLAGS also seems to cause compilation errors. I
> will look into it.
>
> Davy

That's really funny. I removed that hack from jpegdecoder.c in 1998, but it got merged back in in 2001!

Also, it may be useful to do a target-specific variable assignment:

http://www.gnu.org/software/make/manual/make.html#Target_002dspecific

so that you override the command line only on the jpeg target files. You could also try including a new file, rather than defs_md.h, which contains only the boolean workaround.

Dean

hinkmond
Offline
Joined: 2003-12-01
Points: 0

For those who want to help with this (port of Java ME on Windows Mobile 5.0/Pocket PC on ARM(XScale/OMAP)), please see the new TWiki page I created that maps out how to get to the point of this discussion of this thread:

http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedPlatforms...

We could use help on this. If you follow the instructions above, you should be able to get to the compilation errors we are seeing in the last post.

davyp
Offline
Joined: 2007-01-03
Points: 0

Parts of the AWT peerset seem to be running for Personal Profile on Windows Mobile 2003, but many of the stubs still need to be implemented. An update of the patches and some screenshots can be found at:

http://www.cs.kuleuven.be/~davy/phoneme.php

Feel free to try out the patches and provide feedback on this forum.

Davy

Hinkmond Wong

Very nice work, Davy! :-)

Hinkmond

phonemeadvanced@mobileandembedded.org wrote:
> Parts of the AWT peerset seem to be running for Personal Profile on Windows Mobile 2003, but many of the stubs still need to be implemented. An update of the patches and some screenshots can be found at:
>
> http://www.cs.kuleuven.be/~davy/phoneme.php
>
> Feel free to try out the patches and provide feedback on this forum.
>
> Davy
> [Message sent by forum member 'davyp' (davyp)]
>
> http://forums.java.net/jive/thread.jspa?messageID=194928
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
> For additional commands, e-mail: advanced-help@phoneme.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

davyp
Offline
Joined: 2007-01-03
Points: 0

There have been some updates committed to the javavm recently, and they are causing compilation errors in ccm_runtime.c when building CDC, Foundation and PP. Apparently the MS compiler does not like the CVMmemCopy64() method being called with twice a (void *) pointer:

ccm_runtime.c(1719) : error C2036: 'void *' : unknown size
ccm_runtime.c(1719) : error C2036: 'void *' : unknown size
ccm_runtime.c(1719) : error C2120: 'void' illegal with all types

I changed the call several times (in lines 1719, 1736, 1756, 1775) by casting to a java long pointer and this solves the compilation errors. The Test program in testclasses.zip does not seem to complain about failures and some other AWT applications are running again, but perhaps there are cleaner solutions. Maybe someone wants to have a look at that.

Davy

ken_gilmer
Offline
Joined: 2007-01-19
Points: 0

I'm getting the same issue with gcc-4.1.1 glibc 2.4 nptl for an ARM target. Davyp's suggesting worked for me. Thanks!

Here's a snippet from my compiler of what the error looks like:

./../src/share/javavm/runtime/ccm_runtime.c: In function
'CVMCCMruntimePutstatic64Volatile':
../../src/share/javavm/runtime/ccm_runtime.c:1719: warning: dereferencing 'void
*' pointer
../../src/share/javavm/runtime/ccm_runtime.c:1719: warning: dereferencing 'void
*' pointer
../../src/share/javavm/runtime/ccm_runtime.c:1719: error: invalid use of void
expression
../../src/share/javavm/runtime/ccm_runtime.c:1719: warning: dereferencing 'void
*' pointer
../../src/share/javavm/runtime/ccm_runtime.c:1719: warning: dereferencing 'void
*' pointer
../../src/share/javavm/runtime/ccm_runtime.c:1719: error: invalid use of void
expression
../../src/share/javavm/runtime/ccm_runtime.c:1719: warning: left-hand operand
of comma expression has no effect
../../src/share/javavm/runtime/ccm_runtime.c:1719: warning: statement with no
effect

Message was edited by: ken_gilmer

hinkmond
Offline
Joined: 2003-12-01
Points: 0

Hi Ken,

When you're building, which build directory are you in? Is it build/linux-arm-strongarm or build/linux-arm-xscale? Also, what is your "make" command line? Are you trying to build J2ME_CLASSLIB=personal?

Also, what is your OS? Are you using some embedded flavor of Linux?

Hinkmond

cjplummer
Offline
Joined: 2006-10-16
Points: 0

We are aware of this problem and will get a fix committed very soon now.

thanks,

Chris Plummer

davyp
Offline
Joined: 2007-01-03
Points: 0

Hi all,

I outlined what I did thus far on my website at http://www.cs.kuleuven.be/~davy/phoneme.php. You can download some patches and initial builds over there as well.

As Hinkmond already stated, feedback and input from other developers is much appreciated.

Regards,
Davy