ARM Cogit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ARM Cogit

Eliot Miranda-2
Hi All,

    thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator.  We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve.  But we're at least ready to start trying to compile the JIT VM for ARM.  Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur.  Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
--
best,
Eliot


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] ARM Cogit

douglas mcpherson
> On Apr 22, 2015, at 11:42, Eliot Miranda <[hidden email]> wrote:
>
> Hi All,
>
>     thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator.  We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve.  But we're at least ready to start trying to compile the JIT VM for ARM.  Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur.  Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
> --
> best,
> Eliot

+1000
This is terrific news! Thanks to you, Tim, and Lars!

Doug
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] ARM Cogit

Eliot Miranda-2
In reply to this post by Eliot Miranda-2
Hi Holger,

On Wed, Apr 22, 2015 at 11:52 AM, Holger Freyther <[hidden email]> wrote:


> On 22 Apr 2015, at 14:42, Eliot Miranda <[hidden email]> wrote:

Hi,

>     thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator.  We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve.  But we're at least ready to start trying to compile the JIT VM for ARM.  Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur.  Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.

tricky in which sense? The Linux kernel offers a syscall (cacheflush) where one
provides the start page and end page and GCC provides a builtin function for this
as well (__clear_cache).

 that's good news.  It wasn't always that easy.  When we got the ARM JIT working for VisualWorks we had to use hand-rolled code to flush the cache as linux didn't provide a reliable function at that time.  So perhaps we're closer than we think.  But it's always wise to lengthen time estimates, not shorten them :-)

holger


cache flush:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/traps.c?id=9ea18f8cab5f1c36cdd0f09717e35ceb48c36a87#n611



--
best,
Eliot


Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] ARM Cogit

timrowledge
In reply to this post by Eliot Miranda-2
And this code (pulled from the Pi forum, written by ???) demonstrates -
#include <stdio.h>
#include <sys/mman.h>
#include <stdint.h>
#include <stdlib.h>

int inc(int x){ //increments x

    uint32_t *ret = mmap(NULL,
            2 * sizeof(uint32_t),  // Space for 16 instructions. (More than enough.)
            PROT_READ | PROT_WRITE | PROT_EXEC,
            MAP_PRIVATE | MAP_ANONYMOUS,
            -1,0);
    if (ret == MAP_FAILED) {
        printf("Could not mmap a memory buffer with the proper permissions.\n");
        return -1;
    }

    *(ret + 0) = 0xE2800001; //add r0 r0 #1 := r0 += 1
    *(ret + 1) = 0xE12FFF1E; //bx lr        := jump back to inc()

    __clear_cache((char*) ret, (char*) (ret+2));

    int(*f)(int) = (int (*)(int)) ret;
    return (*f)(x);
}

int main(){
    printf("%d\n",inc(6)); //expect '7' to be printed
exit(0);}

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: YVR: Branch to Vancouver



Reply | Threaded
Open this post in threaded view
|

Re: ARM Cogit

Karl Ramberg
In reply to this post by Eliot Miranda-2
This is awesome. 

Karl

On Wed, Apr 22, 2015 at 8:42 PM, Eliot Miranda <[hidden email]> wrote:
Hi All,

    thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator.  We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve.  But we're at least ready to start trying to compile the JIT VM for ARM.  Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur.  Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
--
best,
Eliot






Reply | Threaded
Open this post in threaded view
|

re: ARM Cogit

ccrraaiigg
In reply to this post by Eliot Miranda-2

> thanks to hard work by Tim Rowledge and Lars Wasserman we now have a
> functional JIT for the ARM in the simulator... Hopefully a fast VM
> for Raspberry Pi and Android is only a few weeks away.

     Congratulations!


-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

Re: ARM Cogit

Ben Coman
In reply to this post by Eliot Miranda-2


On Thu, Apr 23, 2015 at 2:42 AM, Eliot Miranda <[hidden email]> wrote:
Hi All,

    thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator.  We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve.  But we're at least ready to start trying to compile the JIT VM for ARM.  Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur.  Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
--
best,
Eliot




Really cool news to hear.  I think this will prompt me to buy a RasPi.
cheers -ben


Reply | Threaded
Open this post in threaded view
|

Re: ARM Cogit

Casey Ransberger-2
In reply to this post by Eliot Miranda-2
Holy cow! That's so cool! And *timely.*

--C

> On Apr 22, 2015, at 11:42 AM, Eliot Miranda <[hidden email]> wrote:
>
> Hi All,
>
>     thanks to hard work by Tim Rowledge and Lars Wasserman we now have a functional JIT for the ARM in the simulator.  We're still probably some weeks away from a functional ARM JIT VM; issues like instruction cache flushing on real hardware can be tricky to solve.  But we're at least ready to start trying to compile the JIT VM for ARM.  Doug, see that I added a build directory for build.linux32ARM/squeak.cog.spur.  Hopefully a fast VM for Raspberry Pi and Android is only a few weeks away.
> --
> best,
> Eliot
>