1. ARM port
- Posted by raseu Aug 27, 2011
- 5632 views
IIRC, I remember reading about an ARM port for euphoria a few months back.
was it ever finished ?
does anybody have a link for a download ?
i ask because this board/machine http://www.raspberrypi.org/
should be available within the next few months and seems to
be an ideal target for euphoria
2. Re: ARM port
- Posted by euphoric (admin) Aug 27, 2011
- 5615 views
i ask because this board/machine http://www.raspberrypi.org/
should be available within the next few months and seems to
be an ideal target for euphoria
That looks so cool! Wow. For $25, I could get a whole lot of those. :)
3. Re: ARM port
- Posted by mattlewis (admin) Aug 27, 2011
- 5576 views
IIRC, I remember reading about an ARM port for euphoria a few months back.
was it ever finished ?
does anybody have a link for a download ?
There is a branch of the 4.1 code for ARM. As far as I know, it works. I haven't done anything with it. The code is http://scm.openeuphoria.org/hg/euphoria/shortlog/f8e6675c26e0 in the repo. There are links to download it zipped or b/gzipped tarballs.
I believe the plan is to have ARM as an officially supported platform for 4.1.
Matt
4. Re: ARM port
- Posted by coconut Aug 27, 2011
- 5549 views
IIRC, I remember reading about an ARM port for euphoria a few months back.
was it ever finished ?
does anybody have a link for a download ?
There is a branch of the 4.1 code for ARM. As far as I know, it works. I haven't done anything with it. The code is http://scm.openeuphoria.org/hg/euphoria/shortlog/f8e6675c26e0 in the repo. There are links to download it zipped or b/gzipped tarballs.
I believe the plan is to have ARM as an officially supported platform for 4.1.
Matt
I downloaded the package but it is not configured to compile on ARM machine.
I have a Efika netbook with ubuntu installed.
1)I go to source directory
2)./configure
3) make
gcc complain that -m32 option doesn't exist. I can't blame it -m32 is an intel cpu option...
5. Re: ARM port
- Posted by raseu Aug 28, 2011
- 5516 views
There is a branch of the 4.1 code for ARM. As far as I know, it works. I haven't done anything with it. The code is http://scm.openeuphoria.org/hg/euphoria/shortlog/f8e6675c26e0 in the repo. There are links to download it zipped or b/gzipped tarballs.
I believe the plan is to have ARM as an officially supported platform for 4.1.
Matt
Thanks for the update
I downloaded the package but it is not configured to compile on ARM machine.
I have a Efika netbook with ubuntu installed.
1)I go to source directory
2)./configure
3) make
gcc complain that -m32 option doesn't exist. I can't blame it -m32 is an intel cpu option...
Maybe try the GCC cross compiler tools, with QEMU to boot an ARM image
http://stackoverflow.com/questions/6242416/tools-required-to-learn-arm-on-linux-x86-platform
Thats what I intend on trying out in the short term until I can
get hold of the Raspberry PI when it is released
6. Re: ARM port
- Posted by Jerome Aug 28, 2011
- 5451 views
I downloaded the package but it is not configured to compile on ARM machine.
I have a Efika netbook with ubuntu installed.
1)I go to source directory
2)./configure
3) make
gcc complain that -m32 option doesn't exist. I can't blame it -m32 is an intel cpu option...
I have been using euphoria to write apps for my Linux-based phone with an ARM processor. I like using Scratchbox to do my cross-compiling because it helps me keep the different environments separate. In my setup, I have a normal x86 environment and an ARM environment. I do the following in my x86 environment to get started:
cd source ./configure --arch ARM make source
This allows me to use the pre-built euphoria binaries to compile the source. I then switch to to my ARM environment to generate ARM based binaries that run on my phone.
make
I just tried this out with the 4.1 ARM euphoria branch it works great!
Hope this helps,
Ira
7. Re: ARM port
- Posted by raseu Aug 28, 2011
- 5482 views
I have been using euphoria to write apps for my Linux-based phone with an ARM processor.
I like using Scratchbox to do my cross-compiling ...
This allows me to use the pre-built euphoria binaries to compile the source.
I then switch to to my ARM environment to generate ARM based binaries that run on my phone.
I just tried this out with the 4.1 ARM euphoria branch it works great!
perfect.
good to hear that it can be done
couple of questions
have you done any tests using an ARM image via QEMU ?
are you able to use any GUI libraries via the euphoria wrappers on
your ARM phone ?
8. Re: ARM port
- Posted by Jerome Aug 28, 2011
- 5427 views
have you done any tests using an ARM image via QEMU ?
Sorry, I don't have any experience with QEMU. What is it?
It looks like Scratchbox uses QEMU under the hood. So I do use it to emulate my ARM environment for testing!
are you able to use any GUI libraries via the euphoria wrappers on
your ARM phone ?
I have been using wxEuphoria to build GUIs on my phone. There are some quirks that don't work exactly right, but overall it works well! For example, trying to get the mouse coordinates from a mouse event causes a crash (my phone has a touch screen but no real mouse).
Thanks,
Ira
9. Re: ARM port
- Posted by coconut Aug 29, 2011
- 5422 views
There is a branch of the 4.1 code for ARM. As far as I know, it works. I haven't done anything with it. The code is http://scm.openeuphoria.org/hg/euphoria/shortlog/f8e6675c26e0 in the repo. There are links to download it zipped or b/gzipped tarballs.
I believe the plan is to have ARM as an officially supported platform for 4.1.
Matt
Thanks for the update
I downloaded the package but it is not configured to compile on ARM machine.
I have a Efika netbook with ubuntu installed.
1)I go to source directory
2)./configure
3) make
gcc complain that -m32 option doesn't exist. I can't blame it -m32 is an intel cpu option...
Maybe try the GCC cross compiler tools, with QEMU to boot an ARM image
http://stackoverflow.com/questions/6242416/tools-required-to-learn-arm-on-linux-x86-platform
Thats what I intend on trying out in the short term until I can
get hold of the Raspberry PI when it is released
I shouldn't need crosscompiling as the Efika netbook is ARM base so I expect it to compile if the configuration file is for ARM CPU.
Jacques
10. Re: ARM port
- Posted by Jerome Aug 30, 2011
- 5394 views
I shouldn't need crosscompiling as the Efika netbook is ARM base so I expect it to compile if the configuration file is for ARM CPU.
I agree you don't need a cross-compiling toolchain if you are already on ARM system. The issue I think you'll have (someone please clarify if I misunderstand!) is that Euphoria needs a working eui binary to compile or pre-translated c source files. Which ARM archetecture is your Efika notebook?
Thanks,
Ira
11. Re: ARM port
- Posted by mattlewis (admin) Aug 30, 2011
- 5332 views
I shouldn't need crosscompiling as the Efika netbook is ARM base so I expect it to compile if the configuration file is for ARM CPU.
I agree you don't need a cross-compiling toolchain if you are already on ARM system. The issue I think you'll have (someone please clarify if I misunderstand!) is that Euphoria needs a working eui binary to compile or pre-translated c source files. Which ARM archetecture is your Efika notebook?
That's true. I'm not sure how well the configure script works on ARM. AFAIK, it's only been used to cross compile (and I've never done even that personally). You should be able to build a translator from that code on another platform and use that to translate for an ARM platform, however.
Matt
12. Re: ARM port
- Posted by coconut Aug 31, 2011
- 5287 views
this link give the specification of the Efika smartbook netbook http://www.genesi-usa.com/support/smartbook/faq
Jacques
13. Re: ARM port
- Posted by Jerome Aug 31, 2011
- 5244 views
this link give the specification of the Efika smartbook netbook http://www.genesi-usa.com/support/smartbook/faq
Jacques,
If you want to give it a shot, I've posted an eui binary for your ARM-Cortex laptop (ARMv7), at http://dl.dropbox.com/u/5805068/eui. Put this in your path, and then run the following:
./configure --arch ARM make
Let me know if you run into any issues or the if the eui binary doesn't work!
Thanks,
Ira
14. Re: ARM port
- Posted by coconut Sep 03, 2011
- 5215 views
this link give the specification of the Efika smartbook netbook http://www.genesi-usa.com/support/smartbook/faq
Jacques,
If you want to give it a shot, I've posted an eui binary for your ARM-Cortex laptop (ARMv7), at http://dl.dropbox.com/u/5805068/eui. Put this in your path, and then run the following:
./configure --arch ARM make
Let me know if you run into any issues or the if the eui binary doesn't work!
Thanks,
Ira
I did it and it works. At the beginning of compilation it complained that it could not find hg but it did success anyway. Did not made extensive test execute without error.
Thanks Ira
15. Re: ARM port
- Posted by coconut Sep 03, 2011
- 5244 views
this link give the specification of the Efika smartbook netbook http://www.genesi-usa.com/support/smartbook/faq
Jacques,
If you want to give it a shot, I've posted an eui binary for your ARM-Cortex laptop (ARMv7), at http://dl.dropbox.com/u/5805068/eui. Put this in your path, and then run the following:
./configure --arch ARM make
Let me know if you run into any issues or the if the eui binary doesn't work!
Thanks,
Ira
I did it and it works. At the beginning of compilation it complained that it could not find hg but it did success anyway. Did not made extensive test execute without error.
Thanks Ira
I tryied to run the programs in the demo directory and the only one that run is animal.ex all others send an Illegal instruction to console.
Jacques
16. Re: ARM port
- Posted by Jerome Sep 04, 2011
- 5166 views
I tryied to run the programs in the demo directory and the only one that run is animal.ex all others send an Illegal instruction to console.
Can you check that the eui used to run the demos is the new compiled eui, instead of the downloaded binary? If you ran 'make install' I believe the new binaries are located in /usr/local/bin. If you have already checked this, then we'll have to do some investigating... Almost all of the demos work on my ARM system.
Thanks,
Ira
17. Re: ARM port
- Posted by coconut Sep 04, 2011
- 5113 views
I tryied to run the programs in the demo directory and the only one that run is animal.ex all others send an Illegal instruction to console.
Can you check that the eui used to run the demos is the new compiled eui, instead of the downloaded binary? If you ran 'make install' I believe the new binaries are located in /usr/local/bin. If you have already checked this, then we'll have to do some investigating... Almost all of the demos work on my ARM system.
Thanks,
Ira
This is really the one I compiled, file timestamp confirmed.
Jacques
18. Re: ARM port
- Posted by Jerome Sep 04, 2011
- 5115 views
This is really the one I compiled, file timestamp confirmed.
Ok, thanks! We should be able to find where the illegal instruction is using gdb (GNU debugger). You might need to re-compile the source again with debugging information:
./configure --debug --arch=ARM
Then you can debug one of the demo programs that gives the illegal instruction:
gdb eui run allsorts.ex
It should tell you where the illegal instruction occured, and we can try to fix it from there. We had to do something similar not too long ago http://openeuphoria.org/forum/m/115739.wc.
Thanks,
Ira
19. Re: ARM port
- Posted by coconut Sep 05, 2011
- 5060 views
This is really the one I compiled, file timestamp confirmed.
Ok, thanks! We should be able to find where the illegal instruction is using gdb (GNU debugger). You might need to re-compile the source again with debugging information:
./configure --debug --arch=ARM
Then you can debug one of the demo programs that gives the illegal instruction:
gdb eui run allsorts.ex
It should tell you where the illegal instruction occured, and we can try to fix it from there. We had to do something similar not too long ago http://openeuphoria.org/forum/m/115739.wc.
Thanks,
Ira
Here de result of debugging session:
Program received signal SIGILL, Illegal instruction. 0x0026d052 in decompress (c=252) at be_decompress.c:84 84 d= *(double *)string_ptr;
Jacques
20. Re: ARM port
- Posted by mattlewis (admin) Sep 05, 2011
- 5064 views
Here de result of debugging session:
Program received signal SIGILL, Illegal instruction. 0x0026d052 in decompress (c=252) at be_decompress.c:84 84 d= *(double *)string_ptr;
I seem to recall very similar errors happening. I believe that ARM processors require 16 byte alignment or something. We've probably either missed doing so somewhere or had a regression.
Matt
21. Re: ARM port
- Posted by Jerome Sep 06, 2011
- 5106 views
I seem to recall very similar errors happening. I believe that ARM processors require 16 byte alignment or something. We've probably either missed doing so somewhere or had a regression.
Yes, I use to get this illegal instruction when we first started:
0x002ff9b4 in decompress (c=251) at be_decompress.c:75 75 d = (double)*(float *)string_ptr;
Which was fixed with:
float f; d = (double)*(float*)memcpy((void*)&f, (void*)string_ptr, 4);
Jacques, for your illegal instruction, can you give this a try?
... //--d= *(double *)string_ptr; memcpy(&d, (double *)string_ptr, 8); ...
Thanks,
Ira
22. Re: ARM port
- Posted by coconut Sep 06, 2011
- 5012 views
I seem to recall very similar errors happening. I believe that ARM processors require 16 byte alignment or something. We've probably either missed doing so somewhere or had a regression.
Yes, I use to get this illegal instruction when we first started:
0x002ff9b4 in decompress (c=251) at be_decompress.c:75 75 d = (double)*(float *)string_ptr;
Which was fixed with:
float f; d = (double)*(float*)memcpy((void*)&f, (void*)string_ptr, 4);
Jacques, for your illegal instruction, can you give this a try?
... //--d= *(double *)string_ptr; memcpy(&d, (double *)string_ptr, 8); ...
Thanks,
Ira
Tested and problem solved. Now I can run the demo's.
thanks Ira,
Jacques
23. Re: ARM port
- Posted by coconut Sep 06, 2011
- 5021 views
What mercurial command should I use to have a copy of the ARM branch source code on my EfikaMx netbook.
Jacques
24. Re: ARM port
- Posted by coconut Sep 06, 2011
- 4991 views
another error running unix/qsort.ex
ticket #709
/home/jacques/eu410d/include/std/dll.e:529 in function call_back() Internal error: CallBack routine id patch failed: missing magic. id = 3 ... called from /home/jacques/eu410d/demo/unix/qsort.ex:31 Public & Export & Global & Local Variables /home/jacques/eu410d/include/std/memconst.e: DEP_really_works = 0 use_DEP = 1 FREE_RID = 2 kernel_dll = <no value> memDLL_id = <no value> VirtualAlloc_rid = <no value> VirtualLock_rid = <no value> VirtualUnlock_rid = <no value> VirtualProtect_rid = <no value> GetLastError_rid = <no value> GetSystemInfo_rid = <no value> /home/jacques/eu410d/include/std/memory.e: edges_only = <no value> check_calls = 1 VirtualFree_rid = <no value> /home/jacques/eu410d/include/std/types.e: Defined_Sets = { {98'b',99'c',100'd',102'f',103'g',104'h',106'j',107'k', 108'l',109'm',110'n',112'p',113'q',114'r',115's',116't',118'v',119'w',120'x', 121'y',122'z',66'B',67'C',68'D',70'F',71'G',72'H',74'J',75'K',76'L',77'M', 78'N',80'P',81'Q',82'R',83'S',84'T',86'V',87'W',88'X',89'Y',90'Z'}, {97'a',101'e',105'i',111'o',117'u',65'A',69'E',73'I', 79'O',85'U'}, { {48'0',57'9'}, {65'A',70'F'}, {97'a',102'f'} }, {32' ',9,10,13,11,160}, { {32' ',47'/'}, {58':',63'?'}, {91'[',96'`'}, {123'{',126'~'} }, { {32' ',126'~'} }, { {32' ',126'~'}, {32' ',32' '}, {9,9}, {10,10}, {13,13}, {8,8}, {7,7} }, { {97'a',122'z'} }, { {65'A',90'Z'} }, { {48'0',57'9'}, {97'a',122'z'}, {65'A',90'Z'} }, { {48'0',57'9'}, {97'a',122'z'}, {65'A',90'Z'}, {95'_',95'_'} }, { {97'a',122'z'}, {65'A',90'Z'} }, { {0,127} }, { {0,31}, {127,127} }, { {48'0',57'9'} }, { {33'!',126'~'} }, { {0,255} }, {95'_'}, {1,0} } /home/jacques/eu410d/include/std/machine.e: FREE_ARRAY_RID = 1 page_size = 4096 /home/jacques/eu410d/demo/unix/qsort.ex: libc = 715933600 qid = 3 nitems = <no value> item_size = <no value> qsort = <no value> ncalls = 0 qaddr = <no value> array = <no value>
jacques
25. Re: ARM port
- Posted by jimcbrown (admin) Sep 06, 2011
- 4963 views
I seem to recall seeing this issue in this thread: http://openeuphoria.org/forum/115695.wc message:115695
The solution there was to change CALLBACK_SIZE but that wasn't enough, it needed to be made into a relative address too, but exactly how to do that wasn't stated... - at least not in a cookbook style answer.
Another solution would be to use be_callc_conly.c instead of be_callc.c (you just rename the files as the conly version is just a drop-in replacement), which removes the need to deal with assembly and machine code.
another error running unix/qsort.ex
ticket #709
/home/jacques/eu410d/include/std/dll.e:529 in function call_back() Internal error: CallBack routine id patch failed: missing magic. id = 3 ... called from /home/jacques/eu410d/demo/unix/qsort.ex:31 Public & Export & Global & Local Variables /home/jacques/eu410d/include/std/memconst.e: DEP_really_works = 0 use_DEP = 1 FREE_RID = 2 kernel_dll = <no value> memDLL_id = <no value> VirtualAlloc_rid = <no value> VirtualLock_rid = <no value> VirtualUnlock_rid = <no value> VirtualProtect_rid = <no value> GetLastError_rid = <no value> GetSystemInfo_rid = <no value> /home/jacques/eu410d/include/std/memory.e: edges_only = <no value> check_calls = 1 VirtualFree_rid = <no value> /home/jacques/eu410d/include/std/types.e: Defined_Sets = { {98'b',99'c',100'd',102'f',103'g',104'h',106'j',107'k', 108'l',109'm',110'n',112'p',113'q',114'r',115's',116't',118'v',119'w',120'x', 121'y',122'z',66'B',67'C',68'D',70'F',71'G',72'H',74'J',75'K',76'L',77'M', 78'N',80'P',81'Q',82'R',83'S',84'T',86'V',87'W',88'X',89'Y',90'Z'}, {97'a',101'e',105'i',111'o',117'u',65'A',69'E',73'I', 79'O',85'U'}, { {48'0',57'9'}, {65'A',70'F'}, {97'a',102'f'} }, {32' ',9,10,13,11,160}, { {32' ',47'/'}, {58':',63'?'}, {91'[',96'`'}, {123'{',126'~'} }, { {32' ',126'~'} }, { {32' ',126'~'}, {32' ',32' '}, {9,9}, {10,10}, {13,13}, {8,8}, {7,7} }, { {97'a',122'z'} }, { {65'A',90'Z'} }, { {48'0',57'9'}, {97'a',122'z'}, {65'A',90'Z'} }, { {48'0',57'9'}, {97'a',122'z'}, {65'A',90'Z'}, {95'_',95'_'} }, { {97'a',122'z'}, {65'A',90'Z'} }, { {0,127} }, { {0,31}, {127,127} }, { {48'0',57'9'} }, { {33'!',126'~'} }, { {0,255} }, {95'_'}, {1,0} } /home/jacques/eu410d/include/std/machine.e: FREE_ARRAY_RID = 1 page_size = 4096 /home/jacques/eu410d/demo/unix/qsort.ex: libc = 715933600 qid = 3 nitems = <no value> item_size = <no value> qsort = <no value> ncalls = 0 qaddr = <no value> array = <no value>
jacques
26. Re: ARM port
- Posted by Jerome Sep 06, 2011
- 5017 views
The solution there was to change CALLBACK_SIZE but that wasn't enough, it needed to be made into a relative address too, but exactly how to do that wasn't stated... - at least not in a cookbook style answer.
Another solution would be to use be_callc_conly.c instead of be_callc.c (you just rename the files as the conly version is just a drop-in replacement), which removes the need to deal with assembly and machine code.
The patch I submitted that worked on my ARM system involved changing the CALLBACK_SIZE and using the c_only version of be_callc.c. If there were changes for the relative address, I didn't personally do it. Also, it looks like the version of be_callc.c in the ARM branch makes use of the c_only version as well. We do seem to be tackling the same issues though with the Efika netbook that we wen't through with my Nokia system. ... I'm not sure what the underlying difference is or the best way to make the source compatible with different ARM systems. Thoughts?
Thanks,
Ira
27. Re: ARM port
- Posted by jimcbrown (admin) Jan 11, 2012
- 4548 views
- Last edited Jan 12, 2012
The solution there was to change CALLBACK_SIZE but that wasn't enough, it needed to be made into a relative address too, but exactly how to do that wasn't stated... - at least not in a cookbook style answer.
Another solution would be to use be_callc_conly.c instead of be_callc.c (you just rename the files as the conly version is just a drop-in replacement), which removes the need to deal with assembly and machine code.
The patch I submitted that worked on my ARM system involved changing the CALLBACK_SIZE and using the c_only version of be_callc.c. If there were changes for the relative address, I didn't personally do it. Also, it looks like the version of be_callc.c in the ARM branch makes use of the c_only version as well. We do seem to be tackling the same issues though with the Efika netbook that we wen't through with my Nokia system. ... I'm not sure what the underlying difference is or the best way to make the source compatible with different ARM systems. Thoughts?
Thanks,
Ira
The ARM branch has already been merged into the 4.1.0 branch. There have been a few touchups to the ARM code since then.
I just tested this out today, and I was able to compile an arm binary as follows:
# on x86 box hg clone http://scm.openeuphoria.org/hg/euphoria euphoria-arm cd euphoria-arm hg update default cp ../euphoria/bin/eui ./bin cd source ./configure --arch=ARM vi config.gnu # hand edit config.gnu to set EUPHORIA=1 make source rm ../bin/eui rm mkver vi config.gnu # hand edit config.gnu to set EUPHORIA=0 cd ../.. tar -jcf arm.tbz euphoria-arm # on arm box tar -jxf /tmp/arm.tbz cd euphoria-arm/source make
I tested both callc.ex and mylib.ex and they work perfectly. I did this on the ARM port of Ubuntu 9.10 with gcc 4.4.1-4ubuntu8 running under a B&N Nook Color.
According to Wikipedia, the Nook Color uses an ARM Cortex-A8-based TI OMAP3621 which uses the ARM v7 instruction set.
I'm working on getting official ARM eubins built.
Here's a thread and website which shows just how long Euphoria has had an unofficial ARM port:
http://forum.openhandhelds.org/viewtopic.php?f=14&t=1407 http://jiggawatt.org/badc0de/android/eu/
Edit: Fix command to clone from repo
28. Re: ARM port
- Posted by Jerome Jan 12, 2012
- 4270 views
The ARM branch has already been merged into the 4.1.0 branch. There have been a few touchups to the ARM code since then.
I just tested this out today, and I was able to compile an arm binary as follows...
Great news! I just grabbed the updated version, and it also works great on my n900 which has the OMAP3430 ARM Cortex A8. If you need help with testing or anything similar for Euphoria on ARM, I'm happy to give another data point.
Thanks,
Ira
29. Re: ARM port
- Posted by raseu Jan 12, 2012
- 4219 views
I have just tried to pull the ARM code
using the following (as outlined in previous post).
$ hg pull http://scm.openeuphoria.org/hg/euphoria euphoria-arm
I get the following error
hg pull: invalid arguments
I am used to using either git or svn,
so any help using hg would be appreciated
30. Re: ARM port
- Posted by Jerome Jan 12, 2012
- 4222 views
$ hg pull http://scm.openeuphoria.org/hg/euphoria euphoria-arm
That should actually be the following to clone a fresh copy:
hg clone http://scm.openeuphoria.org/hg/euphoria euphoria-arm
Thanks,
Ira
31. Re: ARM port
- Posted by jimcbrown (admin) Jan 12, 2012
- 4215 views
$ hg pull http://scm.openeuphoria.org/hg/euphoria euphoria-arm
That should actually be the following to clone a fresh copy:
hg clone http://scm.openeuphoria.org/hg/euphoria euphoria-arm
Thanks,
Ira
Thanks, I fixed the original post to reflect this.
33. Re: ARM port
- Posted by jimcbrown (admin) Jan 13, 2012
- 4043 views
I'm working on getting official ARM eubins built.
Now available here: http://openeuphoria.org/eubins/linux/4.1.0/arm-32-bit/eubin-arm-cortex-a8-2012-01-13-ee49c6b8a340.tar.gz
34. Re: ARM port
- Posted by mattlewis (admin) Feb 19, 2013
- 2866 views
The ARM branch has already been merged into the 4.1.0 branch. There have been a few touchups to the ARM code since then.
I've incorporated rkdavis' patch for casting doubles to unsigned ints and pushed it up.
I also fixed up the ifdefs for architecture, so that we can now use EARM, EX86 and EX86_64 for the respective architectures. Our previous preprocessor tests didn't work correctly.
Matt