December 26, 2011

ARM support released

We are pleased to announce that Red/System v0.2.3 is out, extending Red to the mobile world with a complete support for Linux on ARMv5+ processors. The new port supports 100% of Red/System features and passes successfully the 8537 unit tests.

For those of you interested in more details, our ARM port targets the v5 family, with 32-bit instructions (no Thumb support) and optional literals pools (use -l or --literal-pool command-line option when compiling) that implement a global allocation strategy (unlike gcc's function-local allocations).

New compilation targets have been provided for Linux and derivative OS running on ARM:

  • Linux-ARM
  • Android

Android support is using the same code as Linux-ARM, only differing in libc and dynamic linker names.

Currently, as Red/System only works on command-line in Android, you need a special loader to download the executable and run it. This can be achieved using the NativeExe appYou will need to allow temporary installing apps from non market sources (Settings > Applications > Unknown sources). Also, your local 3G provider might be filtering out executables downloaded this way, you can workaround that by either manually loading the NativeExe-0.2.apk file with adb, or share a wired Internet connection with your mobile device.

You can easily install NativeExe app by just typing the following URL in your Android web browser:

http://gimite.net/archive/NativeExe-0.2.apk

or by scanning this QR-code instead:

Once done, input in the second field: http://sidl.fr/red/hello and hit [Run]. 


Here are a few screenshots of HelloWorld tests:

hello.reds script on Android 2.2

hello.reds script on Linux Debian 6.0 in QEMU


Andreas has also reported that it's working fine on Nokia N9 devices.


Supporting Android and iOS API

The next steps to enable building full apps on Android and iOS are:

  1. Support PIC compilation mode: indirect access to all global variables and data. This is a requirement for building shared libraries on UNIX (but optional on Windows).
  2. Add shared library generation to file format emitters. This will require some new compilation directives to mark the exported code parts.
  3. Build a bridge with Java for Android and Objective-C for iOS/OSX. This generic bridge would allow accessing all the objects and methods of the host and send back to Red all I/O events.

Such approach will allow us to build easily Android or iOS apps without having to write a single line of Java or Objective-C code, while providing the full power of  Red. At least, that's the theory, we'll see in practice if it's up to our expectations. Also, cross-compilation should be fully available for Android (producing Android apps from any OS), but code signing and app publishing requirements might make it impossible for iOS and require a MacOS X with Xcode for producing apps (if you know workarounds, let us know).

The PIC support should be doable in a few days, the support for shared library generation might take a bit more time. Anyway, theses tasks will need to be multiplexed with Red runtime & compiler implementation, so don't expect significant progress before a month.

In the meantime, you are welcome to test the ARM port of Red/System and hack Android and upcoming Raspberry Pi devices using it. ;-)

Cheers!

5 comments:

  1. Working fine here on my Nexus S running ice cream sandwich. Next stop full red and a console!
    Great work.

    ReplyDelete
  2. Glad to know it works fine on ICS! Yes, next milestones will be very exciting as Red will start to emerge.

    Thanks for your support!

    ReplyDelete
  3. Fantastic! Working on LG Optimus.

    ReplyDelete
  4. Yes ! HelloWorld works fine on my Nokia N900 !

    ReplyDelete
  5. Works on my Samsung Exhibit II. How cool Doc.

    ReplyDelete

Fork me on GitHub