Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / July 2005

Tip: Looking for answers? Try searching our database.

Porting Wonka to ARM+eCos using wonka's vfs

Thread view: 
Marco Bressan - 23 Jul 2004 14:35 GMT
Hello, i'm working on a porting of the Wonka jvm on an ARM cpu running
eCos. To be more clear, i link wonka against some eCos libraries; then
i load the executable into the memory of a PXA255 board and run it.

Wonka uses its own Virtual File System, and to let things work you
have to:
1) create an image of the filesystem (i'm using ext2)
2) convert the filesystem image into an ELF32 object with the
'arm-elf-objcopy' tool
3) link together the libraries and the filesystem object to a binary
executable.

When you download the executable to the PXA board, all goes right and
wonka runs well. However, the executable is big (about 2.5 Mb) and it
takes about 6 minutes to download it, so testing applications is not
so easy.
To resolve this problem i (my teacher...) want(s) Wonka *not* to be
linked against the filesystem image; i would load the standalone
filesystem image into memory, load the wonka executable and run it.
Obviously, Wonka must know where the filesystem is located in memory.

PROBLEM: i can't let it work :(. When i launch wonka, it freezes when
trying to do something with the filesystem (perhaps mounting? i have
to do better debug).

Now i explain in more detail how i have tried to "hack" wonka.

I used 'arm-elf-nm' to dump symbols from image.o (the filesystem image
converted to an ELF32 object) and i saw this:

 001b2000 D _binary_image_end
 001b2000 A _binary_image_size
 00000000 D _binary_image_start

these are probably symbols introduced by the arm-elf-objcopy tool when
it sees that the input file is a fs image.
These symbols are also declared as extern in a source file in the
wonka tree, wonka/src/driver/ecos/disk-image.c :

 extern void _binary_image_end;
 extern void _binary_image_start;

these symbols are late used in a structure:

 image->disk = (w_ubyte *)&_binary_image_start;
 image->size = (w_long)((w_ubyte *)&_binary_image_end - image->disk);

it is evident that these symbols refer to the beginning of the
filesystem image.
So, the first thing i tried was to :

 1) modify the source of the driver, giving a fixed value to these
variables:
 
   unsigned int _binary_image_end = 0x006b2000;
   unsigned int _binary_image_start = 0x00500000;

 and, of course, modify the other piece of code, to let pointers work
properly:

   image->disk = (w_ubyte *)_binary_image_start;
   image->size = (w_long)((w_ubyte *)_binary_image_end -
image->disk);

 2) link the filesystem image object, relocating the .data section to
the new value of _binary_image_start. I did this because i see that,
when linking, the value of the __data_start symbol is always equal to
the value of the _binary_image_start symbol. So i deduced that the fs
image is located at the beginning of the .data segment of the module,
and i could find it here.
 So i did:

   $ arm-elf-ld -Tdata 0x500000 -o image image.o
 
 now 'arm-elf-nm' gives:
   
   006b2000 D _binary_image_end
   001b2000 A _binary_image_size
   00500000 D _binary_image_start
   006b2000 A __bss_end__
   006b2000 A _bss_end__
   006b2000 A __bss_start
   006b2000 A __bss_start__
   00500000 D __data_start
   006b2000 A _edata
   006b2000 A _end
   006b2000 A __end__
   00080000 ? _stack

 it seems to be ok for me.

 3) load the image to the PXA board memory using xscale-elf-gdb

 4) load wonka and run it

 As I said before, this doesn't work. Wonka freezes while mounting
the filesystem (or something similar). I'm sure the pointers point to
the right locations, so the problem is in the data.

Does anybody have any idea?

Thanks, Marco
Chris Gray - 29 Jul 2004 09:16 GMT
> Hello, i'm working on a porting of the Wonka jvm on an ARM cpu running
> eCos. To be more clear, i link wonka against some eCos libraries; then
[quoted text clipped - 7 lines]
> 3) link together the libraries and the filesystem object to a binary
> executable.

Marco,

Unfortunately I've only just seen this (I don't read usenet very
frequently). My first question is: are you aware of Andrea Scian's work in
this area, and have you contaced him (<andrea.scian@wawnet.biz>)? Probably
you're studying at the same place he did, this is just to be sure.

Wonka uses its own filesystem on eCos because at the time the original port
was made there was no filesystem available as part of eCos itsef. Now you
have JFFS2 at least (FAT maybe also?), so it would be better to work with
this. You would have to do the following:
- in the Configuration file, change FILESYSTEM from 'vfs' to 'native'.
- under source directory fs/native/hal/hostos, create a new subdirectory
'ecos'
- within this subdirectory, create directories 'include' and 'src' with
contents similar to those in fs/native/hal/hostos/netbsd. The exact
contents will of course need to be changed to match the eCos libraries.

> When you download the executable to the PXA board, all goes right and
> wonka runs well. However, the executable is big (about 2.5 Mb) and it
[quoted text clipped - 8 lines]
> trying to do something with the filesystem (perhaps mounting? i have
> to do better debug).

If you want to go this route, you should seek help on the eCos mailing list.
It looks to me as if you're having memory mapping problems, and there are
people on that list with a lot of experience of such things.

Unfortunately I'm offline next week (starting sometime tomorrow) - if you're
still struggling when I get back (9 Aug), drop me an email.

Best wishes

Signature

Chris Gray      chris@kiffer.eunet.be
/k/ Embedded Java Solutions

Danny D - 25 Jul 2005 11:30 GMT
Hello list

I have read in the mailing list about porting wonka to arm+ecos using wonka´s
vfs. I know, that the entry in the mailing list is very old (2003), but I
hope you can help me. I want to port the wonka jvm to my arm processor. Can
you say me the necessary steps of porting wonka to the arm processor. Do I
have to suit wonka to my arm processor (for example adapt machine dependent
code of wonka to my arm processor)? Can you list the exact steps of porting
wonka to my arm processor. I would be glad to get an answer from you. Thank
you so much,



Sincerely Danny Mauersberger

>> Hello, i'm working on a porting of the Wonka jvm on an ARM cpu running
>> eCos. To be more clear, i link wonka against some eCos libraries; then
[quoted text clipped - 34 lines]
>
>Best wishes


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.