Self running on x86 Android Tablet

Chris Double chris.double at double.co.nz
Wed Sep 11 03:28:03 UTC 2013


Now that x86 Android tablets and phones are available I thought it'd be
interesting to try and get a version of Self running on one. I succeeded
in getting a Self binary running on the device. The REPL works but
there's no GUI as there's no currently available backend.

A screen shot of it running on a Samsung Galaxy Tab 3 10.1 is here:

<http://bluishcoder.co.nz/self/android_self.png>

The binary I used is:

<http://bluishcoder.co.nz/self/i686-android-linux-Self.bz2>

To run it on a device, uncompress it and push it to it:

  $ bunzip2 i686-android-linux-Self.bz2
  $ mv i686-android-linux-Self Self
  $ adb push Self /data/local/tmp
  $ adb shell
  device$ cd /data/local/tmp
  device$ chmod 0755 Self
  device$ ./Self

To build an image on the device, push the 'objects' directory there:

  $ adb push objects /data/local/tmp
  $ adb shell
  device$ cd /data/local/tmp
  device$ ./Self
  device# 'worldBuilder.self' _RunScript

You can run directly on the device by installing 'Terminal Emulator' or
a similar program instead of 'adb shell' from a connected PC.

To build this I made some hacks to the source to workaround Android
differences. The patch is here:

<http://bluishcoder.co.nz/self/android.patch>

It applies on top of my Tup tree at:

<https://github.com/doublec/self/tree/tup>

Build a standalone Android NDK for x86 with:

  $ cd $NDK_HOME
  $ ./build/tools/make-standalone-toolchain.sh --arch=x86 \
          --install-dir=/somewhere/stk

Add it to your patch and run 'tup upd' in the Self source directory with
that patch applied:

  $ cd $SELF_DIR
  $ export PATH=/somewhere/stk/bin:$PATH
  $ tup init  # <-- only needs to be run once
  $ tup upd

The resulting 'Self' binary is the Android binary and will run on x86 devices.

Chris.
-- 
http://www.bluishcoder.co.nz



More information about the Self-interest mailing list